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 '../../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/sqlite3',
51 '../../../../extlibs/tinydtls/ecc',
52 '../../../../extlibs/tinydtls/sha2',
53 '../../../../extlibs/asn1cert',
56 target_os = env.get('TARGET_OS')
57 provisioning_env.AppendUnique(CFLAGS = ['-D__WITH_DTLS__'])
58 provisioning_env.AppendUnique(CFLAGS = ['-std=c99'])
59 if target_os not in ['windows', 'winrt']:
60 provisioning_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread', '-D__WITH_DTLS__'])
62 # Note: 'pthread' is in libc for android. On other platform, if use
63 # new gcc(>4.9?) it isn't required, otherwise, it's required
64 if target_os != 'android':
65 provisioning_env.AppendUnique(LIBS = ['-lpthread'])
68 provisioning_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
69 provisioning_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap'])
71 provisioning_env.AppendUnique(LIBS = ['tinydtls'])
73 if env.get('DTLS_WITH_X509') == '1':
74 provisioning_env.AppendUnique(LIBS = ['CKManger'])
76 provisioning_env.ParseConfig('pkg-config --libs glib-2.0');
78 if target_os == 'android':
79 provisioning_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
80 provisioning_env.AppendUnique(LIBS = ['gnustl_static'])
82 if not env.get('RELEASE'):
83 provisioning_env.AppendUnique(LIBS = ['log'])
85 if target_os in ['darwin', 'ios']:
86 provisioning_env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
88 ######################################################################
89 # Source files and Targets
90 ######################################################################
93 'src/credentialgenerator.c',
94 'src/ownershiptransfermanager.c',
95 'src/secureresourceprovider.c',
96 'src/ocprovisioningmanager.c',
99 'src/provisioningdatabasemanager.c',
100 root_dir+'/extlibs/sqlite3/sqlite3.c' ]
101 provisioningserver = provisioning_env.StaticLibrary('ocpmapi', provisioning_src)
103 provisioning_env.InstallTarget(provisioningserver, 'libocpmapi')
104 provisioning_env.UserInstallTargetLib(provisioningserver, 'libocpmapi')
106 if env.get('DTLS_WITH_X509') == '1':
107 SConscript('ck_manager/SConscript')
109 if target_os in ['linux']:
110 SConscript('sample/SConscript')