2013-05-08 11:48:15 +04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
|
|
|
. $DIR/config.sh
|
|
|
|
. $DIR/util.sh
|
|
|
|
. $DIR/activate.sh
|
|
|
|
|
|
|
|
pushd $DIR
|
|
|
|
|
|
|
|
# Grab extras
|
|
|
|
./extras.sh
|
|
|
|
|
|
|
|
MPC=mpc-0.9
|
|
|
|
GMP=gmp-5.0.1
|
|
|
|
MPFR=mpfr-3.0.1
|
|
|
|
GCCV=4.6.0
|
|
|
|
GCC=gcc-$GCCV
|
|
|
|
BINUTILS=binutils-2.22
|
|
|
|
|
|
|
|
VIRTPREFIX=/usr
|
|
|
|
REALPREFIX=$DIR/../hdd
|
|
|
|
|
|
|
|
if [ ! -d tarballs/$GCC/mpfr ]; then
|
|
|
|
mv tarballs/$MPFR tarballs/$GCC/mpfr
|
|
|
|
fi
|
2013-05-16 05:33:30 +04:00
|
|
|
if [ ! -d tarballs/$GCC/gmp ]; then
|
2013-05-08 11:48:15 +04:00
|
|
|
mv tarballs/$GMP tarballs/$GCC/gmp
|
|
|
|
fi
|
2013-05-16 05:33:30 +04:00
|
|
|
if [ ! -d tarballs/$GCC/mpc ]; then
|
2013-05-08 11:48:15 +04:00
|
|
|
mv tarballs/$MPC tarballs/$GCC/mpc
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Actual build process
|
|
|
|
|
|
|
|
pushd build || bail
|
|
|
|
if [ -d binutils-native ]; then
|
|
|
|
rm -rf binutils-native
|
|
|
|
fi
|
|
|
|
mkdir binutils-native
|
|
|
|
pushd binutils-native || bail
|
|
|
|
$DIR/tarballs/$BINUTILS/configure --prefix=$VIRTPREFIX --host=$TARGET --target=$TARGET || bail
|
|
|
|
make || bail
|
|
|
|
make DESTDIR=$REALPREFIX install || bail
|
|
|
|
popd
|
|
|
|
if [ -d gcc-native ]; then
|
|
|
|
rm -rf gcc-native
|
|
|
|
fi
|
|
|
|
mkdir gcc-native
|
|
|
|
pushd gcc-native || bail
|
2013-05-12 11:38:56 +04:00
|
|
|
make distclean
|
|
|
|
$DIR/tarballs/$GCC/configure --prefix=$VIRTPREFIX --host=$TARGET --target=$TARGET --disable-nls --enable-languages=c,c++ --disable-libssp --with-newlib || bail
|
2013-05-08 11:48:15 +04:00
|
|
|
make all-gcc || bail
|
|
|
|
make DESTDIR=$REALPREFIX install-gcc || bail
|
|
|
|
make all-target-libgcc || bail
|
|
|
|
make DESTDIR=$REALPREFIX install-target-libgcc || bail
|
2013-05-12 11:38:56 +04:00
|
|
|
touch $PREFIX/$TARGET/include/fenv.h
|
|
|
|
make all-target-libstdc++-v3 || bail
|
|
|
|
make DESTDIR=$REALPREFIX install-target-libstdc++-v3 || bail
|
2013-05-08 11:48:15 +04:00
|
|
|
popd
|
|
|
|
|
|
|
|
TMP_INCFIX=$REALPREFIX$VIRTPREFIX/lib/gcc/$TARGET/$GCCV/include-fixed
|
|
|
|
|
|
|
|
if [ -d $TMP_INCFIX ]; then
|
|
|
|
rm -r "$TMP_INCFIX"
|
|
|
|
fi
|
|
|
|
|
2013-05-12 11:38:56 +04:00
|
|
|
pushd $REALPREFIX$VIRTPREFIX/bin || bail
|
2013-05-08 11:48:15 +04:00
|
|
|
$TARGET-strip *
|
|
|
|
popd
|
|
|
|
|
|
|
|
pushd $REALPREFIX$VIRTPREFIX/libexec/gcc/$TARGET/$GCCV || bail
|
|
|
|
$TARGET-strip cc1 collect2
|
|
|
|
popd
|
|
|
|
|
|
|
|
popd
|