cd $HOME
curl http://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.gz | tar xf -
curl http://mirror.inode.at/gnu/gcc/gcc-5.3.0/gcc-5.3.0.tar.gz | tar xf -
mkdir -p binutils-build gcc-build
mkdir -p sparcv9-solaris2.12/usr/include
mkdir -p sparcv9-solaris2.12/lib
mkdir -p sparcv9-solaris2.12/usr/lib
rsync -a torside:/lib/ sparcv9-solaris2.12/lib
rsync -a torside:/usr/include/ sparcv9-solaris2.12/usr/include
rsync -a torside:/usr/lib/ sparcv9-solaris2.12/usr/lib
cd $HOME/binutils-build
../binutils-2.26/configure --prefix $HOME/xgcc --bindir $HOME/bin --disable-werror --target sparcv9-solaris2.12 --with-sysroot=$HOME/sparcv9-solaris2.12
make -j5 && make install
cd $HOME/gcc-5.3.0
contrib/download_prerequisites
cd $HOME/gcc-build
../gcc-5.3.0/configure --prefix $HOME/xgcc --bindir $HOME/bin --target sparcv9-solaris2.12 --with-sysroot=$HOME/sparcv9-solaris2.12 --enable-languages=c --with-gnu-as --with-gnu-ld
make -j5 && make install