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()
26 ######################################################################
28 ######################################################################
29 provisioning_env.AppendUnique(CPPPATH = [
30 '../../stack/include',
31 '../../stack/include/internal',
32 '../../ocrandom/include',
33 '../../logger/include',
34 '../../../oc_logger/include',
35 '../../ocmalloc/include',
38 '../../resource/csdk/security/include',
39 '../../../../extlibs/cjson/',
40 '../../../../../extlibs/tinydtlsra/',
41 '../../connectivity/inc',
42 '../../connectivity/external/inc',
43 '../../connectivity/common/inc',
44 '../../connectivity/api',
48 target_os = env.get('TARGET_OS')
49 provisioning_env.AppendUnique(CFLAGS = ['-D__WITH_DTLS__'])
50 provisioning_env.AppendUnique(CFLAGS = ['-std=c99'])
51 if target_os not in ['windows', 'winrt']:
52 provisioning_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread', '-D__WITH_DTLS__'])
54 # Note: 'pthread' is in libc for android. On other platform, if use
55 # new gcc(>4.9?) it isn't required, otherwise, it's required
56 if target_os != 'android':
57 provisioning_env.AppendUnique(LIBS = ['-lpthread'])
60 provisioning_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
61 provisioning_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap'])
63 provisioning_env.AppendUnique(LIBS = ['tinydtls'])
65 provisioning_env.ParseConfig('pkg-config --libs glib-2.0');
67 if target_os == 'android':
68 provisioning_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
69 provisioning_env.AppendUnique(LIBS = ['gnustl_static'])
71 if not env.get('RELEASE'):
72 provisioning_env.AppendUnique(LIBS = ['log'])
74 if target_os in ['darwin', 'ios']:
75 provisioning_env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
77 ######################################################################
78 # Source files and Targets
79 ######################################################################
81 'src/provisioningmanager.c',
82 'src/credentialgenerator.c'
84 provisioningserver = provisioning_env.StaticLibrary('ocspapi', provisioning_src)
86 provisioning_env.InstallTarget(provisioningserver, 'libocspapi')
87 provisioning_env.UserInstallTargetLib(provisioningserver, 'libocspapi')
89 if target_os in ['linux']:
90 SConscript('sample/SConscript')