Fix Android SetPropertyValue function call
[platform/upstream/iotivity.git] / gbsbuild.sh
index 72ef981..c90d7b3 100755 (executable)
@@ -55,26 +55,50 @@ cp -R $sourcedir/iotivity.pc.in $sourcedir/tmp
 
 cd $sourcedir/tmp
 
-echo `pwd`
-if [ -d ./extlibs/mbedtls/mbedtls ];then
-    cd ./extlibs/mbedtls/mbedtls
-    git reset --hard ad249f509fd62a3bbea7ccd1fef605dbd482a7bd ; git apply ../ocf.patch
-    cd -
-    rm -rf ./extlibs/mbedtls/mbedtls/.git*
-
-else
-    echo ""
-    echo "*********************************** Error: ****************************************"
-    echo "* Please download mbedtls using the following command:                            *"
-    echo "*     $ git clone https://github.com/ARMmbed/mbedtls.git extlibs/mbedtls/mbedtls  *"
-    echo "***********************************************************************************"
-    echo ""
-    exit
+withtcp=0
+withcloud=0
+withproxy=0
+withmq=OFF
+rdmode=CLIENT
+secured=0
+for ARGUMENT_VALUE in $*
+do
+   echo $ARGUMENT_VALUE
+   if [ "WITH_TCP" = $ARGUMENT_VALUE ];then
+       withtcp=1
+   fi
+
+   if [ "WITH_CLOUD" = $ARGUMENT_VALUE ];then
+       withcloud=1
+   fi
+
+   if [ "WITH_PROXY" = $ARGUMENT_VALUE ];then
+       withproxy=1
+   fi
+
+   if [ "WITH_MQ" = $ARGUMENT_VALUE ];then
+       withmq=PUB,SUB,BROKER
+   fi
+
+   if [ "RD_MODE" = $ARGUMENT_VALUE ];then
+       rdmode=CLIENT,SERVER
+   fi
+
+   if [ "SECURED" = $ARGUMENT_VALUE ];then
+       secured=1
+   fi
+done
+
+if [ $secured -eq 1 ];then
+  echo `pwd`
+  # Prepare mbedTLS dependency
+  $SHELL ./extlibs/mbedtls/prep.sh
 fi
-rm -rf ./extlibs/tinycbor/tinycbor/.git*
 
+# Prepare TinyCBOR dependency
+$SHELL ./extlibs/tinycbor/prep.sh
 
-# Initialize Git repository
+# Initialize Git repository
 if [ ! -d .git ]; then
    git init ./
    git config user.email "you@example.com"
@@ -83,17 +107,8 @@ if [ ! -d .git ]; then
    git commit -m "Initial commit"
 fi
 
-withtcp=0
-withcloud=0
-if [ "WITH_TCP" = "$1" ] || [ "WITH_TCP" = "$2" ];then
-    withtcp=1
-fi
-if [ "WITH_CLOUD" = "$1" ] || [ "WITH_CLOUD" = "$2" ];then
-    withcloud=1
-fi
-
 echo "Calling core gbs build command"
-gbscommand="gbs build -A armv7l --define 'WITH_TCP $withtcp' --define 'WITH_CLOUD $withcloud' -B ~/GBS-ROOT-OIC --include-all --repository ./"
+gbscommand="gbs build -A armv7l --define 'WITH_TCP $withtcp' --define 'WITH_CLOUD $withcloud' --define 'WITH_PROXY $withproxy' --define 'WITH_MQ $withmq' --define 'RD_MODE $rdmode' --define 'SECURED $secured' -B ~/GBS-ROOT-OIC --include-all --repository ./"
 echo $gbscommand
 if eval $gbscommand; then
     echo "Build is successful"