tizen: Link to systemwide's sqlite
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Wed, 7 Sep 2016 08:15:46 +0000 (10:15 +0200)
committerUze Choi <uzchoi@samsung.com>
Wed, 7 Sep 2016 22:17:13 +0000 (22:17 +0000)
Without this change, error may occurs and display this message:

   Linking resource/csdk/liboctbstack.so
   out/tizen/x86_64/release/libocsrm.a(provisioningdatabasemanager.o): In function `createDB':
   provisioningdatabasemanager.c:(.text+0x2c): undefined reference to `sqlite3_open_v2'

Bug: https://jira.iotivity.org/browse/IOT-1260
Change-Id: I6fbb51d5746f7d02bb3fd15d337d5d91c592b4ec
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/9623
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
resource/csdk/SConscript
resource/csdk/security/SConscript
resource/csdk/security/provisioning/sample/SConscript
resource/src/SConscript

index f1e7b50f3dd22831d3d6d18f4ddad134c0b67817..a9d6c0de3c5c899798d5183c3e91ca6d3f75b106 100644 (file)
@@ -118,6 +118,8 @@ else:
 
 if target_os in ['tizen', 'linux']:
        liboctbstack_env.ParseConfig("pkg-config --cflags --libs uuid")
+if target_os in ['tizen']:
+       liboctbstack_env.ParseConfig('pkg-config --cflags --libs sqlite3')
 
 if target_os == 'arduino':
        liboctbstack_env.AppendUnique(CPPDEFINES = ['NDEBUG', 'WITH_ARDUINO'])
index 4abd6a083f614c3b9b3fd29e8ac88262207a759b..2e5e55e3f4c55e9312e406a4fa63158353fa38e0 100644 (file)
@@ -58,9 +58,6 @@ libocsrm_env.PrependUnique(CPPPATH = [
                '../security/provisioning/include'
                ])
 
-if env.get('SECURED') == '1' and target_os not in ['tizen']:
-       libocsrm_env.AppendUnique(CPPPATH = ['../../../extlibs/sqlite3'])
-
 if target_os not in ['arduino', 'windows']:
        libocsrm_env.AppendUnique(CPPDEFINES  = ['WITH_POSIX'])
        libocsrm_env.AppendUnique(CFLAGS = ['-std=c99', '-Wall'])
@@ -114,14 +111,14 @@ libocsrm_src = [
        OCSRM_SRC + 'directpairing.c'
        ]
 
-if env.get('SECURED') == '1':
+if libocsrm_env.get('SECURED') == '1':
+       if target_os in ['tizen']:
+               libocsrm_env.ParseConfig('pkg-config --cflags --libs sqlite3')
+       else:
+               libocsrm_env.AppendUnique(CPPPATH = ['../../../extlibs/sqlite3'])
+               libocsrm_src = libocsrm_src + ['../../../extlibs/sqlite3/sqlite3.c']
        libocsrm_src = libocsrm_src + [OCSRM_SRC + 'provisioningdatabasemanager.c']
-
-if env.get('SECURED') == '1' and target_os != 'tizen':
-       libocsrm_src = libocsrm_src + ['../../../extlibs/sqlite3/sqlite3.c']
-
-if env.get('SECURED') == '1':
-       libocsrm_src  = libocsrm_src + [OCSRM_SRC + 'oxmpincommon.c', OCSRM_SRC + 'pbkdf2.c']
+       libocsrm_src = libocsrm_src + [OCSRM_SRC + 'oxmpincommon.c', OCSRM_SRC + 'pbkdf2.c']
 
 if target_os in ['windows', 'msys_nt']:
        libocsrm_src  = libocsrm_src + [OCSRM_SRC + 'strptime.c']
index 23818ff62bcb34b3eda0bc628a400a0c1b36d7d5..731d45fd2f30b760c440750710fc4703fa63172f 100644 (file)
@@ -82,6 +82,7 @@ provisioning_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
 
 if target_os == 'tizen':
     provisioning_env.AppendUnique(CPPDEFINES = ['__TIZEN__'])
+    provisioning_env.ParseConfig('pkg-config --cflags --libs sqlite3')
 
 ######################################################################
 # Source files and Targets
index cdf7d7c3624546f0e7c1ad80e3ab73673a5c4f41..301e7df66496c82e3f518d3ca39f6411e61ef729 100644 (file)
@@ -67,6 +67,7 @@ if target_os == 'android':
 
 if target_os == 'tizen':
        oclib_env.AppendUnique(CPPDEFINES = ['__TIZEN__'])
+       oclib_env.ParseConfig('pkg-config --cflags --libs sqlite3')
 
 if target_os in ['linux'] and oclib_env.get('SIMULATOR', False):
     oclib_env.Append( RPATH = oclib_env.Literal('\\$$ORIGIN'))