From 8c6fd1e0ffdaa99413dab0b273cf61a86582d3d9 Mon Sep 17 00:00:00 2001 From: Ziran Sun Date: Tue, 18 Apr 2017 13:55:22 +0100 Subject: [PATCH] Linking against version of libcoap in favor of the version in extlibs. Bug: https://jira.iotivity.org/browse/IOT-2055 Change-Id: I3ca9b87ab33aeeb18607c582f2bdccfaa18b3d2f Signed-off-by: Ziran Sun Reviewed-on: https://gerrit.iotivity.org/gerrit/19063 Tested-by: jenkins-iotivity Reviewed-by: Phil Coval Reviewed-by: Dave Thaler Reviewed-by: Dan Mihai --- cloud/samples/client/SConscript | 14 +++++++++----- java/jni/SConscript | 11 +++++++++-- plugins/src/SConscript | 2 -- resource/IPCA/src/SConscript | 7 ++++++- resource/csdk/connectivity/src/SConscript | 2 -- resource/csdk/connectivity/test/SConscript | 2 -- resource/csdk/resource-directory/unittests/SConscript | 9 ++++++++- resource/csdk/security/SConscript | 2 -- resource/csdk/security/provisioning/unittest/SConscript | 2 -- resource/csdk/security/tool/SConscript | 2 -- resource/csdk/security/unittest/SConscript | 2 -- resource/csdk/stack/SConscript | 2 -- resource/csdk/stack/samples/tizen/build/SConscript | 2 -- resource/provisioning/SConscript | 2 -- resource/src/SConscript | 2 -- service/coap-http-proxy/SConscript | 2 -- service/easy-setup/mediator/richsdk/SConscript | 2 -- 17 files changed, 32 insertions(+), 35 deletions(-) diff --git a/cloud/samples/client/SConscript b/cloud/samples/client/SConscript index ca9814f..087dfb6 100644 --- a/cloud/samples/client/SConscript +++ b/cloud/samples/client/SConscript @@ -31,10 +31,13 @@ cc_sample_app_env = lib_env.Clone() ###################################################################### # Build flags ###################################################################### -# For bring up purposes only, the forked version will live here. -cc_sample_app_env.AppendUnique(CPPPATH = ['#/resource/csdk/connectivity/lib/libcoap-4.1.1/include', - '#/extlibs/mbedtls/mbedtls/include']) - +with_upstream_libcoap = cc_sample_app_env.get('WITH_UPSTREAM_LIBCOAP') +if with_upstream_libcoap == '1': + cc_sample_app_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) +else: + cc_sample_app_env.AppendUnique(CPPPATH = [ + '#resource/csdk/connectivity/lib/libcoap-4.1.1/include' + ]) cc_sample_app_env.AppendUnique(CPPPATH = [ '#/resource/include/', @@ -49,7 +52,8 @@ cc_sample_app_env.AppendUnique(CPPPATH = [ '#/resource/csdk/connectivity/common/inc', '#/resource/csdk/security/include', '#/resource/csdk/security/provisioning/include', - '#/resource/csdk/security/provisioning/include/internal' + '#/resource/csdk/security/provisioning/include/internal', + '#/extlibs/mbedtls/mbedtls/include' ]) cc_sample_app_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-Wextra', '-std=c++0x', '-pthread']) diff --git a/java/jni/SConscript b/java/jni/SConscript index 57fca27..5edd0bb 100644 --- a/java/jni/SConscript +++ b/java/jni/SConscript @@ -31,6 +31,14 @@ jni_env = lib_env.Clone() ###################################################################### # Build flags ###################################################################### +with_upstream_libcoap = jni_env.get('WITH_UPSTREAM_LIBCOAP') +if with_upstream_libcoap == '1': + jni_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) +else: + jni_env.AppendUnique(CPPPATH = [ + env.get('SRC_DIR') + '/resource/csdk/connectivity/lib/libcoap-4.1.1/include' + ]) + jni_env.AppendUnique(CPPPATH = [ env.get('SRC_DIR') + '/resource/csdk/connectivity/api', env.get('SRC_DIR') + '/resource/include', @@ -49,8 +57,7 @@ jni_env.AppendUnique(CPPPATH = [ env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include/cloud/', env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include/oxm', env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include/internal', - env.get('SRC_DIR') + '/resource/csdk/security/include', - env.get('SRC_DIR') + '/resource/csdk/connectivity/lib/libcoap-4.1.1/include' + env.get('SRC_DIR') + '/resource/csdk/security/include' ]) target_os = env.get('TARGET_OS') diff --git a/plugins/src/SConscript b/plugins/src/SConscript index d3715f1..b9945c2 100644 --- a/plugins/src/SConscript +++ b/plugins/src/SConscript @@ -36,10 +36,8 @@ print"Reading PI script" ###################################################################### with_unforked_libcoap = env.get('WITH_UNFORKED_LIBCOAP') if with_unforked_libcoap == '1': - # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded. env.PrependUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) else: - # For bring up purposes only, the forked version will live here. env.PrependUnique(CPPPATH = [os.path.join(src_dir, 'resource', 'csdk', 'connectivity', 'lib', 'libcoap-4.1.1', 'include')]) env.PrependUnique(CPPPATH = [ os.path.join(src_dir, 'resource', 'c_common', 'oic_malloc', 'include'), diff --git a/resource/IPCA/src/SConscript b/resource/IPCA/src/SConscript index 0684efc..82c7538 100644 --- a/resource/IPCA/src/SConscript +++ b/resource/IPCA/src/SConscript @@ -29,6 +29,12 @@ rd_mode = ipca_lib_env.get('RD_MODE') ###################################################################### # Build flags ###################################################################### +with_upstream_libcoap = ipca_lib_env.get('WITH_UPSTREAM_LIBCOAP') +if with_upstream_libcoap == '1': + ipca_lib_env.PrependUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) +else: + ipca_lib_env.PrependUnique(CPPPATH = ['#resource/csdk/connectivity/lib/libcoap-4.1.1/include']) + ipca_lib_env.PrependUnique(CPPPATH = [ '../inc', 'inc', @@ -41,7 +47,6 @@ ipca_lib_env.PrependUnique(CPPPATH = [ '#/resource/csdk/security/provisioning/include/internal', '#/resource/csdk/connectivity/api', '#/resource/csdk/connectivity/external/inc', - '#/resource/csdk/connectivity/lib/libcoap-4.1.1/include', '#/resource/csdk/ocsocket/include', '#/resource/csdk/logger/include', '#/resource/c_common/ocrandom/include', diff --git a/resource/csdk/connectivity/src/SConscript b/resource/csdk/connectivity/src/SConscript index e929495..7ca90db 100644 --- a/resource/csdk/connectivity/src/SConscript +++ b/resource/csdk/connectivity/src/SConscript @@ -26,10 +26,8 @@ connectivity_env.PrependUnique(CPPPATH = [ os.path.join(root_dir, 'api') ]) with_upstream_libcoap = connectivity_env.get('WITH_UPSTREAM_LIBCOAP') if with_upstream_libcoap == '1': - # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded. connectivity_env.AppendUnique(CPPPATH = [os.path.join('#extlibs', 'libcoap', 'libcoap', 'include')]) else: - # For bring up purposes only, the forked version will live here. connectivity_env.AppendUnique(CPPPATH = [ os.path.join('#resource', 'csdk', 'connectivity', 'lib', 'libcoap-4.1.1', 'include')]) connectivity_env.AppendUnique(CPPPATH = [ os.path.join(root_dir, 'inc'), diff --git a/resource/csdk/connectivity/test/SConscript b/resource/csdk/connectivity/test/SConscript index e687d68..d81bca6 100644 --- a/resource/csdk/connectivity/test/SConscript +++ b/resource/csdk/connectivity/test/SConscript @@ -34,10 +34,8 @@ rd_mode = catest_env.get('RD_MODE') # Build flags ###################################################################### if catest_env.get('WITH_UPSTREAM_LIBCOAP') == '1': - # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded. catest_env.AppendUnique(CPPPATH = [os.path.join('#', 'extlibs', 'libcoap', 'libcoap', 'include')]) else: - # For bring up purposes only, the forked version will live here. catest_env.AppendUnique(CPPPATH = [ os.path.join('#', 'resource', 'csdk', 'connectivity', 'lib', 'libcoap-4.1.1', 'include')]) catest_env.PrependUnique(CPPPATH = [ diff --git a/resource/csdk/resource-directory/unittests/SConscript b/resource/csdk/resource-directory/unittests/SConscript index 984919f..9fe6c55 100644 --- a/resource/csdk/resource-directory/unittests/SConscript +++ b/resource/csdk/resource-directory/unittests/SConscript @@ -53,13 +53,20 @@ src_dir = lib_env.get('SRC_DIR') ###################################################################### # Build flags ###################################################################### +with_upstream_libcoap = rd_test_env.get('WITH_UPSTREAM_LIBCOAP') +if with_upstream_libcoap == '1': + rd_test_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) +else: + rd_test_env.AppendUnique(CPPPATH = [ + src_dir + '/resource/csdk/connectivity/lib/libcoap-4.1.1/include' + ]) + rd_test_env.AppendUnique( CPPPATH = [ src_dir + '/extlibs/hippomocks/hippomocks', '../include', src_dir + '/resource/include', src_dir + '/resource/csdk/connectivity/api', - src_dir + '/resource/csdk/connectivity/lib/libcoap-4.1.1/include', src_dir + '/resource/csdk/include', src_dir + '/resource/csdk/stack/include', src_dir + '/resource/csdk/security/include', diff --git a/resource/csdk/security/SConscript b/resource/csdk/security/SConscript index 346ea1e..081d878 100644 --- a/resource/csdk/security/SConscript +++ b/resource/csdk/security/SConscript @@ -33,10 +33,8 @@ target_os = libocsrm_env.get('TARGET_OS') ###################################################################### with_upstream_libcoap = libocsrm_env.get('WITH_UPSTREAM_LIBCOAP') if with_upstream_libcoap == '1': - # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded. libocsrm_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) else: - # For bring up purposes only, the forked version will live here. libocsrm_env.AppendUnique(CPPPATH = ['#/resource/csdk/connectivity/lib/libcoap-4.1.1/include']) libocsrm_env.PrependUnique(CPPPATH = [ diff --git a/resource/csdk/security/provisioning/unittest/SConscript b/resource/csdk/security/provisioning/unittest/SConscript index 427ce07..b2a2647 100644 --- a/resource/csdk/security/provisioning/unittest/SConscript +++ b/resource/csdk/security/provisioning/unittest/SConscript @@ -35,10 +35,8 @@ rd_mode = sptest_env.get('RD_MODE') ###################################################################### with_upstream_libcoap = sptest_env.get('WITH_UPSTREAM_LIBCOAP') if with_upstream_libcoap == '1': - # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded. sptest_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) else: - # For bring up purposes only, the forked version will live here. sptest_env.AppendUnique(CPPPATH = ['../../../connectivity/lib/libcoap-4.1.1/include']) sptest_env.PrependUnique(CPPPATH = [ diff --git a/resource/csdk/security/tool/SConscript b/resource/csdk/security/tool/SConscript index 4161b72..0c66a7f 100644 --- a/resource/csdk/security/tool/SConscript +++ b/resource/csdk/security/tool/SConscript @@ -30,10 +30,8 @@ target_os = tools_env.get('TARGET_OS') ###################################################################### with_upstream_libcoap = tools_env.get('WITH_UPSTREAM_LIBCOAP') if with_upstream_libcoap == '1': - # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded. tools_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) else: - # For bring up purposes only, the forked version will live here. tools_env.AppendUnique(CPPPATH = ['../../connectivity/lib/libcoap-4.1.1/include']) tools_env.PrependUnique(CPPPATH = ['#/extlibs/cjson', diff --git a/resource/csdk/security/unittest/SConscript b/resource/csdk/security/unittest/SConscript index 3d92905..b5705b0 100644 --- a/resource/csdk/security/unittest/SConscript +++ b/resource/csdk/security/unittest/SConscript @@ -35,10 +35,8 @@ rd_mode = srmtest_env.get('RD_MODE') ###################################################################### with_upstream_libcoap = srmtest_env.get('WITH_UPSTREAM_LIBCOAP') if with_upstream_libcoap == '1': - # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded. srmtest_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) else: - # For bring up purposes only, the forked version will live here. srmtest_env.AppendUnique(CPPPATH = ['../../connectivity/lib/libcoap-4.1.1/include']) srmtest_env.PrependUnique(CPPPATH = [ diff --git a/resource/csdk/stack/SConscript b/resource/csdk/stack/SConscript index d46e42f..33f9a8a 100644 --- a/resource/csdk/stack/SConscript +++ b/resource/csdk/stack/SConscript @@ -49,10 +49,8 @@ if target_os == 'arduino': ###################################################################### with_upstream_libcoap = liboctbstack_env.get('WITH_UPSTREAM_LIBCOAP') if with_upstream_libcoap == '1': - # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded. liboctbstack_env.PrependUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) else: - # For bring up purposes only, the forked version will live here. liboctbstack_env.PrependUnique(CPPPATH = ['#resource/csdk/connectivity/lib/libcoap-4.1.1/include']) liboctbstack_env.PrependUnique(CPPPATH = [ diff --git a/resource/csdk/stack/samples/tizen/build/SConscript b/resource/csdk/stack/samples/tizen/build/SConscript index 7670d7a..68fdd31 100644 --- a/resource/csdk/stack/samples/tizen/build/SConscript +++ b/resource/csdk/stack/samples/tizen/build/SConscript @@ -20,10 +20,8 @@ with_mq = env.get('WITH_MQ') with_upstream_libcoap = env.get('WITH_UPSTREAM_LIBCOAP') if with_upstream_libcoap == '1': - # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded. env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) else: - # For bring up purposes only, the forked version will live here. env.AppendUnique(CPPPATH = ['../../../../connectivity/lib/libcoap-4.1.1']) env.PrependUnique(CPPPATH = [ diff --git a/resource/provisioning/SConscript b/resource/provisioning/SConscript index 26f82f1..fd730e4 100644 --- a/resource/provisioning/SConscript +++ b/resource/provisioning/SConscript @@ -30,10 +30,8 @@ ocprovision_env = lib_env.Clone() ###################################################################### with_upstream_libcoap = ocprovision_env.get('WITH_UPSTREAM_LIBCOAP') if with_upstream_libcoap == '1': - # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded. ocprovision_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) else: - # For bring up purposes only, the forked version will live here. ocprovision_env.AppendUnique(CPPPATH = ['../csdk/connectivity/lib/libcoap-4.1.1/include']) ocprovision_env.AppendUnique(CPPPATH = [ diff --git a/resource/src/SConscript b/resource/src/SConscript index 27c8d27..290496b 100644 --- a/resource/src/SConscript +++ b/resource/src/SConscript @@ -41,10 +41,8 @@ with_mq = oclib_env.get('WITH_MQ') ###################################################################### with_upstream_libcoap = oclib_env.get('WITH_UPSTREAM_LIBCOAP') if with_upstream_libcoap == '1': - # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded. oclib_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) else: - # For bring up purposes only, the forked version will live here. oclib_env.AppendUnique(CPPPATH = ['../csdk/connectivity/lib/libcoap-4.1.1/include']) oclib_env.AppendUnique(CPPPATH = [ diff --git a/service/coap-http-proxy/SConscript b/service/coap-http-proxy/SConscript index 687e2e9..80973bf 100644 --- a/service/coap-http-proxy/SConscript +++ b/service/coap-http-proxy/SConscript @@ -50,8 +50,6 @@ local_env.AppendUnique(CPPPATH = ['include', with_upstream_libcoap = local_env.get('WITH_UPSTREAM_LIBCOAP') if with_upstream_libcoap == '1': - # For bring up purposes only, - # we manually copy the forked version to where the unforked version is downloaded. local_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) else: local_env.AppendUnique(CPPPATH = ['#resource/csdk/connectivity/lib/libcoap-4.1.1/include']) diff --git a/service/easy-setup/mediator/richsdk/SConscript b/service/easy-setup/mediator/richsdk/SConscript index 7977b21..5f66bf3 100755 --- a/service/easy-setup/mediator/richsdk/SConscript +++ b/service/easy-setup/mediator/richsdk/SConscript @@ -109,10 +109,8 @@ if target_os in ['android','ios','linux','tizen']: if env.get('SECURED') == '1': with_upstream_libcoap = easy_setup_env.get('WITH_UPSTREAM_LIBCOAP') if with_upstream_libcoap == '1': - # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded. easy_setup_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) else: - # For bring up purposes only, the forked version will live here. easy_setup_env.AppendUnique(CPPPATH = [env.get('SRC_DIR') + '/resource/csdk/connectivity/lib/libcoap-4.1.1/include']) easy_setup_env.AppendUnique(CPPPATH = [ env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include', -- 2.7.4