diff --git a/buildroot/bin/mac_gcc b/buildroot/bin/mac_gcc index 6c5d7ea24a..14ae3c4500 100755 --- a/buildroot/bin/mac_gcc +++ b/buildroot/bin/mac_gcc @@ -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 diff --git a/ini/native.ini b/ini/native.ini index f27285e83a..5f56b1c843 100644 --- a/ini/native.ini +++ b/ini/native.ini @@ -58,7 +58,7 @@ debug_build_flags = -fstack-protector-strong -g -g3 -ggdb lib_compat_mode = off build_src_filter = ${common.default_src_filter} + 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