3 # Ideally we will capture the exit code of each step and try them all before failing
4 # the build script. For now, use set -e and fail the build at first failure.
9 echo "*********** Clean build *************"
16 if [ $(uname -s) = "Linux" ]
18 echo "*********** Build for linux *************"
22 # Note: for android, as oic-resource uses C++11 feature stoi and to_string,
23 # it requires gcc-4.9, currently only android-ndk-r10(for linux)
24 # and windows android-ndk-r10(64bit target version) support these features.
25 if [ "$BUILD_FOR_ANDROID" = "true" ]
28 echo "*********** Build Boost for android ***********"
30 ./buildDependencies.sh
33 echo "*********** Build for android x86 *************"
34 scons TARGET_OS=android TARGET_ARCH=x86 ANDROID_NDK=$1 RELEASE=$3
36 echo "*********** Build for android armeabi *************"
37 scons TARGET_OS=android TARGET_ARCH=armeabi ANDROID_NDK=$1 RELEASE=$3
39 echo "*********** Build for android armeabi-v7a *************"
40 scons TARGET_OS=android TARGET_ARCH=armeabi-v7a ANDROID_NDK=$1 RELEASE=$3
42 echo "*********** Build for android armeabi-v7a-hard *************"
43 scons TARGET_OS=android TARGET_ARCH=armeabi-v7a-hard ANDROID_NDK=$1 RELEASE=$3
46 echo "*********** Build for arduino avr *************"
47 scons TARGET_OS=arduino TARGET_ARCH=avr ARDUINO_HOME=$2 RELEASE=$3
49 echo "*********** Build for arduino arm *************"
50 scons TARGET_OS=arduino TARGET_ARCH=arm ARDUINO_HOME=$2 RELEASE=$3
52 if [ $(uname -s) = "Darwin" ]
54 echo "*********** Build for OSX *************"
55 scons TARGET_OS=darwin SYS_VERSION=10.9 RELEASE=$3
57 echo "*********** Build for IOS i386 *************"
58 scons TARGET_OS=ios TARGET_ARCH=i386 SYS_VERSION=7.0 RELEASE=$3
60 echo "*********** Build for IOS x86_64 *************"
61 scons TARGET_OS=ios TARGET_ARCH=x86_64 SYS_VERSION=7.0 RELEASE=$3
63 echo "*********** Build for IOS armv7 *************"
64 scons TARGET_OS=ios TARGET_ARCH=armv7 SYS_VERSION=7.0 RELEASE=$3
66 echo "*********** Build for IOS armv7s *************"
67 scons TARGET_OS=ios TARGET_ARCH=armv7s SYS_VERSION=7.0 RELEASE=$3
69 echo "*********** Build for IOS arm64 *************"
70 scons TARGET_OS=ios TARGET_ARCH=arm64 SYS_VERSION=7.0 RELEASE=$3
78 echo " `basename $0` <path-to-android-ndk> <path-to-arduino-home>"
80 echo " `basename $0` -c"
99 # Suppress "Reading ..." message and enable parallel build
100 export SCONSFLAGS="-Q -j 4"
103 echo "===================== done ====================="