Fixed Tizen build error with SECURED=1 97/2997/6
authorjs126.lee <js126.lee@samsung.com>
Wed, 23 Sep 2015 14:06:02 +0000 (23:06 +0900)
committerSachin Agrawal <sachin.agrawal@intel.com>
Fri, 25 Sep 2015 17:51:36 +0000 (17:51 +0000)
[Patch-1] Initial
[Patch-2,3] Fixed build error in case of CA partially.
Note : The purpose of this patch is to fix build error
when building full tizen with security.
The change required in jenkins configuration is out of this patch.

Change-Id: I2ec95c13d6c7d7978662e7ef69f7a02cd8188df0
Signed-off-by: js126.lee <js126.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2997
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Sachin Agrawal <sachin.agrawal@intel.com>
extlibs/sqlite3/SConscript [changed mode: 0644->0755]
gbsbuild.sh
resource/csdk/connectivity/src/SConscript [changed mode: 0644->0755]
resource/csdk/security/SConscript
resource/csdk/security/provisioning/src/provisioningdatabasemanager.c [changed mode: 0644->0755]
resource/csdk/security/provisioning/src/secureresourceprovider.c [changed mode: 0644->0755]
tools/tizen/iotivity.spec [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index df92613..41c65df
@@ -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']
+targets_need_sqlite = ['linux', 'android', 'tizen']
 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 d3fe3ab..bc62fad 100755 (executable)
@@ -23,6 +23,7 @@ cp -R ./examples $sourcedir/tmp
 cp -R ./extlibs/tinycbor $sourcedir/tmp/extlibs
 cp -R ./extlibs/cjson $sourcedir/tmp/extlibs
 cp -R ./extlibs/tinydtls $sourcedir/tmp/extlibs
+cp -R ./extlibs/sqlite3 $sourcedir/tmp/extlibs
 cp -R ./extlibs/timer $sourcedir/tmp/extlibs
 cp -R ./extlibs/rapidxml $sourcedir/tmp/extlibs
 cp -R ./resource $sourcedir/tmp
old mode 100644 (file)
new mode 100755 (executable)
index 3572b20..95a8076
@@ -40,10 +40,10 @@ env.SConscript('./../common/SConscript')
 # is interpreted by SCons as the top-level iotivity directory where
 # the SConscruct file is found.
 if env.get('SECURED') == '1':
-        if ca_os == 'tizen':
-                env.SConscript(os.path.join(root_dir, 'extlibs/tinydtls/SConscript'))
-        else:
-                env.SConscript('#extlibs/tinydtls/SConscript')
+       if ca_os == 'tizen' and os.path.exists(root_dir + '/extlibs/tinydtls'):
+               env.SConscript(os.path.join(root_dir, 'extlibs/tinydtls/SConscript'))
+       else:
+               env.SConscript('#extlibs/tinydtls/SConscript')
 
 env.AppendUnique(CA_SRC = [os.path.join(ca_path,
                                         'adapter_util/caadapterutils.c')])
@@ -99,10 +99,10 @@ else:
                env.AppendUnique(CPPDEFINES = ['WITH_BWT'])
        if secured == '1':
                env.AppendUnique(CPPDEFINES = ['__WITH_DTLS__'])
-                if ca_os == 'tizen':
-                        env.AppendUnique(CPPPATH = [os.path.join(root_dir, 'extlibs/tinydtls')])
-                else:
-                        env.AppendUnique(CPPPATH = ['#extlibs/tinydtls'])
+               if ca_os == 'tizen' and os.path.exists(root_dir + '/extlibs/tinydtls'):
+                       env.AppendUnique(CPPPATH = [os.path.join(root_dir, 'extlibs/tinydtls')])
+               else:
+                       env.AppendUnique(CPPPATH = ['#extlibs/tinydtls'])
 
 ca_common_src = [
         os.path.join(ca_path, d) for d in ca_common_src ]
index 4e1099f..6d83044 100755 (executable)
@@ -137,6 +137,6 @@ libocsrm = libocsrm_env.StaticLibrary('libocsrm', libocsrm_src)
 libocsrm_env.InstallTarget(libocsrm, 'libocsrm')
 libocsrm_env.UserInstallTargetLib(libocsrm, 'libocsrm')
 
-if target_os in ['linux', 'android'] and env.get('SECURED') == '1':
+if target_os in ['linux', 'android', 'tizen'] and env.get('SECURED') == '1':
        SConscript('provisioning/SConscript')
 
old mode 100644 (file)
new mode 100755 (executable)
index 6e4035e..0d3182e
 
 #include <stdio.h>
 #include <stdbool.h>
-#include <sqlite3.h>
 #include <string.h>
 #include <stdlib.h>
 
+#include "sqlite3.h"
 #include "logger.h"
 #include "oic_malloc.h"
 #include "provisioningdatabasemanager.h"
@@ -56,7 +56,7 @@
  * eg: VERIFY_NON_NULL(TAG, ptrData, ERROR,OC_STACK_ERROR);
  */
 #define PDM_VERIFY_SQLITE_OK(tag, arg, logLevel, retValue) do{ if (SQLITE_OK != (arg)) \
-            { OC_LOG_V((logLevel), tag, ("Error in " #arg ", Error Message: %s"), \
+            { OC_LOG_V((logLevel), tag, "Error in " #arg ", Error Message: %s", \
                sqlite3_errmsg(g_db)); return retValue; }}while(0)
 
 #define PDM_SQLITE_TRANSACTION_BEGIN "BEGIN TRANSACTION;"
old mode 100644 (file)
new mode 100755 (executable)
index 631f041..a6a9e35
  * eg: VERIFY_NON_NULL(TAG, ptrData, ERROR,OC_STACK_ERROR);
  */
 #define VERIFY_NON_NULL(tag, arg, logLevel, retValue) { if (NULL == (arg)) \
-            { OC_LOG((logLevel), tag, (#arg " is NULL")); return retValue; } }
+            { OC_LOG((logLevel), tag, #arg " is NULL"); return retValue; } }
 
 /**
  * Macro to verify success of operation.
  * eg: VERIFY_SUCCESS(TAG, OC_STACK_OK == foo(), ERROR, OC_STACK_ERROR);
  */
 #define VERIFY_SUCCESS(tag, op, logLevel, retValue) { if (!(op)) \
-            {OC_LOG((logLevel), tag, (#op " failed!!")); return retValue;} }
+            {OC_LOG((logLevel), tag, #op " failed!!"); return retValue;} }
 
 /**
  * Structure to carry credential data to callback.
old mode 100644 (file)
new mode 100755 (executable)
index 5e6970e..07d2088
@@ -21,6 +21,7 @@ BuildRequires:  pkgconfig(uuid)
 BuildRequires:  pkgconfig(capi-network-wifi)
 BuildRequires:  pkgconfig(capi-network-bluetooth)
 BuildRequires:  pkgconfig(capi-appfw-app-common)
+BuildRequires:  pkgconfig(glib-2.0)
 Requires(postun): /sbin/ldconfig
 Requires(post): /sbin/ldconfig