Skip to content

Instantly share code, notes, and snippets.

@jsarenik
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsarenik/2989f0f83b09d432d77f to your computer and use it in GitHub Desktop.
Save jsarenik/2989f0f83b09d432d77f to your computer and use it in GitHub Desktop.
compile-toolchain.sh
#!/bin/sh -ex
#
# $ ls toolchain/src/
# gcc-4.8.4.tar.gz mpc-1.0.3.tar.gz
# gmp-6.0.0a.tar.xz mpfr-3.1.2.tar.gz
# $ cat /etc/debian_version
# 6.0.10
export LC_ALL=C
export LANG=C
TC=$HOME/toolchain
export LD_LIBRARY_PATH=$TC/lib
export PATH=$TC/bin:$PATH
test -d $TC || mkdir $TC
test -d $TC/src/build || mkdir $TC/src/build
uac() {
PKG=$1
tar xf ${PKG}-*.tar.*
shift
mkdir build/${PKG}-build
cd build/${PKG}-build
../../${PKG}-*/configure --prefix=$TC $*
make
make prefix=$TC install
cd ../..
find . -maxdepth 1 -type d -name "${PKG}*" -exec rm -rf {} \;
}
uac gmp
uac mpfr --with-gmp=$TC
uac mpc --with-gmp=$TC --with-mpfr=$TC
uac gcc --with-gmp=$TC --with-mpfr=$TC --with-mpc=$TC --enable-languages=c,c++ --disable-multilib --with-system-zlib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment