summaryrefslogtreecommitdiff
path: root/Toolchain/BuildIt.sh
diff options
context:
space:
mode:
authorVAN BOSSUYT Nicolas <nicovb30@gmail.com>2019-04-15 16:34:41 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-29 13:12:20 +0200
commitbe1100497d223481c0e4b1354c0c7737b8af2d23 (patch)
treeffed20e19a6abfc8c72fce601aff6d33b6daff6c /Toolchain/BuildIt.sh
parent4b05ec9549d2911a8d14166cba30a3a37c7209f9 (diff)
downloadserenity-be1100497d223481c0e4b1354c0c7737b8af2d23.zip
Toolchain: GCC and binutils are now configure correctly
Diffstat (limited to 'Toolchain/BuildIt.sh')
-rw-r--r--Toolchain/BuildIt.sh31
1 files changed, 24 insertions, 7 deletions
diff --git a/Toolchain/BuildIt.sh b/Toolchain/BuildIt.sh
index 3b629a8280..48dca5f046 100644
--- a/Toolchain/BuildIt.sh
+++ b/Toolchain/BuildIt.sh
@@ -1,56 +1,73 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+echo $DIR
+
TARGET=i686-pc-serenity
PREFIX="$DIR/Local"
+SYSROOT="$DIR/../Root"
mkdir -p "$DIR/Tarballs"
pushd "$DIR/Tarballs"
if [ ! -e "binutils-2.32.tar.gz" ]; then
wget "http://ftp.gnu.org/gnu/binutils/binutils-2.32.tar.gz"
+ else
+ echo "Skipped downloading binutils"
fi
if [ ! -e "gcc-8.3.0.tar.gz" ]; then
wget "http://ftp.gnu.org/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.gz"
+ else
+ echo "Skipped downloading gcc"
fi
if [ ! -d "binutils-2.32" ]; then
+ echo "Extracting binutils..."
tar -xf "binutils-2.32.tar.gz"
pushd "binutils-2.32"
- patch -p1 < $DIR/Patches/binutils.patch
+ patch -p1 < $DIR/Patches/binutils.patch > /dev/null
popd
+ else
+ echo "Skipped extracting binutils"
fi
if [ ! -d "gcc-8.3.0" ]; then
+ echo "Extracting gcc..."
tar -xf "gcc-8.3.0.tar.gz"
pushd "gcc-8.3.0"
- patch -p1 < $DIR/Patches/gcc.patch
+ patch -p1 < $DIR/Patches/gcc.patch > /dev/null
popd
+ else
+ echo "Skipped extracting gcc"
fi
popd
-exit
-
mkdir -p $PREFIX
mkdir -p "$DIR/Build/binutils"
mkdir -p "$DIR/Build/gcc"
pushd "$DIR/Build/"
-
unset PKG_CONFIG_LIBDIR # Just in case
pushd binutils
- $DIR/Tarballs/binutils-2.32/configure --target=$TARGET --prefix=$PREFIX --disable-werror || exit 1
+ $DIR/Tarballs/binutils-2.32/configure --prefix=$PREFIX \
+ --target=$TARGET \
+ --with-sysroot=$SYSROOT \
+ --disable-nls || exit 1
make -j $(nproc)
make install
popd
pushd gcc
- $DIR/Tarballs/gcc-8.3.0/configure --target=$TARGET --prefix=$PREFIX --disable-nls --enable-languages=c --disable-libssp --without-headers || exit 1
+ $DIR/Tarballs/gcc-8.3.0/configure --prefix=$PREFIX \
+ --target=$TARGET \
+ --with-sysroot=$SYSROOT \
+ --enable-languages=c,c++ || exit 1
+
make -j $(nproc) all-gcc all-target-libgcc
make install-gcc install-target-libgcc
popd