Re-enable Cereal download
authorErich Keane <erich.keane@intel.com>
Fri, 10 Apr 2015 21:42:24 +0000 (14:42 -0700)
committerUze Choi <uzchoi@samsung.com>
Mon, 13 Apr 2015 05:07:07 +0000 (05:07 +0000)
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 <erich.keane@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/693
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Vijay Kesavan <vijay.s.kesavan@intel.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Reviewed-by: Jihun Ha <jihun.ha@samsung.com>
extlibs/buildDependencies.sh
extra_options.scons

index 0e85c3e..4ebe318 100755 (executable)
@@ -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
index d0dfca4..6cd51b7 100644 (file)
@@ -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 <src_dir>/extlibs/cereal*
-*     $ cd <src_dir>/extlibs/cereal                                             *
-*     $ git reset --hard 7121e91e6ab8c3e6a6516d9d9c3e6804e6f65245               *
-*     $ git apply ../../resource/patches/cereal_gcc46.patch                     *
-*********************************************************************************
-'''
-       Exit(1)
+env.SConscript('extlibs/cereal/SConscript')