Linking against version of libcoap in favor of the version in extlibs.
authorZiran Sun <ziran.sun@samsung.com>
Tue, 18 Apr 2017 12:55:22 +0000 (13:55 +0100)
committerZiran Sun <ziran.sun@samsung.com>
Tue, 25 Apr 2017 14:32:06 +0000 (14:32 +0000)
Bug: https://jira.iotivity.org/browse/IOT-2055
Change-Id: I3ca9b87ab33aeeb18607c582f2bdccfaa18b3d2f
Signed-off-by: Ziran Sun <ziran.sun@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19063
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
17 files changed:
cloud/samples/client/SConscript
java/jni/SConscript
plugins/src/SConscript
resource/IPCA/src/SConscript
resource/csdk/connectivity/src/SConscript
resource/csdk/connectivity/test/SConscript
resource/csdk/resource-directory/unittests/SConscript
resource/csdk/security/SConscript
resource/csdk/security/provisioning/unittest/SConscript
resource/csdk/security/tool/SConscript
resource/csdk/security/unittest/SConscript
resource/csdk/stack/SConscript
resource/csdk/stack/samples/tizen/build/SConscript
resource/provisioning/SConscript
resource/src/SConscript
service/coap-http-proxy/SConscript
service/easy-setup/mediator/richsdk/SConscript

index ca9814f..087dfb6 100644 (file)
@@ -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'])
index 57fca27..5edd0bb 100644 (file)
@@ -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')
index d3715f1..b9945c2 100644 (file)
@@ -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'),
index 0684efc..82c7538 100644 (file)
@@ -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',
index e929495..7ca90db 100644 (file)
@@ -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'),
index e687d68..d81bca6 100644 (file)
@@ -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 = [
index 984919f..9fe6c55 100644 (file)
@@ -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',
index 346ea1e..081d878 100644 (file)
@@ -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 = [
index 427ce07..b2a2647 100644 (file)
@@ -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 = [
index 4161b72..0c66a7f 100644 (file)
@@ -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',
index 3d92905..b5705b0 100644 (file)
@@ -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 = [
index d46e42f..33f9a8a 100644 (file)
@@ -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 = [
index 7670d7a..68fdd31 100644 (file)
@@ -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 = [
index 26f82f1..fd730e4 100644 (file)
@@ -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 = [
index 27c8d27..290496b 100644 (file)
@@ -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 = [
index 687e2e9..80973bf 100644 (file)
@@ -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'])
index 7977b21..5f66bf3 100755 (executable)
@@ -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',