From 93e87e9959d536120bedd47a837603418743cc6d Mon Sep 17 00:00:00 2001 From: Patrick C Lankswert Date: Sat, 27 Dec 2014 22:42:20 -0500 Subject: [PATCH] Added build dependencies script 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 --- auto_build.sh | 4 + extlibs/buildDependencies.sh | 96 +++++++++++++++ .../patches/user-config-arm-linux-androideabi.jam | 137 +++++++++++++++++++++ resource/patches/user-config-x86.jam | 137 +++++++++++++++++++++ 4 files changed, 374 insertions(+) create mode 100755 extlibs/buildDependencies.sh create mode 100644 resource/patches/user-config-arm-linux-androideabi.jam create mode 100644 resource/patches/user-config-x86.jam diff --git a/auto_build.sh b/auto_build.sh index efe7530..12761e6 100755 --- a/auto_build.sh +++ b/auto_build.sh @@ -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 index 0000000..9b919d2 --- /dev/null +++ b/extlibs/buildDependencies.sh @@ -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 index 0000000..bea3cee --- /dev/null +++ b/resource/patches/user-config-arm-linux-androideabi.jam @@ -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++ : + arm-linux-androideabi-ar + arm-linux-androideabi-ranlib + -fexceptions + -frtti + -fpic + -ffunction-sections + -funwind-tables + -D__ARM_ARCH_5__ + -D__ARM_ARCH_5T__ + -D__ARM_ARCH_5E__ + -D__ARM_ARCH_5TE__ + -Wno-psabi + -march=armv5te + -mtune=xscale + -msoft-float + -mthumb + -Os + -fomit-frame-pointer + -fno-strict-aliasing + -finline-limit=64 + -I$(androidNDK)/platforms/$(platform)/arch-arm/usr/include + -Wa,--noexecstack + -DANDROID + -D__ANDROID__ + -DNDEBUG + -O2 + -g + -I$(androidNDK)/sources/cxx-stl/gnu-libstdc++/$(version)/include + -I$(androidNDK)/sources/cxx-stl/gnu-libstdc++/$(version)/libs/armeabi/include + # @Moss - Above are the 'oficial' android flags + arm + -fvisibility=hidden + -fvisibility-inlines-hidden + -fdata-sections + -D__arm__ + -D_REENTRANT + -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 index 0000000..bb0a2e3 --- /dev/null +++ b/resource/patches/user-config-x86.jam @@ -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++ : + i686-linux-android-ar + i686-linux-android-ranlib + -fexceptions + -frtti + -fpic + -ffunction-sections + -funwind-tables +# -D__ARM_ARCH_5__ +# -D__ARM_ARCH_5T__ +# -D__ARM_ARCH_5E__ +# -D__ARM_ARCH_5TE__ + -Wno-psabi +# -march=armv5te +# -mtune=xscale +# -msoft-float +# -mthumb + -Os + -fomit-frame-pointer + -fno-strict-aliasing + -finline-limit=64 + -I$(androidNDK)/platforms/$(platform)/arch-x86/usr/include + -Wa,--noexecstack + -DANDROID + -D__ANDROID__ + -DNDEBUG + -O2 + -g + -I$(androidNDK)/sources/cxx-stl/gnu-libstdc++/$(version)/include + -I$(androidNDK)/sources/cxx-stl/gnu-libstdc++/$(version)/libs/armeabi/include + # @Moss - Above are the 'oficial' android flags + x86 + -fvisibility=hidden + -fvisibility-inlines-hidden + -fdata-sections +# -D__arm__ + -D_REENTRANT + -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 ; -- 2.7.4