summaryrefslogtreecommitdiff
path: root/binary/darwin/build-gcc
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-02-15 08:44:41 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-02-15 08:44:41 +0200
commitd845f920ec1f5cd6ef5a95366383e74725912441 (patch)
tree2969ea00c3dbb1553cde248fc918cfb241f361f6 /binary/darwin/build-gcc
parenta4a5194f4ffc82aa817f4b8e2d4f6d29dac1a0b9 (diff)
Add Mac OS X ODB binary build scripts
Diffstat (limited to 'binary/darwin/build-gcc')
-rwxr-xr-xbinary/darwin/build-gcc65
1 files changed, 65 insertions, 0 deletions
diff --git a/binary/darwin/build-gcc b/binary/darwin/build-gcc
new file mode 100755
index 0000000..93ffb41
--- /dev/null
+++ b/binary/darwin/build-gcc
@@ -0,0 +1,65 @@
+#! /usr/bin/env bash
+
+# Create GCC compiler Darwin distribution.
+#
+# -rebuild
+# -arch
+#
+trap 'exit 1' ERR
+
+function error ()
+{
+ echo "$*" 1>&2
+}
+
+arch=i686-apple-darwin8
+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 gcc-build
+
+# Need gcc-4.2.
+#
+export PATH=/usr/local/bin:$PATH
+
+# Clean everything up if we are rebuilding.
+#
+if [ $rebuild = y ]; then
+ rm -rf gcc-build/*
+ rm -rf /$arch/*
+fi
+
+# Build gcc
+#
+cd gcc-build
+
+if [ $rebuild = y ]; then
+ ../gcc-configure $arch
+fi
+
+make -j 2
+make install
+make -C $arch/libstdc++-v3 install-strip
+
+cd ..
+
+#cp ../gcc/gcc/config/darwin-sections.def /$arch/lib/gcc/$arch/4.5.1/plugin/include/