mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-06-26 09:25:18 -06:00
🧑💻 Update Sim, fix Mac native gcc
This commit is contained in:
parent
b79f7f203a
commit
487542083b
2 changed files with 27 additions and 22 deletions
|
@ -10,30 +10,29 @@
|
|||
which port >/dev/null && HAS_MACPORTS=1
|
||||
which brew >/dev/null && HAS_HOMEBREW=1
|
||||
|
||||
MACPORTS_PATH=$(dirname "$(which port)")
|
||||
if ((HAS_MACPORTS)); then
|
||||
MACPORTS_PATH=$(dirname "$(which port)")
|
||||
cd $MACPORTS_PATH
|
||||
sudo rm -f cpp gcc g++ cc ld
|
||||
cd -
|
||||
fi
|
||||
|
||||
if ((HAS_HOMEBREW)); then
|
||||
HOMEBREW_PATH="$(brew --prefix)/bin"
|
||||
cd $HOMEBREW_PATH
|
||||
rm -f cpp gcc g++ cc ld
|
||||
cd -
|
||||
fi
|
||||
|
||||
if [[ $1 == "apple" || $1 == "darwin" || $1 == "system" ]]; then
|
||||
|
||||
if ((HAS_MACPORTS)); then
|
||||
cd $MACPORTS_PATH
|
||||
sudo rm -f gcc g++ cc ld
|
||||
cd -
|
||||
fi
|
||||
|
||||
if ((HAS_HOMEBREW)); then
|
||||
cd $HOMEBREW_PATH
|
||||
sudo rm -f gcc g++ cc
|
||||
cd -
|
||||
fi
|
||||
# Nothing to do
|
||||
|
||||
elif [[ $1 =~ ".*ports" ]]; then
|
||||
|
||||
((HAS_MACPORTS)) || { echo "MacPorts is not installed"; exit 1; }
|
||||
|
||||
GCCV=$( find $MACPORTS_PATH -name "gcc-mp-*" | sort -r | head -1 | sed 's/.*gcc-mp-//' )
|
||||
GCCV=$( find $MACPORTS_PATH -name "cpp-mp-*" | sort -r | head -1 | sed 's/.*cpp-mp-//' )
|
||||
[[ $GCCV -ge 11 ]] || GCCV=14
|
||||
|
||||
getport() { port installed $1 | grep $1 || sudo port install $1; }
|
||||
|
@ -42,7 +41,7 @@ elif [[ $1 =~ ".*ports" ]]; then
|
|||
getports "gcc$GCCV" glm mesa libsdl2 libsdl2_net
|
||||
|
||||
cd $MACPORTS_PATH
|
||||
sudo rm -f gcc g++ cc ld
|
||||
sudo ln -s "cpp-mp-$GCCV" cpp
|
||||
sudo ln -s "gcc-mp-$GCCV" gcc
|
||||
sudo ln -s "g++-mp-$GCCV" g++
|
||||
sudo ln -s g++ cc
|
||||
|
@ -53,16 +52,22 @@ elif [[ $1 =~ ".*brew" ]]; then
|
|||
|
||||
((HAS_HOMEBREW)) || { echo "Homebrew is not installed"; exit 1; }
|
||||
|
||||
GCCV=$( find $HOMEBREW_PATH -name "gcc-*" | sort -r | head -1 | sed 's/.*gcc-//' )
|
||||
[[ $GCCV -ge 11 ]] || { brew install gcc@14 ; GCCV=14 }
|
||||
GCCV=$( find $HOMEBREW_PATH -name "cpp-*" | sort -r | head -1 | sed 's/.*cpp-//' )
|
||||
[[ $GCCV -ge 11 ]] || brew install gcc
|
||||
GCCV=$( find $HOMEBREW_PATH -name "cpp-*" | sort -r | head -1 | sed 's/.*cpp-//' )
|
||||
|
||||
brew install glm mesa sdl2 sdl2_net
|
||||
|
||||
cd $HOMEBREW_PATH
|
||||
sudo rm -f gcc g++ cc
|
||||
sudo ln -s "gcc-$GCCV" gcc
|
||||
sudo ln -s "g++-$GCCV" g++
|
||||
sudo ln -s g++ cc
|
||||
ln -s "cpp-$GCCV" cpp
|
||||
ln -s "gcc-$GCCV" gcc
|
||||
ln -s "g++-$GCCV" g++
|
||||
ln -s g++ cc
|
||||
if [[ -f "$MACPORTS_PATH/ld-classic" ]]; then
|
||||
ln -s "$MACPORTS_PATH/ld-classic" ld
|
||||
else
|
||||
echo "MacPorts may be required for a compatible 'ld' linker!"
|
||||
fi
|
||||
cd -
|
||||
|
||||
else
|
||||
|
|
|
@ -58,7 +58,7 @@ debug_build_flags = -fstack-protector-strong -g -g3 -ggdb
|
|||
lib_compat_mode = off
|
||||
build_src_filter = ${common.default_src_filter} +<src/HAL/NATIVE_SIM>
|
||||
lib_deps = ${common.lib_deps}
|
||||
MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/dd9c41f1b2.zip
|
||||
MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/af62611296.zip
|
||||
Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/c6b319f447.zip
|
||||
LiquidCrystal=https://github.com/p3p/LiquidCrystal/archive/322fb5fc23.zip
|
||||
extra_scripts = ${common.extra_scripts}
|
||||
|
@ -115,7 +115,7 @@ build_flags = -g2
|
|||
-DHAS_LIBBSD
|
||||
-I/opt/local/include
|
||||
-I/opt/local/include/freetype2
|
||||
-I/opt/local/include/SDL2/
|
||||
-I/opt/local/include/SDL2
|
||||
-L/opt/local/lib
|
||||
-Wl,-framework,OpenGl
|
||||
-Wl,-framework,CoreFoundation
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue