tizen: Guess TARGET_ARCH from gbs param
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Sat, 27 May 2017 23:29:05 +0000 (01:29 +0200)
committerPhil Coval <philippe.coval@osg.samsung.com>
Wed, 28 Jun 2017 22:10:55 +0000 (22:10 +0000)
I noticed that previously arm binary where built into out/x86
Even if this is not harmful, It's better to rely on gbs's %{_arch}.

Change-Id: I1968c8d3c0705c536a2b055090ea142100f91bc2
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20309
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
(cherry picked from commit 5c26449ec8c725cdc8f4f7a99f6ac9c664400760)
Reviewed-on: https://gerrit.iotivity.org/gerrit/21003
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: George Nash <george.nash@intel.com>
resource/csdk/stack/samples/tizen/build/gbsbuild.sh

index 2889f0d..9b227c3 100755 (executable)
@@ -7,6 +7,8 @@ name=`echo $name|cut -d" " -f 1`
 version=`echo $version|cut -d" " -f 1`
 
 name=oicri
+# target arch is hardcoded
+gbsarch=${gbsarch:=armv7l}
 
 echo $1
 export TARGET_TRANSPORT=$1
@@ -35,9 +37,6 @@ export WITH_PROXY=$8
 echo $9
 export WITH_MQ=$9
 
-echo $10
-export TARGET_ARCH=$10
-
 echo $TARGET_TRANSPORT
 echo $BUILD_SAMPLE
 echo $WITH_MQ
@@ -105,7 +104,7 @@ if [ ! -d .git ]; then
 fi
 
 echo "Calling core gbs build command"
-gbscommand="gbs build -A armv7l -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 'TARGET_ARCH $10'"
+gbscommand="gbs build -A "${gbsarch}" -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 "Core build is successful"
@@ -128,7 +127,7 @@ 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-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 'TARGET_ARCH $10'"
+   gbscommand="gbs build -A "${gbsarch}" -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"