summaryrefslogtreecommitdiff
path: root/binary/linux-gnu/build-gcc
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-02-15 09:00:28 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-02-15 09:00:28 +0200
commitd1b1d1f6b9583cd4fb08fb2995a2209cfdf627d2 (patch)
treeb0638edb95713d97945ba2baefffe86b8c0cee83 /binary/linux-gnu/build-gcc
parentd845f920ec1f5cd6ef5a95366383e74725912441 (diff)
Add GNU/Linux ODB binary build scripts
Diffstat (limited to 'binary/linux-gnu/build-gcc')
-rwxr-xr-xbinary/linux-gnu/build-gcc77
1 files changed, 77 insertions, 0 deletions
diff --git a/binary/linux-gnu/build-gcc b/binary/linux-gnu/build-gcc
new file mode 100755
index 0000000..75131e1
--- /dev/null
+++ b/binary/linux-gnu/build-gcc
@@ -0,0 +1,77 @@
+#! /usr/bin/env bash
+
+# Create GCC compiler Linux distribution.
+#
+# -rebuild
+# -arch
+#
+trap 'exit 1' ERR
+
+function error ()
+{
+ echo "$*" 1>&2
+}
+
+arhc=x86_64-linux-gnu
+rebuild=n
+
+while [ $# -gt 0 ]; do
+ case $1 in
+ -rebuild)
+ rebuild=y
+ shift
+ ;;
+ -arch)
+ shift
+ arch=$1
+ shift
+ ;;
+ *)
+ error "unknown option: $1"
+ exit 1
+ ;;
+ esac
+done
+
+out_root=`pwd`
+
+mkdir -p binutils-build
+mkdir -p gcc-build
+
+# Clean everything up if we are rebuilding.
+#
+if [ $rebuild = y ]; then
+ rm -rf binutils-build/*
+ rm -rf gcc-build/*
+ rm -rf /$arch/*
+fi
+
+# Build binutils
+#
+cd binutils-build
+
+if [ $rebuild = y ]; then
+ ../binutils-configure $arch
+fi
+
+make -j 4
+make install
+cd ..
+
+# Remove installed binutils libraries.
+#
+rm -r /$arch/lib /$arch/include
+
+# Build gcc
+#
+cd gcc-build
+
+if [ $rebuild = y ]; then
+ ../gcc-configure $arch
+fi
+
+make -j 4
+make install
+make -C $arch/libstdc++-v3 install-strip
+
+cd ..