From f2ac9f727348d48062fe7a8ab2ba08563ccb0071 Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Date: Mon, 26 Sep 2016 15:26:54 +0530 Subject: [PATCH] Enable Tizen build for proxy Change-Id: Id5a8091ae5d1544581bb9991e18d20dd5b67e292 Signed-off-by: Abhishek Sharma Reviewed-on: https://gerrit.iotivity.org/gerrit/12207 Reviewed-by: Phil Coval Tested-by: jenkins-iotivity Reviewed-by: Ashok Babu Channa --- gbsbuild.sh | 10 +++++++--- service/SConscript | 2 +- service/coap-http-proxy/SConscript | 4 ++-- service/coap-http-proxy/samples/proxy_client.c | 8 ++++---- tools/tizen/iotivity.spec | 9 +++++++++ 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/gbsbuild.sh b/gbsbuild.sh index db6dd8a..487733b 100755 --- a/gbsbuild.sh +++ b/gbsbuild.sh @@ -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" diff --git a/service/SConscript b/service/SConscript index 22eb6db..18af8c3 100755 --- a/service/SConscript +++ b/service/SConscript @@ -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 diff --git a/service/coap-http-proxy/SConscript b/service/coap-http-proxy/SConscript index 1643e0d..4d9c5e6 100644 --- a/service/coap-http-proxy/SConscript +++ b/service/coap-http-proxy/SConscript @@ -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') diff --git a/service/coap-http-proxy/samples/proxy_client.c b/service/coap-http-proxy/samples/proxy_client.c index 95b4ae8..c2b7a2d 100644 --- a/service/coap-http-proxy/samples/proxy_client.c +++ b/service/coap-http-proxy/samples/proxy_client.c @@ -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) { diff --git a/tools/tizen/iotivity.spec b/tools/tizen/iotivity.spec index f375b05..5064ecb 100644 --- a/tools/tizen/iotivity.spec +++ b/tools/tizen/iotivity.spec @@ -156,6 +156,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 @@ -219,6 +225,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 -- 2.7.4