From: Erich Keane Date: Fri, 10 Apr 2015 21:42:24 +0000 (-0700) Subject: Re-enable Cereal download X-Git-Tag: 0.9.1-alpha1~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3a4b28f54f19e69f281f4d01d41c4099bccf1bf;p=contrib%2Fiotivity.git Re-enable Cereal download The build post-CA/Master merge seems to have lost the auto-download functionality that we put in to allow cereal to be captured automatically. This fix re-enables the script, which should fix a few of the other build servers listening in. Change-Id: Icf3d0d0ed0babaef37f2ceace55abc471a73d306 Signed-off-by: Erich Keane Reviewed-on: https://gerrit.iotivity.org/gerrit/693 Tested-by: jenkins-iotivity Reviewed-by: Vijay Kesavan Reviewed-by: Uze Choi Reviewed-by: Jihun Ha --- diff --git a/extlibs/buildDependencies.sh b/extlibs/buildDependencies.sh index 0e85c3e..4ebe318 100755 --- a/extlibs/buildDependencies.sh +++ b/extlibs/buildDependencies.sh @@ -22,58 +22,78 @@ BOOST_MINOR=57 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 -} +# Determine the architecture +HOST_ARCH=$(arch) -function unpackBoost { - if [ ! -f "${BOOST_FILE}" ]; then - downloadBoost - fi +if [ "${HOST_ARCH}" != "x86_64" ]; +then + HOST_ARCH="x86" +fi - echo "Unpacking boost v${BOOST_VERSION}" - unzip ${BOOST_FILE} >> build.log - pushd ${BOOST_NAME} - ./bootstrap.sh - popd +HOST_ARCH="linux-${HOST_ARCH}" + +function cloneBoost { + echo "Removing old boost repo..." + rm -rf boost + echo "Cloning boost from GIT HUB..." + git clone --recursive https://github.com/boostorg/boost.git boost } function buildBoost { - if [ ! -d "${BOOST_NAME}" ]; then - unpackBoost + if [ ! -d "boost" ]; then + cloneBoost 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 + + # Determine the + TOOLCHAIN=${ANDROID_NDK}/toolchains/${TOOLSET}-${VERSION}/prebuilt/${HOST_ARCH}/bin OLDPATH=$PATH PATH=$TOOLCHAIN:$PATH - pushd ${BOOST_NAME} - ./b2 clean + rm -f boost.log + + pushd boost + echo "Checking out boost v${BOOST_VERSION}..." + git checkout --force -B boost-${BOOST_VERSION} tags/boost-${BOOST_VERSION} &>> ../boost.log + git submodule foreach --recursive git checkout --force -B boost-${BOOST_VERSION} tags/boost-${BOOST_VERSION} &>> ../boost.log + echo "Reset and clean all modular repositories..." + git reset --hard HEAD >> ../boost.log + git clean -d --force >> ../boost.log + git clean -d --force -x >> ../boost.log + git submodule foreach --recursive git reset --hard HEAD >> ../boost.log + git submodule foreach --recursive git clean --force -d >> ../boost.log + git submodule foreach --recursive git clean --force -d -x >> ../boost.log + echo "Copying user configs to boost..." + cp ${EXTDIR}/../resource/patches/boost/${TOOLSET}/user-config.jam tools/build/src/user-config.jam + echo "Boostrapping boost..." + ./bootstrap.sh + echo "Building..." ./b2 -q \ target-os=linux \ link=static \ threading=multi \ --layout=system \ - --prefix="./../../out/boost" \ - -s PLATFORM=android-${PLATFORM} \ + --build-type=minimal \ + -s PLATFORM=${PLATFORM} \ -s VERSION=${VERSION} \ + --prefix="${EXTDIR}/../out/boost" \ + --includedir="${INCPATH}" \ + --libdir="${LIBPATH}" \ + --build-dir="$(pwd)/build" \ --with-thread \ - install + --with-program_options \ + headers install popd - PATH=$OLDPATH + if [ ! -d "${INCPATH}" ]; + then + echo "Copying headers to android include directory..." + mkdir -p ${INCPATH} + cp --recursive --dereference boost/boost ${INCPATH} + fi - mkdir -p ${INCPATH} - cp -R ../out/boost/include/* ${INCPATH} - mkdir -p ${LIBPATH} - cp -R ../out/boost/lib/* ${LIBPATH} + PATH=$OLDPATH } function checkBoost { @@ -81,19 +101,14 @@ function checkBoost { TOOLSET=$2 VERSION=$3 - INCPATH="$(dirname "$0")/../out/android/include" - LIBPATH="$(dirname "$0")/../out/android/lib/${TOOLSET}" + INCPATH="${EXTDIR}/../out/android/include" + LIBPATH="${EXTDIR}/../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 - +checkBoost android-19 arm-linux-androideabi 4.9 +checkBoost android-19 x86 4.9 diff --git a/extra_options.scons b/extra_options.scons index d0dfca4..6cd51b7 100644 --- a/extra_options.scons +++ b/extra_options.scons @@ -31,16 +31,4 @@ target_os = env.get('TARGET_OS') target_arch = env.get('TARGET_ARCH') src_dir = env.get('SRC_DIR') -# check 'cereal' library, temporarily put it here -if not os.path.exists(src_dir + '/extlibs/cereal'): - print ''' -*********************************** Error: ************************************** -* 'Cereal' library doesn't exist. please download cereal to extlibs directory * -* add apply the patch as following: * -* $ git clone https://github.com/USCiLab/cereal.git /extlibs/cereal* -* $ cd /extlibs/cereal * -* $ git reset --hard 7121e91e6ab8c3e6a6516d9d9c3e6804e6f65245 * -* $ git apply ../../resource/patches/cereal_gcc46.patch * -********************************************************************************* -''' - Exit(1) +env.SConscript('extlibs/cereal/SConscript')