diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-02-15 09:02:53 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-02-15 09:02:53 +0200 |
commit | 0c0424b4f321a90028b12beb8959de707224e45e (patch) | |
tree | 767ffadbd487b00fd092b6f4f950477f5a22720b /binary/solaris/build-gcc | |
parent | d1b1d1f6b9583cd4fb08fb2995a2209cfdf627d2 (diff) |
Add Solaris ODB binary build scripts
Diffstat (limited to 'binary/solaris/build-gcc')
-rwxr-xr-x | binary/solaris/build-gcc | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/binary/solaris/build-gcc b/binary/solaris/build-gcc new file mode 100755 index 0000000..2258ba0 --- /dev/null +++ b/binary/solaris/build-gcc @@ -0,0 +1,69 @@ +#! /usr/bin/env bash + +# Create GCC compiler Solaris distribution. +# +# -rebuild +# -arch +# +trap 'exit 1' ERR + +function error () +{ + echo "$*" 1>&2 +} + +arhc=i686-solaris2.10 +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 + +# Make sure we have objdump. +# +objdump --version 2>/dev/null 1>&2 || { + error "no objdump can be found" + error "consider: ln -s /usr/sfw/bin/gobjdump /usr/local/bin/objdump" + exit 1 +} + +cpu=`echo $arch | sed -e 's/^\([^-]*\)-.*$/\1/'` + +mkdir -p gcc-build + +# 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 $cpu +fi + +# SPARC gas is buggy and cannot handle -g. +# +make -j 2 +make install +make -C $arch/libstdc++-v3 install-strip + +cd .. |