Enable Tizen build for proxy
authorAbhishek Sharma <ce.abhishek@samsung.com>
Mon, 26 Sep 2016 09:56:54 +0000 (15:26 +0530)
committerAshok Babu Channa <ashok.channa@samsung.com>
Tue, 27 Sep 2016 05:10:39 +0000 (05:10 +0000)
Change-Id: Id5a8091ae5d1544581bb9991e18d20dd5b67e292
Signed-off-by: Abhishek Sharma <ce.abhishek@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12207
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
(cherry picked from commit f2ac9f727348d48062fe7a8ab2ba08563ccb0071)
Reviewed-on: https://gerrit.iotivity.org/gerrit/12215

gbsbuild.sh
service/SConscript
service/coap-http-proxy/SConscript
service/coap-http-proxy/samples/proxy_client.c
tools/tizen/iotivity.spec

index db6dd8a..487733b 100755 (executable)
@@ -68,15 +68,19 @@ fi
 
 withtcp=0
 withcloud=0
-if [ "WITH_TCP" = "$1" ] || [ "WITH_TCP" = "$2" ];then
+withproxy=0
+if [ "WITH_TCP" = "$1" ] || [ "WITH_TCP" = "$2" ]  || [ "WITH_TCP" = "$3" ];then
     withtcp=1
 fi
-if [ "WITH_CLOUD" = "$1" ] || [ "WITH_CLOUD" = "$2" ];then
+if [ "WITH_CLOUD" = "$1" ] || [ "WITH_CLOUD" = "$2" ] || [ "WITH_CLOUD" = "$3" ];then
     withcloud=1
 fi
+if [ "WITH_PROXY" = "$1" ] || [ "WITH_PROXY" = "$2" ] || [ "WITH_PROXY" = "$3" ];then
+    withproxy=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' -B ~/GBS-ROOT-OIC --include-all --repository ./"
 echo $gbscommand
 if eval $gbscommand; then
     echo "Build is successful"
index 22eb6db..18af8c3 100755 (executable)
@@ -56,7 +56,7 @@ if target_os not in ['arduino','darwin', 'ios', 'windows']:
         #SConscript('resource-directory/SConscript')
 
     # Build coap-http-proxy project
-    if target_os in ['linux'] and env.get('WITH_PROXY', False):
+    if target_os in ['linux', 'tizen'] and env.get('WITH_PROXY', False):
         SConscript('coap-http-proxy/SConscript')
 
 # Build EasySetup module
index 1643e0d..4d9c5e6 100644 (file)
@@ -50,7 +50,7 @@ local_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_ab
 if target_os not in ['windows']:
     local_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-Wextra'])
 
-if target_os in ['linux']:
+if target_os in ['linux', 'tizen']:
     local_env.AppendUnique(LIBS = ['pthread', 'curl'])
 
 if target_os == 'android':
@@ -82,5 +82,5 @@ local_env.UserInstallTargetHeader('include/CoapHttpHandler.h', 'service/coap-htt
 ######################################################################
 # Samples for the proxy
 ######################################################################
-if target_os in ['linux']:
+if target_os in ['linux', 'tizen']:
     SConscript('samples/SConscript')
index 95b4ae8..c2b7a2d 100644 (file)
@@ -103,7 +103,7 @@ OCStackApplicationResult putReqCB(void* ctx, OCDoHandle handle,
     {
         OIC_LOG_V(INFO, TAG, "StackResult: %u", clientResponse->result);
         OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
-        OIC_LOG(INFO, TAG, ("=============> Put Response"));
+        OIC_LOG(INFO, TAG, "=============> Put Response");
     }
     else
     {
@@ -121,7 +121,7 @@ OCStackApplicationResult postReqCB(void* ctx, OCDoHandle handle,
     {
         OIC_LOG_V(INFO, TAG, "StackResult: %u", clientResponse->result);
         OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
-        OIC_LOG(INFO, TAG, ("=============> Post Response"));
+        OIC_LOG(INFO, TAG, "=============> Post Response");
     }
     else
     {
@@ -140,7 +140,7 @@ OCStackApplicationResult deleteReqCB(void* ctx,
     {
         OIC_LOG_V(INFO, TAG, "StackResult: %d",  clientResponse->result);
         OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
-        OIC_LOG(INFO, TAG, ("=============> Delete Response"));
+        OIC_LOG(INFO, TAG, "=============> Delete Response");
     }
     else
     {
@@ -163,7 +163,7 @@ OCStackApplicationResult getReqCB(void* ctx, OCDoHandle handle,
     OIC_LOG_V(INFO, TAG, "StackResult: %d", clientResponse->result);
     OIC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
     OIC_LOG_PAYLOAD(INFO, clientResponse->payload);
-    OIC_LOG(INFO, TAG, ("=============> Get Response"));
+    OIC_LOG(INFO, TAG, "=============> Get Response");
 
     if (clientResponse->numRcvdVendorSpecificHeaderOptions > 0)
     {
index cbe4ca5..29e9409 100644 (file)
@@ -165,6 +165,12 @@ cp out/tizen/*/%{build_mode}/resource/examples/threadingsample %{ex_install_dir}
 cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_server.dat %{ex_install_dir}
 cp out/tizen/*/%{build_mode}/resource/examples/oic_svr_db_client.dat %{ex_install_dir}
 cp out/tizen/*/%{build_mode}/libcoap.a %{buildroot}%{_libdir}
+
+%if 0%{?WITH_PROXY} == 1
+mkdir -p %{ex_install_dir}/proxy-sample
+cp out/tizen/*/%{build_mode}/service/coap-http-proxy/samples/proxy_main %{ex_install_dir}/proxy-sample/
+cp out/tizen/*/%{build_mode}/service/coap-http-proxy/samples/proxy_client %{ex_install_dir}/proxy-sample/
+%endif
 %if 0%{?SECURED} == 1
 mkdir -p %{ex_install_dir}/provisioning
 mkdir -p %{ex_install_dir}/provision-sample
@@ -228,6 +234,9 @@ cp service/easy-setup/enrollee/inc/*.h %{buildroot}%{_includedir}
 %{_libdir}/librcs_container.so
 %{_libdir}/librcs_server.so
 %{_libdir}/libESEnrolleeSDK.so
+%if 0%{?WITH_PROXY} == 1
+%{_libdir}/libcoap_http_proxy.so
+%endif
 %if 0%{?SECURED} == 1
 %{_libdir}/libocpmapi.so
 %{_libdir}/libocprovision.so