From 3946fca0bafa9a3657a3b6651288e6aabe7717d0 Mon Sep 17 00:00:00 2001 From: "daeken.kwon" Date: Mon, 19 Sep 2016 08:45:59 +0900 Subject: [PATCH] To build static libarary from CSDK Change-Id: I8e1e7a3ca76780cbedefdcfd2c84fbf316ed3058 Signed-off-by: daeken.kwon Reviewed-on: https://gerrit.iotivity.org/gerrit/11611 Tested-by: jenkins-iotivity Reviewed-by: Hyuna Jo Reviewed-by: Uze Choi (cherry picked from commit d92670762c1667f817fdae6edd5d6a9a64e9edd6) Reviewed-on: https://gerrit.iotivity.org/gerrit/12519 --- resource/csdk/SConscript | 7 ------- resource/csdk/connectivity/src/SConscript | 5 +++-- resource/csdk/security/SConscript | 7 +++++++ resource/csdk/security/provisioning/SConscript | 4 +++- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/resource/csdk/SConscript b/resource/csdk/SConscript index afcfe76..8fbbfae 100644 --- a/resource/csdk/SConscript +++ b/resource/csdk/SConscript @@ -189,13 +189,6 @@ if 'CLIENT' in rd_mode or 'SERVER' in rd_mode: if with_tcp == True: liboctbstack_src.append(OCTBSTACK_SRC + 'oickeepalive.c') -liboctbstack_src.extend(env['cbor_files']) - -# Insert a hack for Arduino, whose compiler may not support all defines expected -# by tinycbor -if target_os in ['arduino']: - liboctbstack_env.AppendUnique(CPPDEFINES = ['INT64_MAX=0x7FFFFFFFFFFFFFFF']) - if target_os in ['windows', 'msys_nt']: # Avoid a name conflict with the octbstack.lib target of the SharedLibrary. static_liboctbstack = liboctbstack_env.StaticLibrary('octbstack_static', liboctbstack_src) diff --git a/resource/csdk/connectivity/src/SConscript b/resource/csdk/connectivity/src/SConscript index 5c71fe8..aefdf11 100644 --- a/resource/csdk/connectivity/src/SConscript +++ b/resource/csdk/connectivity/src/SConscript @@ -223,8 +223,9 @@ if ca_os in ['android', 'tizen', 'linux']: lib_env.AppendUnique(LIBS = ['rt']) if ((lib_env.get('SECURED') == '1') and ((lib_env.get('WITH_TCP')) or (lib_env.get('WITH_CLOUD')))): lib_env.AppendUnique(LIBS = ['mbedtls','mbedx509','mbedcrypto']) - - calib = lib_env.SharedLibrary('connectivity_abstraction', env.get('CA_SRC')) + static_calib = lib_env.StaticLibrary('connectivity_abstraction', env.get('CA_SRC')) + shared_calib = lib_env.SharedLibrary('connectivity_abstraction', lib_env.get('CA_SRC')) + calib = Flatten([static_calib, shared_calib]) elif ca_os in ['msys_nt', 'windows']: lib_env.AppendUnique(LIBS = ['coap', 'mswsock', 'ws2_32', 'iphlpapi', 'logger']) if lib_env.get('SECURED') == '1': diff --git a/resource/csdk/security/SConscript b/resource/csdk/security/SConscript index f878587..ca5714a 100644 --- a/resource/csdk/security/SConscript +++ b/resource/csdk/security/SConscript @@ -127,6 +127,13 @@ if target_os in ['windows', 'msys_nt']: if (env.get('DTLS_WITH_X509') == '1' or env.get('WITH_TCP') == True) and env.get('SECURED') == '1': libocsrm_src = libocsrm_src + [OCSRM_SRC + 'crlresource.c', OCSRM_SRC + 'pkix_interface.c'] +libocsrm_src.extend(env['cbor_files']) + +# Insert a hack for Arduino, whose compiler may not support all defines expected +# by tinycbor +if target_os in ['arduino']: + libocsrm_env.AppendUnique(CPPDEFINES = ['INT64_MAX=0x7FFFFFFFFFFFFFFF']) + libocsrm_conf = Configure(libocsrm_env) if libocsrm_conf.CheckFunc('strptime'): libocsrm_conf.env.AppendUnique(CPPDEFINES = ['HAVE_STRPTIME']) diff --git a/resource/csdk/security/provisioning/SConscript b/resource/csdk/security/provisioning/SConscript index 593a6c4..e1739ec 100644 --- a/resource/csdk/security/provisioning/SConscript +++ b/resource/csdk/security/provisioning/SConscript @@ -128,7 +128,9 @@ if target_os in ['windows', 'msys_nt']: # octbstack.dll is exporting ocpmapi APIs on Windows - there is no ocpmapi.dll. provisioningserver = provisioning_env.StaticLibrary('ocpmapi', provisioning_src) else: - provisioningserver = provisioning_env.SharedLibrary('ocpmapi', provisioning_src) + static_provisioning_lib = provisioning_env.StaticLibrary('ocpmapi', provisioning_src) + shared_provisioning_lib = provisioning_env.SharedLibrary('ocpmapi', provisioning_src) + provisioningserver = Flatten([static_provisioning_lib, shared_provisioning_lib]) provisioning_env.InstallTarget(provisioningserver, 'ocpmapi') provisioning_env.UserInstallTargetLib(provisioningserver, 'ocpmapi') -- 2.7.4