Skip to content

Commit

Permalink
Update build-toolchain.sh for mac os (#483)
Browse files Browse the repository at this point in the history
Fixes #461
Updates #460
  • Loading branch information
alexvnesta authored Jan 12, 2024
1 parent 3d02900 commit 3ed61bc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tools/build-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if [[ $OSTYPE == 'darwin'* ]]; then

# Install required dependencies. gsed is really required, the others are optionals
# and just speed up build.
brew install -q gmp mpfr libmpc gsed
brew install -q gmp mpfr libmpc gsed gcc isl libpng lz4 make mpc texinfo zlib

# FIXME: we could avoid download/symlink GMP and friends for a cross-compiler
# but we need to symlink them for the canadian compiler.
Expand All @@ -82,14 +82,17 @@ if [[ $OSTYPE == 'darwin'* ]]; then
"--with-gmp=$(brew --prefix)"
"--with-mpfr=$(brew --prefix)"
"--with-mpc=$(brew --prefix)"
"--with-zlib=$(brew --prefix)"
)

# Install GNU sed as default sed in PATH. GCC compilation fails otherwise,
# because it does not work with BSD sed.
PATH="$(brew --prefix gsed)/libexec/gnubin:$PATH"
export PATH
else
# Configure GCC arguments for non-macOS platforms
GCC_CONFIGURE_ARGS+=("--with-system-zlib")
fi

# Create build path and enter it
mkdir -p "$BUILD_PATH"
cd "$BUILD_PATH"
Expand Down Expand Up @@ -211,8 +214,7 @@ pushd gcc_compile_target
--disable-threads \
--disable-win32-registry \
--disable-nls \
--disable-werror \
--with-system-zlib
--disable-werror
make all-gcc -j "$JOBS"
make install-gcc || sudo make install-gcc || su -c "make install-gcc"
make all-target-libgcc -j "$JOBS"
Expand Down

0 comments on commit 3ed61bc

Please sign in to comment.