Fix crash in ssl retransmission thread
[platform/upstream/iotivity.git] / gbsbuild.sh
index 58c2cdf..c90d7b3 100755 (executable)
@@ -55,21 +55,12 @@ cp -R $sourcedir/iotivity.pc.in $sourcedir/tmp
 
 cd $sourcedir/tmp
 
-rm -rf ./extlibs/tinycbor/tinycbor/.git*
-
-# Initialize Git repositoryㅣ
-if [ ! -d .git ]; then
-   git init ./
-   git config user.email "you@example.com"
-   git config user.name "Your Name"
-   git add ./
-   git commit -m "Initial commit"
-fi
-
 withtcp=0
 withcloud=0
 withproxy=0
 withmq=OFF
+rdmode=CLIENT
+secured=0
 for ARGUMENT_VALUE in $*
 do
    echo $ARGUMENT_VALUE
@@ -88,10 +79,36 @@ do
    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
+
+# Prepare TinyCBOR dependency
+$SHELL ./extlibs/tinycbor/prep.sh
+
+# Initialize Git repositoryㅣ
+if [ ! -d .git ]; then
+   git init ./
+   git config user.email "you@example.com"
+   git config user.name "Your Name"
+   git add ./
+   git commit -m "Initial commit"
+fi
+
 echo "Calling core gbs build command"
-gbscommand="gbs build -A armv7l --define 'WITH_TCP $withtcp' --define 'WITH_CLOUD $withcloud' --define 'WITH_PROXY $withproxy' --define 'WITH_MQ $withmq' -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"