Added build dependencies script
authorPatrick C Lankswert <patrick.lankswert@intel.com>
Sun, 28 Dec 2014 03:42:20 +0000 (22:42 -0500)
committerPatrick C Lankswert <patrick.lankswert@intel.com>
Sun, 28 Dec 2014 03:59:22 +0000 (22:59 -0500)
Created build script that prepares two dependencies (cereal and
boost) for use by the build environment. This also adds the
dependency builder in the auto build script used by the continuous
integation servers.

Change-Id: I776a3b3f208b1ea0c253cc693d639c19b603fbca
Signed-off-by: Patrick Lankswert <patrick.lankswert@intel.com>
auto_build.sh
extlibs/buildDependencies.sh [new file with mode: 0755]
resource/patches/user-config-arm-linux-androideabi.jam [new file with mode: 0644]
resource/patches/user-config-x86.jam [new file with mode: 0644]

index efe7530..12761e6 100755 (executable)
@@ -25,6 +25,10 @@ function build()
 
        if [ "$BUILD_FOR_ANDROID" = "true" ]
                then
+               echo "*********** Build Boost for android ***********"
+               pushd extlibs
+               .//buildDependencies.sh
+               popd
 
                echo "*********** Build for android x86 *************"
                scons TARGET_OS=android TARGET_ARCH=x86 ANDROID_NDK=$1 RELEASE=$3
diff --git a/extlibs/buildDependencies.sh b/extlibs/buildDependencies.sh
new file mode 100755 (executable)
index 0000000..9b919d2
--- /dev/null
@@ -0,0 +1,96 @@
+#!/bin/bash
+
+set -e
+
+# Change to extlibs directory
+cd "$(dirname "$0")"
+
+# Check for cereal existence
+if [ ! -d "cereal" ]; then
+    git clone https://github.com/USCiLab/cereal.git cereal
+    pushd cereal
+    git reset --hard 7121e91e6ab8c3e6a6516d9d9c3e6804e6f65245
+    git apply ../../resource/patches/cereal_gcc46.patch
+    popd
+fi
+
+BOOST_MAJOR=1
+BOOST_MINOR=55
+BOOST_REVISION=0
+
+BOOST_VERSION="${BOOST_MAJOR}.${BOOST_MINOR}.${BOOST_REVISION}"
+BOOST_NAME="boost_${BOOST_MAJOR}_${BOOST_MINOR}_${BOOST_REVISION}"
+BOOST_FILE="${BOOST_NAME}.zip"
+
+function downloadBoost {
+    echo "Downloading boost v${BOOST_VERSION}"
+    wget --progress=bar --continue --output-document=${BOOST_FILE} http://downloads.sourceforge.net/project/boost/boost/${BOOST_VERSION}/${BOOST_FILE}?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F${BOOST_VERSION}%2F\&ts=1419450713\&use_mirror=iweb
+}
+
+function unpackBoost {
+    if [ ! -f "${BOOST_FILE}" ]; then
+        downloadBoost
+    fi
+
+    echo "Unpacking boost v${BOOST_VERSION}"
+    unzip ${BOOST_FILE} >> build.log
+    pushd ${BOOST_NAME}
+    ./bootstrap.sh
+    popd
+}
+
+function buildBoost {
+    if [ ! -d "${BOOST_NAME}" ]; then
+        unpackBoost
+    fi
+    
+    TOOLCHAIN=${ANDROID_NDK}/toolchains/${TOOLSET}-${VERSION}/prebuilt/linux-x86/bin
+    echo "Copying user configs to boost"
+    cp ../resource/patches/user-config-${TOOLSET}.jam ${BOOST_NAME}/tools/build/v2/user-config.jam
+
+    OLDPATH=$PATH
+    PATH=$TOOLCHAIN:$PATH
+
+    pushd ${BOOST_NAME}
+    ./b2 clean
+    ./b2 -q \
+        target-os=linux \
+        link=static \
+        threading=multi \
+        --layout=system \
+        --prefix="./../../out/boost" \
+        -s PLATFORM=android-${PLATFORM} \
+        -s VERSION=${VERSION} \
+        --with-thread \
+        --with-program_options \
+        install
+    popd
+
+    PATH=$OLDPATH
+
+    mkdir -p ${INCPATH}
+    cp -R ../out/boost/include/* ${INCPATH}
+    mkdir -p ${LIBPATH}
+    cp -R ../out/boost/lib/*     ${LIBPATH}
+}
+
+function checkBoost {
+    PLATFORM=$1
+    TOOLSET=$2
+    VERSION=$3
+
+    INCPATH="$(dirname "$0")/../out/android/include"
+    LIBPATH="$(dirname "$0")/../out/android/lib/${TOOLSET}"
+
+    if [ ! -d "${INCPATH}" ];
+    then
+        buildBoost
+    fi
+    if [ ! -d "${LIBPATH}" ];
+    then
+        buildBoost
+    fi
+}
+
+checkBoost 19 arm-linux-androideabi 4.9
+checkBoost 19 x86 4.9
diff --git a/resource/patches/user-config-arm-linux-androideabi.jam b/resource/patches/user-config-arm-linux-androideabi.jam
new file mode 100644 (file)
index 0000000..bea3cee
--- /dev/null
@@ -0,0 +1,137 @@
+# Copyright 2003, 2005 Douglas Gregor
+# Copyright 2004 John Maddock
+# Copyright 2002, 2003, 2004, 2007 Vladimir Prus
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+
+#   This file is used to configure your Boost.Build installation. You can modify
+# this file in place, or you can place it in a permanent location so that it
+# does not get overwritten should you get a new version of Boost.Build. See:
+#
+#   http://www.boost.org/boost-build2/doc/html/bbv2/overview/configuration.html
+#
+# for documentation about possible permanent locations.
+
+#   This file specifies which toolsets (C++ compilers), libraries, and other
+# tools are available. Often, you should be able to just uncomment existing
+# example lines and adjust them to taste. The complete list of supported tools,
+# and configuration instructions can be found at:
+#
+#   http://boost.org/boost-build2/doc/html/bbv2/reference/tools.html
+#
+
+#   This file uses Jam language syntax to describe available tools. Mostly,
+# there are 'using' lines, that contain the name of the used tools, and
+# parameters to pass to those tools -- where paremeters are separated by
+# semicolons. Important syntax notes:
+#
+#   - Both ':' and ';' must be separated from other tokens by whitespace
+#   - The '\' symbol is a quote character, so when specifying Windows paths you
+#     should use '/' or '\\' instead.
+#
+# More details about the syntax can be found at:
+#
+#   http://boost.org/boost-build2/doc/html/bbv2/advanced.html#bbv2.advanced.jam_language
+#
+
+# ------------------
+# GCC configuration.
+# ------------------
+
+# Configure gcc (default version).
+# using gcc ;
+
+# Configure specific gcc version, giving alternative name to use.
+# using gcc : 3.2 : g++-3.2 ;
+
+import os ;
+
+local androidNDK = [ os.environ ANDROID_NDK ] ;
+local platform = [ os.environ PLATFORM ] ;
+local version = [ os.environ VERSION ] ;
+
+using gcc : : arm-linux-androideabi-g++ :
+     <archiver>arm-linux-androideabi-ar
+     <ranlib>arm-linux-androideabi-ranlib
+    <compileflags>-fexceptions
+    <compileflags>-frtti
+    <compileflags>-fpic
+    <compileflags>-ffunction-sections
+    <compileflags>-funwind-tables
+    <compileflags>-D__ARM_ARCH_5__
+    <compileflags>-D__ARM_ARCH_5T__
+    <compileflags>-D__ARM_ARCH_5E__
+    <compileflags>-D__ARM_ARCH_5TE__
+    <compileflags>-Wno-psabi
+    <compileflags>-march=armv5te
+    <compileflags>-mtune=xscale
+    <compileflags>-msoft-float
+    <compileflags>-mthumb
+    <compileflags>-Os
+    <compileflags>-fomit-frame-pointer
+    <compileflags>-fno-strict-aliasing
+    <compileflags>-finline-limit=64
+    <compileflags>-I$(androidNDK)/platforms/$(platform)/arch-arm/usr/include
+    <compileflags>-Wa,--noexecstack
+    <compileflags>-DANDROID
+    <compileflags>-D__ANDROID__
+    <compileflags>-DNDEBUG
+    <compileflags>-O2
+    <compileflags>-g
+    <compileflags>-I$(androidNDK)/sources/cxx-stl/gnu-libstdc++/$(version)/include
+    <compileflags>-I$(androidNDK)/sources/cxx-stl/gnu-libstdc++/$(version)/libs/armeabi/include
+    # @Moss - Above are the 'oficial' android flags
+    <architecture>arm
+    <compileflags>-fvisibility=hidden
+    <compileflags>-fvisibility-inlines-hidden
+    <compileflags>-fdata-sections
+    <cxxflags>-D__arm__
+    <cxxflags>-D_REENTRANT
+    <cxxflags>-D_GLIBCXX__PTHREADS
+         ;
+
+# -------------------
+# MSVC configuration.
+# -------------------
+
+# Configure msvc (default version, searched for in standard locations and PATH).
+# using msvc ;
+
+# Configure specific msvc version (searched for in standard locations and PATH).
+# using msvc : 8.0 ;
+
+
+# ----------------------
+# Borland configuration.
+# ----------------------
+# using borland ;
+
+
+# ----------------------
+# STLPort configuration.
+# ----------------------
+
+#   Configure specifying location of STLPort headers. Libraries must be either
+# not needed or available to the compiler by default.
+# using stlport : : /usr/include/stlport ;
+
+# Configure specifying location of both headers and libraries explicitly.
+# using stlport : : /usr/include/stlport /usr/lib ;
+
+
+# -----------------
+# QT configuration.
+# -----------------
+
+# Configure assuming QTDIR gives the installation prefix.
+# using qt ;
+
+# Configure with an explicit installation prefix.
+# using qt : /usr/opt/qt ;
+
+# ---------------------
+# Python configuration.
+# ---------------------
+
+# Configure specific Python version.
+# using python : 3.1 : /usr/bin/python3 : /usr/include/python3.1 : /usr/lib ;
diff --git a/resource/patches/user-config-x86.jam b/resource/patches/user-config-x86.jam
new file mode 100644 (file)
index 0000000..bb0a2e3
--- /dev/null
@@ -0,0 +1,137 @@
+# Copyright 2003, 2005 Douglas Gregor
+# Copyright 2004 John Maddock
+# Copyright 2002, 2003, 2004, 2007 Vladimir Prus
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+
+#   This file is used to configure your Boost.Build installation. You can modify
+# this file in place, or you can place it in a permanent location so that it
+# does not get overwritten should you get a new version of Boost.Build. See:
+#
+#   http://www.boost.org/boost-build2/doc/html/bbv2/overview/configuration.html
+#
+# for documentation about possible permanent locations.
+
+#   This file specifies which toolsets (C++ compilers), libraries, and other
+# tools are available. Often, you should be able to just uncomment existing
+# example lines and adjust them to taste. The complete list of supported tools,
+# and configuration instructions can be found at:
+#
+#   http://boost.org/boost-build2/doc/html/bbv2/reference/tools.html
+#
+
+#   This file uses Jam language syntax to describe available tools. Mostly,
+# there are 'using' lines, that contain the name of the used tools, and
+# parameters to pass to those tools -- where paremeters are separated by
+# semicolons. Important syntax notes:
+#
+#   - Both ':' and ';' must be separated from other tokens by whitespace
+#   - The '\' symbol is a quote character, so when specifying Windows paths you
+#     should use '/' or '\\' instead.
+#
+# More details about the syntax can be found at:
+#
+#   http://boost.org/boost-build2/doc/html/bbv2/advanced.html#bbv2.advanced.jam_language
+#
+
+# ------------------
+# GCC configuration.
+# ------------------
+
+# Configure gcc (default version).
+# using gcc ;
+
+# Configure specific gcc version, giving alternative name to use.
+# using gcc : 3.2 : g++-3.2 ;
+
+import os ;
+
+local androidNDK = [ os.environ ANDROID_NDK ] ;
+local platform = [ os.environ PLATFORM ] ;
+local version = [ os.environ VERSION ] ;
+
+using gcc : : i686-linux-android-g++ :
+     <archiver>i686-linux-android-ar
+     <ranlib>i686-linux-android-ranlib
+    <compileflags>-fexceptions
+    <compileflags>-frtti
+    <compileflags>-fpic
+    <compileflags>-ffunction-sections
+    <compileflags>-funwind-tables
+#    <compileflags>-D__ARM_ARCH_5__
+#    <compileflags>-D__ARM_ARCH_5T__
+#    <compileflags>-D__ARM_ARCH_5E__
+#    <compileflags>-D__ARM_ARCH_5TE__
+    <compileflags>-Wno-psabi
+#    <compileflags>-march=armv5te
+#    <compileflags>-mtune=xscale
+#    <compileflags>-msoft-float
+#    <compileflags>-mthumb
+    <compileflags>-Os
+    <compileflags>-fomit-frame-pointer
+    <compileflags>-fno-strict-aliasing
+    <compileflags>-finline-limit=64
+    <compileflags>-I$(androidNDK)/platforms/$(platform)/arch-x86/usr/include
+    <compileflags>-Wa,--noexecstack
+    <compileflags>-DANDROID
+    <compileflags>-D__ANDROID__
+    <compileflags>-DNDEBUG
+    <compileflags>-O2
+    <compileflags>-g
+    <compileflags>-I$(androidNDK)/sources/cxx-stl/gnu-libstdc++/$(version)/include
+    <compileflags>-I$(androidNDK)/sources/cxx-stl/gnu-libstdc++/$(version)/libs/armeabi/include
+    # @Moss - Above are the 'oficial' android flags
+    <architecture>x86
+    <compileflags>-fvisibility=hidden
+    <compileflags>-fvisibility-inlines-hidden
+    <compileflags>-fdata-sections
+#    <cxxflags>-D__arm__
+    <cxxflags>-D_REENTRANT
+    <cxxflags>-D_GLIBCXX__PTHREADS
+         ;
+
+# -------------------
+# MSVC configuration.
+# -------------------
+
+# Configure msvc (default version, searched for in standard locations and PATH).
+# using msvc ;
+
+# Configure specific msvc version (searched for in standard locations and PATH).
+# using msvc : 8.0 ;
+
+
+# ----------------------
+# Borland configuration.
+# ----------------------
+# using borland ;
+
+
+# ----------------------
+# STLPort configuration.
+# ----------------------
+
+#   Configure specifying location of STLPort headers. Libraries must be either
+# not needed or available to the compiler by default.
+# using stlport : : /usr/include/stlport ;
+
+# Configure specifying location of both headers and libraries explicitly.
+# using stlport : : /usr/include/stlport /usr/lib ;
+
+
+# -----------------
+# QT configuration.
+# -----------------
+
+# Configure assuming QTDIR gives the installation prefix.
+# using qt ;
+
+# Configure with an explicit installation prefix.
+# using qt : /usr/opt/qt ;
+
+# ---------------------
+# Python configuration.
+# ---------------------
+
+# Configure specific Python version.
+# using python : 3.1 : /usr/bin/python3 : /usr/include/python3.1 : /usr/lib ;