Created
February 2, 2010 12:54
-
-
Save kristianmandrup/292638 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function install_mpfr { | |
lib_name=$1 | |
if [ ! -d $lib_name ] | |
then | |
if [ ! -f $lib_name.tar.bz2 ]; then | |
curl -O http://www.mpfr.org/mpfr-current/$lib_name.tar.bz2 | |
fi | |
tar xjf $lib_name.tar.bz2 | |
cd $lib_name | |
./configure | |
make | |
make install | |
cd .. | |
fi | |
} | |
function install_mpc { | |
lib_name=$1 | |
if [ ! -d $lib_name ] | |
then | |
if [ ! -f $lib_name.tar.gz ]; then | |
curl -O http://www.multiprecision.org/mpc/download/$lib_name.tar.gz | |
fi | |
tar xjf $lib_name.tar.gz | |
cd $lib_name | |
./configure | |
make | |
make install | |
cd .. | |
fi | |
} | |
function install_gmp { | |
lib_name=$1 | |
if [ ! -d $lib_name ] | |
then | |
if [ ! -f $lib_name.tar.bz2 ]; then | |
curl -O ftp://ftp.gmplib.org/pub/gmp-5.0.0/$lib_name.tar.bz2 | |
fi | |
tar xjf $lib_name.tar.bz2 | |
cd $lib_name | |
./configure | |
make | |
make install | |
cd .. | |
fi | |
} | |
function install_gcc { | |
lib_name=$1 | |
if [ ! -d $lib_name ] | |
then | |
if [ ! -f $lib_name.tar.gz ]; then | |
curl -O http://ftp.download-by.net/gnu/gnu/gcc/gcc-4.4.3/$lib_name.tar.gz | |
fi | |
tar xjf $lib_name.tar.gz | |
echo "to use installed libs 'mpfr' and 'mpc' outside default install locations use arguments pointing to lib locations" | |
echo "--with-mpfr [mpfr lib location] --with-mpc [mpc lib location]" | |
# | |
mkdir build | |
cd build | |
../gcc-*/configure --enable-languages=c,c++ | |
make | |
make install | |
cd .. | |
fi | |
} | |
# http://gist.github.com/292638.txt | |
function install_gcc_443 { | |
install_mpfr mpfr-2.4.2 | |
install_mpc mpc-0.8.1 | |
install_gmp gmp-5.0.0 | |
install_gcc gcc-4.4.3 | |
# cleanup | |
rm mpfr-2.4.2.tar.bz2 mpc-0.8.1.tar.gz gmp-5.0.0.tar.bz2 gcc-4.4.3.tar.gz | |
rm -rf mpfr-2.4.2 mpc-0.8.1 gmp-5.0.0 gcc-4.4.3 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment