X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fstack%2Fsamples%2Ftizen%2Fbuild%2Fgbsbuild.sh;h=141b8d86c46356c70d8331ccf665cd1f39bcfb95;hb=refs%2Ftags%2Fsubmit%2Ftizen_5.0%2F20190206.231707;hp=2b8410f79198e5603dd87fa175eaa0ee981d7e61;hpb=3f52e71dde4e380927a65b2d8718897b483fd3b7;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/stack/samples/tizen/build/gbsbuild.sh b/resource/csdk/stack/samples/tizen/build/gbsbuild.sh old mode 100644 new mode 100755 index 2b8410f..141b8d8 --- a/resource/csdk/stack/samples/tizen/build/gbsbuild.sh +++ b/resource/csdk/stack/samples/tizen/build/gbsbuild.sh @@ -7,6 +7,7 @@ name=`echo $name|cut -d" " -f 1` version=`echo $version|cut -d" " -f 1` name=oicri +gbsarch=${gbsarch:=armv7l} echo $1 export TARGET_TRANSPORT=$1 @@ -23,9 +24,24 @@ export RELEASE=$4 echo $5 export LOGGING=$5 +echo $6 +export ROUTING=$6 + +echo $7 +export WITH_TCP=$7 + +echo $8 +export WITH_PROXY=$8 + +echo $9 +export WITH_MQ=$9 + +echo $10 +export DISABLE_BLE_SERVER=$10 echo $TARGET_TRANSPORT echo $BUILD_SAMPLE +echo $WITH_MQ rm -rf $name-$version @@ -34,17 +50,28 @@ sourcedir=`pwd` echo `pwd` +rm -rf ./tmp mkdir ./tmp mkdir ./tmp/extlibs/ mkdir ./tmp/packaging -cp -R ./extlibs/tinycbor $sourcedir/tmp/extlibs +cp -LR ./extlibs/tinycbor $sourcedir/tmp/extlibs +cp -Rf ./extlibs/mbedtls $sourcedir/tmp/extlibs cp -R ./extlibs/cjson $sourcedir/tmp/extlibs -cp -R ./extlibs/tinydtls $sourcedir/tmp/extlibs cp -R ./extlibs/timer $sourcedir/tmp/extlibs cp -R ./extlibs/rapidxml $sourcedir/tmp/extlibs +cp -R ./extlibs/libcoap $sourcedir/tmp/extlibs +cp -LR ./extlibs/sqlite3 $sourcedir/tmp/extlibs cp -R ./resource/csdk/stack/samples/tizen/build/packaging/*.spec $sourcedir/tmp/packaging cp -R ./resource $sourcedir/tmp/ cp -R ./build_common/external_libs.scons $sourcedir/tmp/ +mkdir -p $sourcedir/tmp/build_common/ +cp -a ./build_common/*.scons $sourcedir/tmp/build_common/ + +# copy dependency RPMs and conf files for tizen build +cp ./tools/tizen/*.rpm $sourcedir/tmp +cp ./tools/tizen/*.rpm $sourcedir/tmp/resource/csdk/stack/samples/tizen/SimpleClientServer +cp ./tools/tizen/.gbs.conf ./tmp +cp ./tools/tizen/.gbs.conf ./tmp/resource/csdk/stack/samples/tizen/SimpleClientServer cd $sourcedir cd ./resource/csdk/stack/samples/tizen/build/ @@ -59,9 +86,16 @@ cd $sourcedir/build_common/ cp -R ./iotivityconfig/* $sourcedir/tmp/iotivityconfig/ cp -R ./SConscript $sourcedir/tmp/ +cp -R $sourcedir/iotivity.pc.in $sourcedir/tmp/ + cd $sourcedir/tmp echo `pwd` +# Prepare mbedTLS dependency +$SHELL ./extlibs/mbedtls/prep.sh + +# Prepare TinyCBOR dependency +$SHELL ./extlibs/tinycbor/prep.sh whoami # Initialize Git repository @@ -73,16 +107,21 @@ if [ ! -d .git ]; then git commit -m "Initial commit" fi +gbsprofile=${gbsprofile:=profile.tizen} +gbscommand_prefix="gbs build -A ${gbsarch} -P ${gbsprofile} " +nproc=$(expr 1 + $(expr `nproc --ignore=1` / 2 ) ) +gbscommand_prefix=${gbscommand_prefix}" --define '_smp_mflags -j${nproc}'" + echo "Calling core gbs build command" -gbscommand="gbs build -A armv7l -B ~/GBS-ROOT-RI --include-all --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'RELEASE $4' --define 'LOGGING $5' --repository ./" +gbscommand=${gbscommand_prefix}" -B ~/GBS-ROOT-RI-OIC --include-all --repository ./ --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'RELEASE $4' --define 'LOGGING $5' --define 'ROUTING $6' --define 'WITH_TCP $7' --define 'WITH_PROXY $8' --define 'WITH_MQ $9' --define 'DISABLE_BLE_SERVER $10'" echo $gbscommand if eval $gbscommand; then echo "Core build is successful" else - echo "Core build failed. Try 'sudo find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder" + echo "Core build failed. Try 'find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder" cd $sourcedir rm -rf $sourcedir/tmp - exit + exit 1 fi if echo $BUILD_SAMPLE|grep -qi '^ON$'; then @@ -97,18 +136,19 @@ if echo $BUILD_SAMPLE|grep -qi '^ON$'; then git commit -m "Initial commit" fi echo "Calling sample gbs build command" - gbscommand="gbs build -A armv7l -B ~/GBS-ROOT-RI --include-all --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'RELEASE $4' --define 'LOGGING $5' --repository ./" + gbscommand=${gbscommand_prefix}" -B ~/GBS-ROOT-RI-OIC --include-all --repository ./ --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'RELEASE $4' --define 'LOGGING $5' --define 'ROUTING $6' --define 'WITH_TCP $7' --define 'WITH_PROXY $8' --define 'WITH_MQ $9'" echo $gbscommand if eval $gbscommand; then echo "Sample build is successful" else - echo "Sample build is failed. Try 'sudo find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder" + echo "Sample build is failed. Try 'find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder" + exit 1 fi else echo "Sample build is not enabled" fi - cd $sourcedir rm -rf $sourcedir/tmp +exit 0