Commit e2916b5b authored by Dan Mihai's avatar Dan Mihai

Support different LIBS for product and unit test

Move the provisioning/SConscript part that applies to product code
into provisioning/src/. That allows provisioning/src/ and
provisioning/unitest/ to link with a different set of LIBS.

The set of LIBs did not change yet. That change is coming up in a
future patch.

Change-Id: I9741db9730971d4567c971985111acfd0aa101f9
Signed-off-by: default avatarDan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19143Reviewed-by: default avatarKevin Kane <kkane@microsoft.com>
Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
parent cfc575c8
......@@ -45,83 +45,7 @@ provisioning_env.AppendUnique(CPPDEFINES= ['__WITH_DTLS__'])
if 'g++' in provisioning_env.get('CXX'):
provisioning_env.AppendUnique(CXXFLAGS = ['-std=c++0x'])
provisioning_env.PrependUnique(LIBS = ['octbstack', 'connectivity_abstraction', 'coap'])
if target_os not in ['msys_nt', 'windows']:
# octbstack.dll is exporting ocpmapi and ocsrm APIs on Windows.
provisioning_env.PrependUnique(LIBS = ['ocsrm'])
provisioning_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509','mbedcrypto'])
if target_os in ['windows', 'msys_nt']:
provisioning_env.AppendUnique(LIBS = ['ws2_32', 'advapi32', 'iphlpapi'])
if target_os in ['android']:
provisioning_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
provisioning_env.AppendUnique(LIBS = ['gnustl_static'])
if target_os in ['darwin', 'ios']:
provisioning_env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
if provisioning_env.get('LOGGING'):
provisioning_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
if provisioning_env.get('MULTIPLE_OWNER') == '1':
provisioning_env.AppendUnique(CPPDEFINES=['MULTIPLE_OWNER'])
######################################################################
# Source files and Targets
######################################################################
provisioning_src = [
'src/pmutility.c',
'src/credentialgenerator.c',
'src/otmcontextlist.c',
'src/ownershiptransfermanager.c',
'src/secureresourceprovider.c',
'src/ocprovisioningmanager.c',
'src/oxmjustworks.c',
'src/oxmrandompin.c',
'src/oxmmanufacturercert.c',
'src/provisioningdatabasemanager.c' ]
if provisioning_env.get('MULTIPLE_OWNER') == '1':
provisioning_src = provisioning_src + [
'src/multipleownershiptransfermanager.c',
'src/oxmpreconfpin.c']
if provisioning_env.get('WITH_TCP') == True:
provisioning_env.AppendUnique(CPPDEFINES= ['__WITH_TLS__'])
provisioning_src = provisioning_src + [
'src/cloud/utils.c',
'src/cloud/crl.c',
'src/cloud/aclgroup.c',
'src/cloud/aclinvite.c',
'src/cloud/aclid.c',
'src/cloud/csr.c']
if target_os in ['linux', 'tizen']:
provisioning_env.ParseConfig('pkg-config --cflags --libs sqlite3')
else:
provisioning_env.AppendUnique(CPPPATH = ['#/extlibs/sqlite3'])
if target_os not in ['windows']:
provisioning_src = provisioning_src + ['#/extlibs/sqlite3/sqlite3.c' ]
if target_os in ['android']:
provisioning_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libocpmapi.so'])
internal_provisioning_lib = provisioning_env.StaticLibrary('ocpmapi_internal', provisioning_src)
provisioningserver = Flatten(internal_provisioning_lib)
if target_os not in ['windows', 'msys_nt']:
static_provisioning_lib = provisioning_env.StaticLibrary('ocpmapi', provisioning_src)
provisioningserver += Flatten(static_provisioning_lib)
if target_os not in ['ios']:
shared_provisioning_lib = provisioning_env.SharedLibrary('ocpmapi', provisioning_src)
provisioningserver += Flatten(shared_provisioning_lib)
provisioning_env.InstallTarget(provisioningserver, 'ocpmapi')
provisioning_env.UserInstallTargetLib(provisioningserver, 'ocpmapi')
SConscript('src/SConscript', 'provisioning_env')
if target_os in ['linux', 'msys_nt', 'windows', 'tizen']:
SConscript('sample/SConscript', 'provisioning_env')
# -*- mode: python; python-indent-offset: 4; indent-tabs-mode: nil -*-
# //******************************************************************
# //
# // Copyright 2015 Samsung Electronics All Rights Reserved.
# //
# //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# //
# // Licensed under the Apache License, Version 2.0 (the "License");
# // you may not use this file except in compliance with the License.
# // You may obtain a copy of the License at
# //
# // http://www.apache.org/licenses/LICENSE-2.0
# //
# // Unless required by applicable law or agreed to in writing, software
# // distributed under the License is distributed on an "AS IS" BASIS,
# // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# // See the License for the specific language governing permissions and
# // limitations under the License.
# //
# //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
Import('provisioning_env')
provisioning_lib_env = provisioning_env.Clone()
target_os = provisioning_lib_env.get('TARGET_OS')
provisioning_lib_env.PrependUnique(LIBS = ['coap'])
if target_os not in ['msys_nt', 'windows']:
# octbstack.dll is exporting connectivity_abstraction APIs on Windows.
provisioning_lib_env.PrependUnique(LIBS = ['connectivity_abstraction'])
provisioning_lib_env.PrependUnique(LIBS = ['octbstack'])
if target_os not in ['msys_nt', 'windows']:
# octbstack.dll is exporting ocpmapi and ocsrm APIs on Windows.
provisioning_lib_env.PrependUnique(LIBS = ['ocsrm'])
provisioning_lib_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509','mbedcrypto'])
if target_os in ['android']:
provisioning_lib_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
provisioning_lib_env.AppendUnique(LIBS = ['gnustl_static'])
if target_os in ['darwin', 'ios']:
provisioning_lib_env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
if provisioning_lib_env.get('LOGGING'):
provisioning_lib_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
if provisioning_lib_env.get('MULTIPLE_OWNER') == '1':
provisioning_lib_env.AppendUnique(CPPDEFINES=['MULTIPLE_OWNER'])
######################################################################
# Source files and Targets
######################################################################
provisioning_src = [
'pmutility.c',
'credentialgenerator.c',
'otmcontextlist.c',
'ownershiptransfermanager.c',
'secureresourceprovider.c',
'ocprovisioningmanager.c',
'oxmjustworks.c',
'oxmrandompin.c',
'oxmmanufacturercert.c',
'provisioningdatabasemanager.c' ]
if provisioning_lib_env.get('MULTIPLE_OWNER') == '1':
provisioning_src = provisioning_src + [
'multipleownershiptransfermanager.c',
'oxmpreconfpin.c']
if provisioning_lib_env.get('WITH_TCP') == True:
provisioning_lib_env.AppendUnique(CPPDEFINES= ['__WITH_TLS__'])
provisioning_src = provisioning_src + [
'cloud/utils.c',
'cloud/crl.c',
'cloud/aclgroup.c',
'cloud/aclinvite.c',
'cloud/aclid.c',
'cloud/csr.c']
if target_os in ['linux', 'tizen']:
provisioning_lib_env.ParseConfig('pkg-config --cflags --libs sqlite3')
else:
provisioning_lib_env.AppendUnique(CPPPATH = ['#/extlibs/sqlite3'])
if target_os not in ['windows']:
provisioning_src = provisioning_src + ['#/extlibs/sqlite3/sqlite3.c' ]
if target_os in ['android']:
provisioning_lib_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libocpmapi.so'])
internal_provisioning_lib = provisioning_lib_env.StaticLibrary('ocpmapi_internal', provisioning_src)
provisioningserver = Flatten(internal_provisioning_lib)
if target_os not in ['windows', 'msys_nt']:
static_provisioning_lib = provisioning_lib_env.StaticLibrary('ocpmapi', provisioning_src)
provisioningserver += Flatten(static_provisioning_lib)
if target_os not in ['ios']:
shared_provisioning_lib = provisioning_lib_env.SharedLibrary('ocpmapi', provisioning_src)
provisioningserver += Flatten(shared_provisioning_lib)
provisioning_lib_env.InstallTarget(provisioningserver, 'ocpmapi')
provisioning_lib_env.UserInstallTargetLib(provisioningserver, 'ocpmapi')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment