diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-02-15 09:00:28 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-02-15 09:00:28 +0200 |
commit | d1b1d1f6b9583cd4fb08fb2995a2209cfdf627d2 (patch) | |
tree | b0638edb95713d97945ba2baefffe86b8c0cee83 | |
parent | d845f920ec1f5cd6ef5a95366383e74725912441 (diff) |
Add GNU/Linux ODB binary build scripts
-rw-r--r-- | binary/common/manifest-gcc-binutils | 14 | ||||
-rw-r--r-- | binary/linux-gnu/NOTES | 10 | ||||
-rwxr-xr-x | binary/linux-gnu/binutils-configure | 9 | ||||
-rwxr-xr-x | binary/linux-gnu/build-dist | 194 | ||||
-rwxr-xr-x | binary/linux-gnu/build-gcc | 77 | ||||
-rwxr-xr-x | binary/linux-gnu/gcc-configure | 32 | ||||
-rwxr-xr-x | binary/linux-gnu/libcutl-configure | 8 | ||||
-rwxr-xr-x | binary/linux-gnu/libodb-boost-configure | 8 | ||||
-rwxr-xr-x | binary/linux-gnu/libodb-configure | 6 | ||||
-rwxr-xr-x | binary/linux-gnu/libodb-qt-configure | 7 | ||||
-rwxr-xr-x | binary/linux-gnu/odb-configure | 12 | ||||
-rw-r--r-- | binary/linux-gnu/test/clang-cxx11 | 16 | ||||
-rw-r--r-- | binary/linux-gnu/test/gcc | 21 | ||||
-rw-r--r-- | binary/linux-gnu/test/gcc-4.4 | 21 | ||||
-rw-r--r-- | binary/linux-gnu/test/gcc-minimal | 15 |
15 files changed, 450 insertions, 0 deletions
diff --git a/binary/common/manifest-gcc-binutils b/binary/common/manifest-gcc-binutils new file mode 100644 index 0000000..c492529 --- /dev/null +++ b/binary/common/manifest-gcc-binutils @@ -0,0 +1,14 @@ +This directory contains precompiled binaries for GNU binutils +and the GCC compiler. + +The GNU binutils and GCC distributions are comprised of several +different packages. Each of the various packages is governed by +its own individual copyright and licensing terms. Some of those +packages are licensed by the GNU Public License (GPL) or the GNU +Lesser General Public License(LGPL), some are licensed in the +Public Domain and some have their own open-source licenses. + +For full source code and licensing details see: + +GNU binutils: http://www.gnu.org/software/binutils/ +GCC: http://gcc.gnu.org diff --git a/binary/linux-gnu/NOTES b/binary/linux-gnu/NOTES new file mode 100644 index 0000000..978bc6b --- /dev/null +++ b/binary/linux-gnu/NOTES @@ -0,0 +1,10 @@ +* Need both binutils and GCC. + +* Had to enable NLS (--enable-nls) for GCC 4.7.3. When disabled there + were some errors during plugin compilation in libintl.h (looked like + plugin headers assumed NLS is enabled while libstdc++ (locale) assumed + it was disabled so provided some dummy macros for gettext, etc.) + +TODO: + +* Install plugin/gcc into lib64/ instead of lib/ for 64-bit binary. diff --git a/binary/linux-gnu/binutils-configure b/binary/linux-gnu/binutils-configure new file mode 100755 index 0000000..c3b526f --- /dev/null +++ b/binary/linux-gnu/binutils-configure @@ -0,0 +1,9 @@ +#! /bin/sh + +../../binutils-2.20.51/configure \ +--disable-nls \ +--prefix=/$1 \ +--build=$1 \ +--host=$1 \ +--target=$1 \ +CFLAGS=-O2 LDFLAGS=-s diff --git a/binary/linux-gnu/build-dist b/binary/linux-gnu/build-dist new file mode 100755 index 0000000..3dfbd62 --- /dev/null +++ b/binary/linux-gnu/build-dist @@ -0,0 +1,194 @@ +#! /usr/bin/env bash + +# Create ODB compiler Linux distribution. +# +# -rebuild +# -arch +# +trap 'exit 1' ERR + +function error () +{ + echo "$*" 1>&2 +} + +rebuild=n + +arch=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 + +wd=`pwd` +cpu=`echo $arch | sed -e 's/^\([^-]*\)-.*$/\1/'` + +cver=`echo libcutl-?.*.tar.gz | sed -e "s%libcutl-\(.*\).tar.gz%\1%"` +over=`echo odb-?.*.tar.gz | sed -e "s%odb-\(.*\).tar.gz%\1%"` +mver=`echo $over | sed -e 's%\([0-9]*\.[0-9]*\).*%\1%'` + +install_root="/tmp/odb-$over-$cpu-linux-gnu" + +export PATH=/$arch/bin:$PATH + +# Clean everything up if we are rebuilding. +# +if [ $rebuild = y ]; then + rm -rf libcutl + rm -rf odb + rm -rf $install_root + rm -rf libodb + rm -rf libodb-boost + rm -rf libodb-qt + + if [ ! -d ../boost-binary ]; then + error "no boost distribution in ../boost-binary" + exit 1 + fi + + tar xfz libcutl-$cver.tar.gz + mv libcutl-$cver libcutl + + tar xfz odb-$over.tar.gz + mv odb-$over odb + + libodb=`echo libodb-$mver.*.tar.gz | sed -e 's%\(.*\)\.tar\.gz%\1%'` + tar xfz $libodb.tar.gz + mv $libodb libodb + + libodb_boost=`echo libodb-boost-$mver.*.tar.gz | sed -e 's%\(.*\)\.tar\.gz%\1%'` + tar xfz $libodb_boost.tar.gz + mv $libodb_boost libodb-boost + + libodb_qt=`echo libodb-qt-$mver.*.tar.gz | sed -e 's%\(.*\)\.tar\.gz%\1%'` + tar xfz $libodb_qt.tar.gz + mv $libodb_qt libodb-qt +fi + +rm -f /tmp/odb-$over-$cpu-linux-gnu.tar.bz2 + +# Build libcutl +# +cd libcutl + +if [ $rebuild = y ]; then + ../libcutl-configure +fi + +make +cd .. + +# Build odb +# +cd odb + +if [ $rebuild = y ]; then + ../odb-configure $over $arch $install_root +fi + +make +make install-strip +cd .. + +# Build libodb +# +cd libodb + +if [ $rebuild = y ]; then + ../libodb-configure $install_root/lib/odb/$arch +fi + +make +cd odb +make install-data +cd ../.. + +# Build libodb-boost +# +cd libodb-boost + +if [ $rebuild = y ]; then + ../libodb-boost-configure $install_root/lib/odb/$arch +fi + +make +make install-data +cd .. + +# Build libodb-qt +# +cd libodb-qt + +if [ $rebuild = y ]; then + ../libodb-qt-configure $install_root/lib/odb/$arch +fi + +make +make install-data +cd .. + +# Copy /$arch over to installation +# +cp -r /$arch $install_root/lib/odb/ + +# Copy the default options file. +# +mkdir -p $install_root/etc/odb +cp -L ./default.options $install_root/etc/odb/ + +f="$install_root/etc/odb/default.options" + +echo '' >>$f +echo '# Debian/Ubuntu new multiarch support places certain headers into' >>$f +echo '# /usr/include/<arch>. Add that path to the search list but use' >>$f +echo '# -idirafter to make sure it is used as a last resort only.' >>$f +echo '#' >>$f +if [ "$arch" = "x86_64-linux-gnu" ]; then + echo '-idirafter /usr/include/x86_64-linux-gnu' >> $f +else + echo '-idirafter /usr/include/i386-linux-gnu' >> $f +fi + +# Copy manifest and README. +# +cp -L manifest $install_root/lib/odb/$arch/ +cp -L README $install_root/ + +# Move doc and man out of share/ +# +rm -rf $install_root/doc $install_root/man +mv $install_root/share/man $install_root/ +mv $install_root/share/doc/odb $install_root/doc +rm -r $install_root/share + + +# Clean some things up. +# +rm -f `find $install_root -name '*.la'` + +# Remove features.h from include-fixed. This file causes trouble on newer +# distributions. +# +include_fixed=`find $install_root/lib/odb/$arch -type d -name include-fixed` +rm $include_fixed/features.h + +# Pack it up. +# +cd /tmp +tar cfj $wd/test/odb-$over-$cpu-linux-gnu.tar.bz2 odb-$over-$cpu-linux-gnu +cd $wd 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 .. diff --git a/binary/linux-gnu/gcc-configure b/binary/linux-gnu/gcc-configure new file mode 100755 index 0000000..b2872a6 --- /dev/null +++ b/binary/linux-gnu/gcc-configure @@ -0,0 +1,32 @@ +#! /bin/sh + +extra= + +if test "$1" = "x86_64-linux-gnu"; then + extra="--libdir=/$1/lib64" +fi + +../../gcc/configure \ +--disable-bootstrap \ +--enable-languages=c,c++ \ +--disable-multiarch \ +--enable-shared \ +--disable-libssp \ +--disable-libgomp \ +--enable-nls \ +--disable-multilib \ +--disable-libstdcxx-pch \ +--prefix=/$1 \ +--enable-plugin \ +--build=$1 \ +--host=$1 \ +--target=$1 \ +--enable-cxx-flags=-fPIC \ +$extra \ +CFLAGS=-O2 CXXFLAGS=-O2 LDFLAGS=-s \ +CFLAGS_FOR_TARGET="-O2 -fPIC" CXXFLAGS_FOR_TARGET="-O2 -fPIC" + + +# --with-sysroot=/x86_64-linux-gnu + +#/x86_64-linux-gnu/bin/g++ -v -nodefaultlibs -shared -o libtest.so -fPIC ~/work/c++/sizeof_funds.cxx -Wl,-Bstatic,-lstdc++,-Bdynamic -lgcc -lgcc_eh -lm -lc diff --git a/binary/linux-gnu/libcutl-configure b/binary/linux-gnu/libcutl-configure new file mode 100755 index 0000000..c24abff --- /dev/null +++ b/binary/linux-gnu/libcutl-configure @@ -0,0 +1,8 @@ +#! /bin/sh + +./configure \ +--disable-shared \ +--with-pic \ +CXX="g++ -nodefaultlibs" \ +CXXFLAGS=-O2 \ +LIBS="-Wl,-Bstatic,-lstdc++,-Bdynamic -Wl,-lgcc -Wl,-lgcc_eh -Wl,-lm -Wl,-lc" diff --git a/binary/linux-gnu/libodb-boost-configure b/binary/linux-gnu/libodb-boost-configure new file mode 100755 index 0000000..e35281a --- /dev/null +++ b/binary/linux-gnu/libodb-boost-configure @@ -0,0 +1,8 @@ +#! /bin/sh + +./configure \ +--disable-shared \ +--enable-static \ +--with-libodb=../libodb \ +--with-boost=../../boost-binary \ +--prefix=$1 diff --git a/binary/linux-gnu/libodb-configure b/binary/linux-gnu/libodb-configure new file mode 100755 index 0000000..83107c7 --- /dev/null +++ b/binary/linux-gnu/libodb-configure @@ -0,0 +1,6 @@ +#! /bin/sh + +./configure \ +--disable-shared \ +--enable-static \ +--prefix=$1 diff --git a/binary/linux-gnu/libodb-qt-configure b/binary/linux-gnu/libodb-qt-configure new file mode 100755 index 0000000..12ff867 --- /dev/null +++ b/binary/linux-gnu/libodb-qt-configure @@ -0,0 +1,7 @@ +#! /bin/sh + +./configure \ +--disable-shared \ +--enable-static \ +--with-libodb=../libodb \ +--prefix=$1 diff --git a/binary/linux-gnu/odb-configure b/binary/linux-gnu/odb-configure new file mode 100755 index 0000000..2634a24 --- /dev/null +++ b/binary/linux-gnu/odb-configure @@ -0,0 +1,12 @@ +#! /bin/sh + +./configure \ +--with-libcutl=../libcutl \ +--disable-rpath \ +--with-gxx-name=../lib/odb/$2/bin/g++ \ +--with-options-file=../etc/odb/default.options \ +--prefix=$3 \ +--libexecdir=$3/lib \ +CXX="g++ -nodefaultlibs" \ +CXXFLAGS=-O2 \ +LIBS="-Wl,-Bstatic,-lstdc++,-Bdynamic -Wl,-lgcc -Wl,-lgcc_eh -Wl,-lm -Wl,-lc" diff --git a/binary/linux-gnu/test/clang-cxx11 b/binary/linux-gnu/test/clang-cxx11 new file mode 100644 index 0000000..f2c6d97 --- /dev/null +++ b/binary/linux-gnu/test/clang-cxx11 @@ -0,0 +1,16 @@ +sqlite_build_options= +sqlite_use_options= + +mysql_build_options= +mysql_use_options="--with-mysql-host=192.168.0.5" + +mssql_build_options= +mssql_use_options="--with-mssql-server=tcp:windows2008r2,1435" + +with_qt=y +with_boost=y + +CC=clang +CXX=clang++ +CXXFLAGS="-std=c++11 -O0 -W -Wall -Wno-unknown-pragmas" + diff --git a/binary/linux-gnu/test/gcc b/binary/linux-gnu/test/gcc new file mode 100644 index 0000000..f417bfd --- /dev/null +++ b/binary/linux-gnu/test/gcc @@ -0,0 +1,21 @@ +BOOST=$HOME/boost + +sqlite_build_options= +sqlite_use_options= + +mysql_build_options= +mysql_use_options="--with-mysql-host=192.168.0.5" + +mssql_build_options= +mssql_use_options="--with-mssql-server=tcp:windows2008r2,1435" + +with_qt=y +with_boost=y + +CC=gcc +CXX=g++ +CPPFLAGS="-I$BOOST" +CXXFLAGS="-O3 -W -Wall -Wno-unknown-pragmas" +LDFLAGS="-L$BOOST/stage/lib" + +export LD_LIBRARY_PATH=$BOOST/stage/lib:$LD_LIBRARY_PATH diff --git a/binary/linux-gnu/test/gcc-4.4 b/binary/linux-gnu/test/gcc-4.4 new file mode 100644 index 0000000..f941756 --- /dev/null +++ b/binary/linux-gnu/test/gcc-4.4 @@ -0,0 +1,21 @@ +BOOST=$HOME/boost + +sqlite_build_options= +sqlite_use_options= + +mysql_build_options= +mysql_use_options="--with-mysql-host=192.168.0.5" + +mssql_build_options= +mssql_use_options="--with-mssql-server=tcp:windows2008r2,1435" + +with_qt=y +with_boost=y + +CC=gcc-4.4 +CXX=g++-4.4 +CPPFLAGS="-I$BOOST" +CXXFLAGS="-O3 -W -Wall -Wno-unknown-pragmas" +LDFLAGS="-L$BOOST/stage/lib" + +export LD_LIBRARY_PATH=$BOOST/stage/lib:$LD_LIBRARY_PATH diff --git a/binary/linux-gnu/test/gcc-minimal b/binary/linux-gnu/test/gcc-minimal new file mode 100644 index 0000000..1addab9 --- /dev/null +++ b/binary/linux-gnu/test/gcc-minimal @@ -0,0 +1,15 @@ +sqlite_build_options= +sqlite_use_options= + +mysql_build_options= +mysql_use_options="--with-mysql-host=192.168.0.5" + +mssql_build_options= +mssql_use_options="--with-mssql-server=tcp:windows2008r2,1435" + +with_qt=n +with_boost=n + +CC=gcc +CXX=g++ +CXXFLAGS="-O3 -W -Wall -Wno-unknown-pragmas" |