1 # //******************************************************************
3 # // Copyright 2015 Samsung Electronics All Rights Reserved.
5 # //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 # // Licensed under the Apache License, Version 2.0 (the "License");
8 # // you may not use this file except in compliance with the License.
9 # // You may obtain a copy of the License at
11 # // http://www.apache.org/licenses/LICENSE-2.0
13 # // Unless required by applicable law or agreed to in writing, software
14 # // distributed under the License is distributed on an "AS IS" BASIS,
15 # // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # // See the License for the specific language governing permissions and
17 # // limitations under the License.
19 # //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
24 provisioning_env = env.Clone()
25 root_dir = './../../../../'
27 ######################################################################
29 ######################################################################
30 provisioning_env.AppendUnique(CPPPATH = [
31 '../../stack/include',
32 '../../stack/include/internal',
33 '../../../c_common/ocrandom/include',
34 '../../logger/include',
35 '../../../oc_logger/include',
36 '../../ocmalloc/include',
40 '../../resource/csdk/security/include',
41 '../../../../extlibs/cjson/',
42 '../../../../../extlibs/tinydtls/',
43 '../../connectivity/inc',
44 '../../connectivity/external/inc',
45 '../../connectivity/common/inc',
46 '../../connectivity/lib/libcoap-4.1.1',
47 '../../connectivity/api',
49 '../include/internal',
50 '../../../../extlibs/tinydtls/ecc',
51 '../../../../extlibs/tinydtls/sha2',
52 '../../../../extlibs/asn1cert',
55 target_os = env.get('TARGET_OS')
57 if target_os != 'tizen':
58 provisioning_env.AppendUnique(CPPPATH = ['../../../../extlibs/sqlite3'])
60 provisioning_env.AppendUnique(CFLAGS = ['-D__WITH_DTLS__'])
61 provisioning_env.AppendUnique(CFLAGS = ['-std=c99'])
62 if target_os not in ['windows', 'winrt']:
63 provisioning_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread', '-D__WITH_DTLS__'])
65 # Note: 'pthread' is in libc for android. On other platform, if use
66 # new gcc(>4.9?) it isn't required, otherwise, it's required
67 if target_os != 'android':
68 provisioning_env.AppendUnique(LIBS = ['-lpthread', '-ldl'])
71 provisioning_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
72 provisioning_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap'])
74 provisioning_env.AppendUnique(LIBS = ['tinydtls'])
76 if env.get('DTLS_WITH_X509') == '1':
77 provisioning_env.AppendUnique(LIBS = ['CKManager', 'asn1'])
79 if target_os != 'android':
80 provisioning_env.ParseConfig('pkg-config --libs glib-2.0')
82 if target_os == 'tizen':
83 provisioning_env.ParseConfig('pkg-config --cflags --libs sqlite3')
85 if target_os == 'android':
86 provisioning_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
87 provisioning_env.AppendUnique(LIBS = ['gnustl_static'])
89 if not env.get('RELEASE'):
90 provisioning_env.AppendUnique(LIBS = ['log'])
92 if target_os in ['darwin', 'ios']:
93 provisioning_env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
95 ######################################################################
96 # Source files and Targets
97 ######################################################################
100 'src/credentialgenerator.c',
101 'src/ownershiptransfermanager.c',
102 'src/secureresourceprovider.c',
103 'src/ocprovisioningmanager.c',
104 'src/oxmjustworks.c',
105 'src/oxmrandompin.c',
106 'src/provisioningdatabasemanager.c' ]
108 if target_os != 'tizen':
109 provisioning_src = provisioning_src + [root_dir+'/extlibs/sqlite3/sqlite3.c' ]
111 provisioningserver = provisioning_env.SharedLibrary('ocpmapi', provisioning_src)
113 provisioning_env.InstallTarget(provisioningserver, 'libocpmapi')
114 provisioning_env.UserInstallTargetLib(provisioningserver, 'libocpmapi')
116 if env.get('DTLS_WITH_X509') == '1':
117 SConscript('ck_manager/SConscript')
119 if target_os in ['linux']:
120 SConscript('sample/SConscript')