Skip to content

Instantly share code, notes, and snippets.

@KeithPiTsui
Forked from JosiahOne/install_infra.sh
Created December 19, 2020 09:29
Show Gist options
  • Save KeithPiTsui/c3d79f3e6fa9cab6a7b7977082cc17f8 to your computer and use it in GitHub Desktop.
Save KeithPiTsui/c3d79f3e6fa9cab6a7b7977082cc17f8 to your computer and use it in GitHub Desktop.
Install gcc prerequisites on macOS High Sierra
###############################################################################
# Script used to download, build, and install prerequisites for gcc on macOS. #
# Run this from the srcdir/ directory. #
###############################################################################
# Make infrastucture directory
mkdir infrastucture;
# Install GMP
set -e;
curl ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2 >> gmp.tar.bz2;
bzip2 -d gmp.tar.bz2;
tar -xf gmp.tar;
cp -r gmp-6.1.0/ infrastucture/gmp;
rm -r gmp-6.1.0;
rm gmp.tar;
cd infrastucture/gmp;
./configure;
make;
make check;
make install;
cd ../..;
set +e;
# Install MPFR
set -e;
curl ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2 >> mpfr.tar.bz2;
bzip2 -d mpfr.tar.bz2;
tar -xf mpfr.tar;
cp -r mpfr-3.1.4/ infrastucture/mpfr;
rm -r mpfr-3.1.4;
rm mpfr.tar;
cd infrastucture/mpfr;
./configure;
make;
make check;
make install;
cd ../..;
set +e;
# Install MPC
set -e;
curl ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gz >> mpc.tar.gz;
tar -zxf mpc.tar.gz;
cp -r mpc-1.0.3/ infrastucture/mpc;
cd infrastucture/mpc;
./configure;
make;
make check;
make install;
cd ../..;
set +e;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment