-
-
Save notmatt/7283504 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/bin/bash | |
| export TARGET=x86_64-sun-solaris2.11 | |
| export PREFIX=$HOME/Documents/gcc/cross/$TARGET | |
| export SYSROOT=$PREFIX/sysroot | |
| export PATH=$PATH:$PREFIX/bin | |
| export SCRATCH=$HOME/Documents/gcc/scratch | |
| export BINUTILS=binutils-2.23.2 | |
| export GCC=gcc-4.7.3 | |
| sudo apt-get install texinfo binutils build-essential libgmp-dev libmpfr-dev libmpc-dev | |
| mkdir $PREFIX | |
| mkdir $SYSROOT | |
| pushd $SYSROOT/ | |
| ssh root@ns2 "tar -cf - /usr/include" | tar -xvf - | |
| ssh root@ns2 "tar -cf - /opt/local/include" | tar -xvf - | |
| ssh root@ns2 "tar -cf - /opt/local/gcc47/include" | tar -xvf - | |
| ssh root@ns2 "tar -cf - /lib" | tar -xvf - | |
| ssh root@ns2 "tar -cf - /usr/lib" | tar -xvf - | |
| ssh root@ns2 "tar -cf - /usr/gnu/lib" | tar -xvf - | |
| mkdir $SCRATCH | |
| pushd $SCRATCH/ | |
| wget http://ftp.gnu.org/gnu/binutils/$BINUTILS.tar.gz | |
| tar -xvzf $BINUTILS.tar.gz | |
| mkdir $SCRATCH/build-binutils | |
| pushd $SCRATCH/build-binutils/ | |
| ../$BINUTILS/configure -target=$TARGET --prefix=$PREFIX --with-sysroot=$SYSROOT -v | |
| make all && make install | |
| popd | |
| wget http://ftp.gnu.org/gnu/gcc/$GCC/$GCC.tar.gz | |
| tar -xvzf $GCC.tar.gz | |
| mkdir $SCRATCH/build-gcc | |
| pushd $SCRATCH/build-gcc/ | |
| ../$GCC/configure --target=$TARGET --with-gnu-as --with-gnu-ld --with-gmp \ | |
| --with-mpfr --with-mpc --prefix=$PREFIX --with-sysroot=$SYSROOT \ | |
| --disable-libgcj --enable-languages=c,c++ -v | |
| make all && make install | |
| popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment