linux: Use sqlite from system like Tizen does
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Mon, 10 Oct 2016 09:49:28 +0000 (11:49 +0200)
committerPhil Coval <philippe.coval@osg.samsung.com>
Thu, 3 Nov 2016 08:10:01 +0000 (08:10 +0000)
It must be installed before building,
 For instance on debian and derived:
 apt-get install libsqlite3-dev

Note for later, it would make sense to move
 all those platform tests into sqlite sconfile.

Bug: https://jira.iotivity.org/browse/IOT-1296
Change-Id: I431a11821844bef8eabba30e1111b1ebf0799d66
Origin: https://gerrit.iotivity.org/gerrit/#/c/9135/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/9135
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
build_common/external_libs.scons
extlibs/sqlite3/SConscript
resource/csdk/SConscript
resource/csdk/resource-directory/SConscript
resource/csdk/security/provisioning/SConscript
resource/csdk/security/provisioning/sample/SConscript
resource/src/SConscript
service/easy-setup/enrollee/SConscript
service/easy-setup/mediator/richsdk/SConscript

index 1201273..645188a 100644 (file)
@@ -141,9 +141,9 @@ env.AddMethod(__download, "Download")
 env.AddMethod(__install_head_file, "InstallHeadFile")
 env.AddMethod(__install_lib, "InstallLib")
 
-if env.get('SECURED') == '1' and target_os != 'tizen':
+if env.get('SECURED') == '1' and target_os not in ['linux', 'tizen']:
        SConscript(os.path.join(env.get('SRC_DIR'), 'extlibs', 'sqlite3', 'SConscript'))
 
 if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
-        if target_os not in ['tizen']:
+        if target_os not in ['linux', 'tizen']:
                 SConscript(os.path.join(env.get('SRC_DIR'), 'extlibs', 'sqlite3', 'SConscript'))
index 3ef40ec..36cedf3 100755 (executable)
@@ -11,7 +11,7 @@ sqlite_env = env.Clone()
 target_os = sqlite_env.get('TARGET_OS')
 src_dir = sqlite_env.get('SRC_DIR')
 
-targets_need_sqlite = ['linux', 'android', 'msys_nt', 'windows']
+targets_need_sqlite = ['android', 'msys_nt', 'windows']
 sqlite_dir      = src_dir + '/extlibs/sqlite3/'
 sqlite_build_dir      = src_dir + '/extlibs/sqlite3/sqlite-amalgamation-3081101/'
 sqlite_zip_file = src_dir + '/extlibs/sqlite3/sqlite-amalgamation-3081101.zip'
index e731ea2..fc48143 100644 (file)
@@ -123,7 +123,6 @@ 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':
index 9e37166..1a52fe6 100755 (executable)
@@ -55,7 +55,7 @@ if target_os == 'android':
     if not env.get('RELEASE'):
         rd_env.AppendUnique(LIBS = ['log'])
 
-if target_os in ['tizen']:
+if target_os in ['linux', 'tizen']:
     rd_env.ParseConfig('pkg-config --cflags --libs sqlite3')
 else:
     rd_env.AppendUnique(CPPPATH = ['../../../extlibs/sqlite3'])
@@ -71,7 +71,7 @@ if 'SERVER' in rd_mode:
         RD_SRC_DIR + 'internal/rd_database.c',
         RD_SRC_DIR + 'rd_server.c',
         ]
-    if target_os not in ['tizen'] :
+    if target_os not in ['linux', 'tizen'] :
         rd_src += [ '../../../extlibs/sqlite3/sqlite3.c' ]
 
 if 'CLIENT' in rd_mode:
index 4b67035..883c9cd 100644 (file)
@@ -120,7 +120,7 @@ if provisioning_env.get('WITH_TCP') == True:
        'src/cloud/aclid.c',
        'src/cloud/csr.c']
 
-if target_os in ['tizen']:
+if target_os in ['linux', 'tizen']:
        provisioning_env.ParseConfig('pkg-config --cflags --libs sqlite3')
 else:
        provisioning_env.AppendUnique(CPPPATH = ['../../../../extlibs/sqlite3'])
index 2b91aac..99814dd 100644 (file)
@@ -93,6 +93,7 @@ provisioning_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
 
 if target_os == 'tizen':
     provisioning_env.AppendUnique(CPPDEFINES = ['__TIZEN__'])
+if target_os in ['linux', 'tizen']:
     provisioning_env.ParseConfig('pkg-config --cflags --libs sqlite3')
 
 ######################################################################
index 45864d3..0eeed20 100644 (file)
@@ -75,6 +75,7 @@ if target_os == 'android':
 
 if target_os == 'tizen':
        oclib_env.AppendUnique(CPPDEFINES = ['__TIZEN__'])
+if target_os in ['linux', 'tizen']:
        oclib_env.ParseConfig('pkg-config --cflags --libs sqlite3')
 
 if target_os in ['linux'] and oclib_env.get('SIMULATOR', False):
index a09b37d..ab4a2e2 100644 (file)
@@ -51,7 +51,7 @@ enrollee_env.PrependUnique(CPPPATH = [
                enrollee_env.get('SRC_DIR') + '/service/easy-setup/enrollee/inc',
                enrollee_env.get('SRC_DIR') + '/service/easy-setup/enrollee/src'])
 
-if target_os not in ['tizen']:
+if target_os not in ['linux', 'tizen']:
     enrollee_env.PrependUnique(CPPPATH = [
         enrollee_env.get('SRC_DIR') + '/extlibs/sqlite3'])
 
index 0805bfe..dd2d019 100755 (executable)
@@ -94,8 +94,9 @@ if target_os in ['android','linux']:
                env.get('SRC_DIR') + '/resource/csdk/logger/include',
                env.get('SRC_DIR') + '/resource/csdk/security/include',
                env.get('SRC_DIR') + '/extlibs/cjson',
-               env.get('SRC_DIR') + '/extlibs/sqlite3',
                env.get('SRC_DIR') + '/service/easy-setup/inc'])
+       if target_os not in ['linux', 'tizen']:
+               easy_setup_env.PrependUnique(CPPPATH = [env.get('SRC_DIR') + '/extlibs/sqlite3'])
        if env.get('SECURED') == '1':
                with_upstream_libcoap = easy_setup_env.get('WITH_UPSTREAM_LIBCOAP')
                if with_upstream_libcoap == '1':