summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVAN BOSSUYT Nicolas <nicovb30@gmail.com>2019-04-15 15:16:47 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-29 13:12:20 +0200
commit4b05ec9549d2911a8d14166cba30a3a37c7209f9 (patch)
tree307477f8048877833c585fcddd8dc70d3eb3e4c4
parent0a0d739e98327e5244106931d1fbe1e7a796e35b (diff)
downloadserenity-4b05ec9549d2911a8d14166cba30a3a37c7209f9.zip
Toolchain: Added build script (wip)
-rw-r--r--.gitignore3
-rw-r--r--Toolchain/BuildIt.sh57
-rw-r--r--Toolchain/Patches/binutils.patch (renamed from Meta/binutils-2.32-serenity.patch)0
-rw-r--r--Toolchain/Patches/gcc.patch (renamed from Meta/gcc-8.3.0-serenity.patch)0
-rw-r--r--Toolchain/UseIt.sh1
5 files changed, 60 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 8f9bf9259c..1dc4fe798b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,5 +7,6 @@
*.includes
*.cflags
*.cxxflags
-Patches
Root
+Toolchain/Tarballs
+Toolchain/Build
diff --git a/Toolchain/BuildIt.sh b/Toolchain/BuildIt.sh
new file mode 100644
index 0000000000..3b629a8280
--- /dev/null
+++ b/Toolchain/BuildIt.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+TARGET=i686-pc-serenity
+PREFIX="$DIR/Local"
+
+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"
+ 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"
+ fi
+
+ if [ ! -d "binutils-2.32" ]; then
+ tar -xf "binutils-2.32.tar.gz"
+
+ pushd "binutils-2.32"
+ patch -p1 < $DIR/Patches/binutils.patch
+ popd
+ fi
+
+ if [ ! -d "gcc-8.3.0" ]; then
+ tar -xf "gcc-8.3.0.tar.gz"
+
+ pushd "gcc-8.3.0"
+ patch -p1 < $DIR/Patches/gcc.patch
+ popd
+ 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
+ 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
+ make -j $(nproc) all-gcc all-target-libgcc
+ make install-gcc install-target-libgcc
+ popd
+popd \ No newline at end of file
diff --git a/Meta/binutils-2.32-serenity.patch b/Toolchain/Patches/binutils.patch
index 7454911fe1..7454911fe1 100644
--- a/Meta/binutils-2.32-serenity.patch
+++ b/Toolchain/Patches/binutils.patch
diff --git a/Meta/gcc-8.3.0-serenity.patch b/Toolchain/Patches/gcc.patch
index 61c7aab25c..61c7aab25c 100644
--- a/Meta/gcc-8.3.0-serenity.patch
+++ b/Toolchain/Patches/gcc.patch
diff --git a/Toolchain/UseIt.sh b/Toolchain/UseIt.sh
new file mode 100644
index 0000000000..cc1f786e84
--- /dev/null
+++ b/Toolchain/UseIt.sh
@@ -0,0 +1 @@
+#!/bin/bash \ No newline at end of file