2018-03-16 16:40:23 +03:00
|
|
|
#!/bin/bash
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
2018-07-19 03:29:16 +03:00
|
|
|
$DIR/check-reqs.sh
|
|
|
|
|
2018-03-16 16:40:23 +03:00
|
|
|
TARGET=i686-pc-toaru
|
|
|
|
PREFIX="$DIR/local"
|
|
|
|
TOARU_SYSROOT="$DIR/../base"
|
|
|
|
|
|
|
|
cd "$DIR"
|
|
|
|
|
|
|
|
mkdir -p tarballs
|
|
|
|
|
|
|
|
pushd tarballs
|
|
|
|
if [ ! -e "binutils-2.27.tar.gz" ]; then
|
|
|
|
wget "http://ftp.gnu.org/gnu/binutils/binutils-2.27.tar.gz"
|
|
|
|
fi
|
|
|
|
if [ ! -e "gcc-6.4.0.tar.gz" ]; then
|
|
|
|
wget "http://www.netgull.com/gcc/releases/gcc-6.4.0/gcc-6.4.0.tar.gz"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d "binutils-2.27" ]; then
|
|
|
|
tar -xf "binutils-2.27.tar.gz"
|
|
|
|
pushd "binutils-2.27"
|
|
|
|
patch -p1 < $DIR/patches/binutils.patch > /dev/null
|
|
|
|
popd
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d "gcc-6.4.0" ]; then
|
|
|
|
tar -xf "gcc-6.4.0.tar.gz"
|
|
|
|
pushd "gcc-6.4.0"
|
|
|
|
patch -p1 < $DIR/patches/gcc.patch > /dev/null
|
|
|
|
popd
|
|
|
|
fi
|
|
|
|
popd
|
|
|
|
|
|
|
|
mkdir -p local
|
|
|
|
mkdir -p build
|
|
|
|
mkdir -p build/binutils
|
|
|
|
mkdir -p build/gcc
|
|
|
|
|
|
|
|
pushd build
|
|
|
|
|
|
|
|
unset PKG_CONFIG_LIBDIR # Just in case
|
|
|
|
|
2018-03-19 04:35:54 +03:00
|
|
|
pushd binutils
|
|
|
|
$DIR/tarballs/binutils-2.27/configure --target=$TARGET --prefix=$PREFIX --with-sysroot=$TOARU_SYSROOT --disable-werror || exit 1
|
|
|
|
make -j4
|
|
|
|
make install
|
|
|
|
popd
|
2018-03-16 16:40:23 +03:00
|
|
|
|
|
|
|
pushd gcc
|
2018-04-20 08:21:04 +03:00
|
|
|
$DIR/tarballs/gcc-6.4.0/configure --target=i686-pc-toaru --prefix=$PREFIX --with-sysroot=$TOARU_SYSROOT --disable-nls --enable-languages=c --disable-libssp --with-newlib || exit 1
|
2018-03-16 16:40:23 +03:00
|
|
|
make all-gcc all-target-libgcc
|
|
|
|
make install-gcc install-target-libgcc
|
|
|
|
popd
|
|
|
|
|
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
|
|
|