1 # -*- mode: python; python-indent-offset: 4; indent-tabs-mode: nil -*-
3 # This script includes generic build options:
4 # release/debug, target os, target arch, cross toolchain, build environment etc
9 project_version = '1.3.0'
11 # Map of host os and allowed target os (host: allowed target os)
13 'linux': ['linux', 'android', 'arduino', 'yocto', 'tizen'],
14 'windows': ['windows', 'android', 'arduino'],
15 'darwin': ['darwin', 'ios', 'android', 'arduino'],
16 'msys_nt' :['msys_nt'],
19 # Map of os and allowed archs (os: allowed archs)
21 'linux': ['x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64', 'mips', 'mipsel', 'mips64', 'mips64el', 'i386', 'powerpc', 'sparc', 'aarch64'],
22 'tizen': ['x86', 'x86_64', 'arm', 'arm-v7a', 'armeabi-v7a', 'arm64'],
23 'android': ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'arm64-v8a'],
24 'windows': ['x86', 'amd64', 'arm'],
25 'msys_nt':['x86', 'x86_64'],
26 'darwin': ['i386', 'x86_64'],
27 'ios': ['i386', 'x86_64', 'armv7', 'armv7s', 'arm64'],
28 'arduino': ['avr', 'arm'],
29 'yocto': ['i586', 'i686', 'x86_64', 'arm', 'aarch64', 'powerpc', 'powerpc64', 'mips', 'mipsel'],
32 host = platform.system().lower()
34 # the host string contains version of windows. 6.3, 6.4, 10.0 which is 8.0, 8.1, and 10 respectively.
35 # Let's canonicalize the msys_nt-XX.X system name by stripping version off.
39 if not host_target_map.has_key(host):
40 print "\nError: Current system (%s) isn't supported\n" % host
43 ######################################################################
44 # Get build options (the optins from command line)
45 ######################################################################
46 target_os = ARGUMENTS.get('TARGET_OS', host).lower() # target os
48 if target_os not in host_target_map[host]:
49 print "\nError: Unknown target os: %s (Allow values: %s)\n" % (target_os, host_target_map[host])
52 if target_os == 'android':
55 default_arch = platform.machine()
56 if target_os == 'windows':
57 default_arch = default_arch.lower()
59 target_arch = ARGUMENTS.get('TARGET_ARCH', default_arch) # target arch
61 # True if binary needs to be installed on board. (Might need root permissions)
62 # set to 'no', 'false' or 0 for only compilation
63 require_upload = ARGUMENTS.get('UPLOAD', False)
65 # Get the device name. This name can be used as network display name wherever possible
66 device_name = ARGUMENTS.get('DEVICE_NAME', "OIC-DEVICE")
68 default_with_upstream_libcoap = 0
70 if ARGUMENTS.get('TEST'):
71 logging_default = False
74 if ARGUMENTS.get('RELEASE', True) in ['y', 'yes', 'true', 't', '1', 'on', 'all', True]:
76 logging_default = (release_mode == False)
78 # targets that do not support the DTLS build (SECURED=1 build option)
79 targets_without_dtls_support = ['arduino'];
80 if ARGUMENTS.get('SECURED') == '1' and target_os in targets_without_dtls_support:
81 print "\nError: DTLS not supported on target os: %s MUST build with SECURED=0\n" % (target_os)
84 ######################################################################
85 # Common build options (release, target os, target arch)
86 ######################################################################
87 targets_disallow_multitransport = ['arduino']
89 help_vars = Variables()
90 help_vars.Add(BoolVariable('VERBOSE', 'Show compilation', False))
91 help_vars.Add(BoolVariable('RELEASE', 'Build for release?', True)) # set to 'no', 'false' or 0 for debug
92 help_vars.Add(EnumVariable('TARGET_OS', 'Target platform', host, host_target_map[host]))
95 help_vars.Add(BoolVariable('WITH_RA', 'Build with Remote Access module', False))
96 help_vars.Add(BoolVariable('WITH_TCP', 'Build with TCP adapter', False))
97 help_vars.Add(BoolVariable('WITH_PROXY', 'Build with CoAP-HTTP Proxy', False))
98 help_vars.Add(ListVariable('WITH_MQ', 'Build with MQ publisher/broker', 'OFF', ['OFF', 'SUB', 'PUB', 'BROKER']))
99 help_vars.Add(BoolVariable('WITH_CLOUD', 'Build including AccountManager class and Cloud Client sample', False))
100 help_vars.Add(ListVariable('RD_MODE', 'Resource Directory build mode', 'CLIENT', ['CLIENT', 'SERVER']))
102 help_vars.Add(BoolVariable('SIMULATOR', 'Build with simulator module', False))
104 help_vars.Add(BoolVariable('WITH_RA_IBB', 'Build with Remote Access module(workssys)', False))
107 if target_os in targets_disallow_multitransport:
108 help_vars.Add(ListVariable('TARGET_TRANSPORT', 'Target transport', 'IP', ['BT', 'BLE', 'IP', 'NFC']))
110 help_vars.Add(ListVariable('TARGET_TRANSPORT', 'Target transport', 'ALL', ['ALL', 'BT', 'BLE', 'IP', 'NFC']))
112 help_vars.Add(EnumVariable('TARGET_ARCH', 'Target architecture', default_arch, os_arch_map[target_os]))
113 if target_os in targets_without_dtls_support:
114 help_vars.Add(EnumVariable('SECURED', 'Build with DTLS', '0', allowed_values=('0', '1')))
116 help_vars.Add(EnumVariable('SECURED', 'Build with DTLS', '1', allowed_values=('0', '1')))
117 help_vars.Add(EnumVariable('MULTIPLE_OWNER', 'Enable multiple owner', '0', allowed_values=('0', '1')))
118 help_vars.Add(EnumVariable('EXC_PROV_SUPPORT', 'Except OCPMAPI library(libocpmapi.so)', '0', allowed_values=('0', '1')))
119 help_vars.Add(EnumVariable('TEST', 'Run unit tests', '0', allowed_values=('0', '1')))
120 help_vars.Add(BoolVariable('LOGGING', 'Enable stack logging', logging_default))
121 help_vars.Add(BoolVariable('UPLOAD', 'Upload binary ? (For Arduino)', require_upload))
122 help_vars.Add(EnumVariable('ROUTING', 'Enable routing', 'EP', allowed_values=('GW', 'EP')))
123 help_vars.Add(EnumVariable('BUILD_SAMPLE', 'Build with sample', 'ON', allowed_values=('ON', 'OFF')))
124 help_vars.AddVariables(('DEVICE_NAME', 'Network display name for device (For Arduino)', device_name, None, None),)
125 help_vars.Add(PathVariable('ANDROID_NDK', 'Android NDK path', None, PathVariable.PathAccept))
126 help_vars.Add(PathVariable('ANDROID_HOME', 'Android SDK path', None, PathVariable.PathAccept))
127 help_vars.Add(PathVariable('ANDROID_GRADLE', 'Gradle binary file', None, PathVariable.PathIsFile))
128 help_vars.Add(EnumVariable('WITH_UPSTREAM_LIBCOAP', 'Use latest stable version of LibCoAP downloaded from github', default_with_upstream_libcoap, allowed_values=('0','1')))
130 if target_os == 'windows':
131 # For VS2013, MSVC_VERSION is '12.0'. For VS2015, MSVC_VERSION is '14.0'.
132 # Default value is None, meaning that SCons has to choose automatically a VS version.
133 help_vars.Add(EnumVariable('MSVC_VERSION', 'MSVC compiler version - Windows', None, allowed_values=('12.0', '14.0')))
135 help_vars.Add(BoolVariable('BUILD_JAVA', 'Build Java bindings', False))
136 help_vars.Add(PathVariable('JAVA_HOME', 'JDK directory', os.environ.get('JAVA_HOME'), PathVariable.PathAccept))
138 AddOption('--prefix',
144 help='installation prefix')
146 ######################################################################
147 # Platform(build target) specific options: SDK/NDK & toolchain
148 ######################################################################
149 targets_support_cc = ['linux', 'arduino', 'tizen']
151 if target_os in targets_support_cc:
152 # Set cross compile toolchain
153 help_vars.Add('TC_PREFIX', "Toolchain prefix (Generally only be required for cross-compiling)", os.environ.get('TC_PREFIX'))
154 help_vars.Add(PathVariable('TC_PATH',
155 'Toolchain path (Generally only be required for cross-compiling)',
156 os.environ.get('TC_PATH')))
158 if target_os in ['android', 'arduino']: # Android/Arduino always uses GNU compiler regardless of the host
159 env = Environment(variables = help_vars,
160 tools = ['gnulink', 'gcc', 'g++', 'ar', 'as', 'textfile']
163 env = Environment(variables = help_vars, tools = ['default', 'textfile'],
164 TARGET_ARCH = target_arch, TARGET_OS = target_os,
165 PREFIX = GetOption('prefix'),
166 LIB_INSTALL_DIR = ARGUMENTS.get('LIB_INSTALL_DIR') #for 64bit build
168 Help(help_vars.GenerateHelpText(env))
171 ************************************ Warning **********************************
172 * Environment variable TC_PREFIX/TC_PATH is set. It will change the default *
173 * toolchain, if it isn't what you expect you should unset it, otherwise it may*
174 * cause inexplicable errors. *
175 *******************************************************************************
177 if env.get('VERBOSE') == False:
178 env['CCCOMSTR'] = "Compiling $TARGET"
179 env['SHCCCOMSTR'] = "Compiling $TARGET"
180 env['CXXCOMSTR'] = "Compiling $TARGET"
181 env['SHCXXCOMSTR'] = "Compiling $TARGET"
182 env['LINKCOMSTR'] = "Linking $TARGET"
183 env['SHLINKCOMSTR'] = "Linking $TARGET"
184 env['ARCOMSTR'] = "Archiving $TARGET"
185 env['RANLIBCOMSTR'] = "Indexing Archive $TARGET"
187 if target_os in targets_support_cc:
188 prefix = env.get('TC_PREFIX')
189 tc_path = env.get('TC_PATH')
191 env.Replace(CC = prefix + env.get('CC', 'gcc'))
192 env.Replace(CXX = prefix + env.get('CXX', 'g++'))
193 env.Replace(AR = prefix + env.get('AR', 'ar'))
194 env.Replace(AS = prefix + env.get('AS', 'as'))
195 env.Replace(RANLIB = prefix + env.get('RANLIB', 'ranlib'))
198 env.PrependENVPath('PATH', tc_path)
199 sys_root = os.path.abspath(tc_path + '/../')
200 env.AppendUnique(CCFLAGS = ['--sysroot=' + sys_root])
201 env.AppendUnique(LINKFLAGS = ['--sysroot=' + sys_root])
203 if prefix or tc_path:
206 # Import env variables only if reproductibility is ensured
207 if target_os in ['yocto']:
208 env['CONFIG_ENVIRONMENT_IMPORT'] = True
210 env['CONFIG_ENVIRONMENT_IMPORT'] = False
212 if env['CONFIG_ENVIRONMENT_IMPORT'] == True:
213 print "warning: importing some environment variables for OS: %s" % target_os
214 for ev in ['PATH', 'PKG_CONFIG', 'PKG_CONFIG_PATH', 'PKG_CONFIG_SYSROOT_DIR']:
215 if os.environ.get(ev) != None:
216 env['ENV'][ev] = os.environ.get(ev)
217 if os.environ['LDFLAGS'] != None:
218 env.AppendUnique(LINKFLAGS = Split(os.environ['LDFLAGS']))
220 # Ensure scons be able to change its working directory
221 env.SConscriptChdir(1)
223 # Set the source directory and build directory
224 # Source directory: 'dir'
225 # Build directory: 'dir'/out/<target_os>/<target_arch>/<release or debug>/
227 # You can get the directory as following:
229 # env.get('BUILD_DIR')
231 def __set_dir(env, dir):
232 if not os.path.exists(dir + '/SConstruct'):
234 *************************************** Error *********************************
235 * The directory(%s) seems isn't a source code directory, no SConstruct file is
237 *******************************************************************************
241 if env.get('RELEASE'):
242 build_dir = dir + '/out/' + target_os + '/' + target_arch + '/release/'
244 build_dir = dir + '/out/' + target_os + '/' + target_arch + '/debug/'
245 env.VariantDir(build_dir, dir, duplicate=0)
247 env.Replace(BUILD_DIR = build_dir)
248 env.Replace(SRC_DIR = dir)
250 def __src_to_obj(env, src, home = ''):
251 obj = env.get('BUILD_DIR') + src.replace(home, '')
252 if env.get('OBJSUFFIX'):
253 obj += env.get('OBJSUFFIX')
254 return env.Object(obj, src)
256 def __install(ienv, targets, name):
257 i_n = ienv.Install(env.get('BUILD_DIR'), targets)
259 env.AppendUnique(TS = [name])
261 def __installlib(ienv, targets, name):
262 user_prefix = env.get('PREFIX')
264 user_lib = env.get('LIB_INSTALL_DIR')
266 i_n = ienv.Install(user_lib, targets)
268 i_n = ienv.Install(user_prefix + '/lib', targets)
269 ienv.Alias("install", i_n)
271 i_n = ienv.Install(env.get('BUILD_DIR'), targets)
272 ienv.Alias("install", i_n)
274 def __installbin(ienv, targets, name):
275 user_prefix = env.get('PREFIX')
277 i_n = ienv.Install(user_prefix + '/bin', targets)
278 ienv.Alias("install", i_n)
280 def __installheader(ienv, targets, dir, name):
281 user_prefix = env.get('PREFIX')
283 i_n = ienv.Install(user_prefix + '/include/' + dir ,targets)
285 i_n = ienv.Install(os.path.join(env.get('BUILD_DIR'), 'include', dir), targets)
286 ienv.Alias("install", i_n)
288 def __installpcfile(ienv, targets, name):
289 user_prefix = env.get('PREFIX')
291 user_lib = env.get('LIB_INSTALL_DIR')
293 i_n = ienv.Install(user_lib + '/pkgconfig', targets)
295 i_n = ienv.Install(user_prefix + '/lib/pkgconfig', targets)
297 i_n = ienv.Install(env.get('BUILD_DIR') + 'lib/pkgconfig', targets)
298 ienv.Alias("install", i_n)
300 def __append_target(ienv, name, targets = None):
302 env.Alias(name, targets)
303 env.AppendUnique(TS = [name])
305 def __print_targets(env):
307 ===============================================================================
309 for t in env.get('TS'):
312 \nDefault all targets will be built. You can specify the target to build:
314 $ scons [options] [target]
315 ===============================================================================
318 env.AddMethod(__set_dir, 'SetDir')
319 env.AddMethod(__print_targets, 'PrintTargets')
320 env.AddMethod(__src_to_obj, 'SrcToObj')
321 env.AddMethod(__append_target, 'AppendTarget')
322 env.AddMethod(__install, 'InstallTarget')
323 env.AddMethod(__installlib, 'UserInstallTargetLib')
324 env.AddMethod(__installbin, 'UserInstallTargetBin')
325 env.AddMethod(__installheader, 'UserInstallTargetHeader')
326 env.AddMethod(__installpcfile, 'UserInstallTargetPCFile')
327 env.SetDir(env.GetLaunchDir())
328 env['ROOT_DIR']=env.GetLaunchDir()+'/..'
332 ######################################################################
333 # Scons to generate the iotivity.pc file from iotivity.pc.in file
334 ######################################################################
335 pc_file = env.get('SRC_DIR') + '/iotivity.pc.in'
337 user_prefix = env.get('PREFIX')
338 user_lib = env.get('LIB_INSTALL_DIR')
341 user_prefix = env.get('BUILD_DIR').encode('string_escape')
344 user_lib = '$${prefix}/lib'
347 if env.get('LOGGING'):
348 defines.append('-DTB_LOG=1')
350 if env.get('ROUTING') == 'GW':
351 defines.append('-DROUTING_GATEWAY=1')
352 elif env.get('ROUTING') == 'EP':
353 defines.append('-DROUTING_EP=1')
356 if env.get('WITH_TCP'):
357 defines.append('-DTCP_ADAPTER=1')
358 if env.get('SECURED') == '1':
359 defines.append('-D__WITH_TLS__=1')
361 if env.get('SECURED') == '1':
362 defines.append('-D__WITH_DTLS__=1')
363 if env.get('EXC_PROV_SUPPORT') == '0':
364 libs.append('-locpmapi')
367 '\@VERSION\@': project_version,
368 '\@PREFIX\@': user_prefix,
369 '\@EXEC_PREFIX\@': user_prefix,
370 '\@LIB_INSTALL_DIR\@': user_lib,
371 '\@DEFINES\@': " ".join(defines),
372 '\@LIBS\@': " ".join(libs)
375 env.Substfile(pc_file, SUBST_DICT = pc_vars)
377 ######################################################################
378 # Setting global CPPDEFINES
379 ######################################################################
380 target_transport = env.get('TARGET_TRANSPORT')
381 with_mq = env.get('WITH_MQ')
382 with_ra = env.get('WITH_RA')
383 with_tcp = env.get('WITH_TCP')
384 rd_mode = env.get('RD_MODE')
385 with_ra_ibb = env.get('WITH_RA_IBB')
387 if (env.get('WITH_UPSTREAM_LIBCOAP') == '1'):
388 env.AppendUnique(CPPDEFINES = ['WITH_UPSTREAM_LIBCOAP'])
390 if (target_os not in ['arduino', 'windows']):
391 env.AppendUnique(CPPDEFINES = ['WITH_POSIX'])
393 if (target_os in ['darwin','ios']):
394 env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
396 if (env.get('SECURED') == '1'):
397 env.AppendUnique(CPPDEFINES = ['__WITH_DTLS__'])
399 if ((env.get('SECURED') == '1') and with_tcp):
400 env.AppendUnique(CPPDEFINES = ['__WITH_TLS__'])
402 if (env.get('MULTIPLE_OWNER') == '1'):
403 env.AppendUnique(CPPDEFINES=['MULTIPLE_OWNER'])
405 if (env.get('ROUTING') == 'GW'):
406 env.AppendUnique(CPPDEFINES = ['ROUTING_GATEWAY'])
407 elif (env.get('ROUTING') == 'EP'):
408 env.AppendUnique(CPPDEFINES = ['ROUTING_EP'])
410 if (target_os == 'arduino'):
411 env.AppendUnique(CPPDEFINES = ['SINGLE_THREAD'])
412 env.AppendUnique(CPPDEFINES = ['WITH_ARDUINO'])
413 elif (('IP' in target_transport) or ('ALL' in target_transport)):
414 env.AppendUnique(CPPDEFINES = ['WITH_BWT'])
416 if (target_os in ['linux', 'tizen', 'android'] and with_tcp):
417 env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
419 if (target_os in ['linux', 'tizen', 'android', 'arduino', 'ios']):
420 if (('BLE' in target_transport) or ('BT' in target_transport) or ('ALL' in target_transport)):
421 env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
423 if 'ALL' in target_transport:
425 env.AppendUnique(CPPDEFINES = ['RA_ADAPTER'])
427 env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER'])
428 if (target_os in ['linux']):
429 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER', 'NO_EDR_ADAPTER', 'LE_ADAPTER'])
430 elif (target_os == 'android'):
431 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER', 'EDR_ADAPTER', 'LE_ADAPTER', 'NFC_ADAPTER'])
432 elif (target_os in['darwin', 'ios', 'msys_nt', 'windows']):
433 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER', 'NO_EDR_ADAPTER', 'NO_LE_ADAPTER'])
435 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER', 'EDR_ADAPTER', 'LE_ADAPTER'])
437 if ('BT' in target_transport):
438 if (target_os == 'linux'):
439 print "CA Transport BT is not supported "
442 env.AppendUnique(CPPDEFINES = ['EDR_ADAPTER'])
444 env.AppendUnique(CPPDEFINES = ['NO_EDR_ADAPTER'])
446 if ('BLE' in target_transport):
447 env.AppendUnique(CPPDEFINES = ['LE_ADAPTER'])
449 env.AppendUnique(CPPDEFINES = ['NO_LE_ADAPTER'])
451 if ('IP' in target_transport):
452 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER'])
454 env.AppendUnique(CPPDEFINES = ['NO_IP_ADAPTER'])
457 if (target_os in ['linux', 'tizen', 'android', 'arduino', 'ios', 'windows']):
458 env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER', 'WITH_TCP'])
460 print "CA Transport TCP is not supported "
463 env.AppendUnique(CPPDEFINES = ['NO_TCP_ADAPTER'])
465 if ('NFC' in target_transport):
466 if (target_os == 'android'):
467 env.AppendUnique(CPPDEFINES = ['NFC_ADAPTER'])
469 print "CA Transport NFC is not supported "
472 env.AppendUnique(CPPDEFINES = ['NO_NFC_ADAPTER'])
474 if ('SUB' in with_mq):
475 env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER', 'WITH_MQ'])
477 if ('PUB' in with_mq):
478 env.AppendUnique(CPPDEFINES = ['MQ_PUBLISHER', 'WITH_MQ'])
480 if ('BROKER' in with_mq):
481 env.AppendUnique(CPPDEFINES = ['MQ_BROKER', 'WITH_MQ'])
483 if env.get('LOGGING'):
484 env.AppendUnique(CPPDEFINES = ['TB_LOG'])
486 if env.get('WITH_CLOUD') and with_tcp:
487 env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
489 if 'CLIENT' in rd_mode:
490 env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
492 if 'SERVER' in rd_mode:
493 env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
496 env.AppendUnique(CPPDEFINES = ['RA_ADAPTER_IBB'])
497 ######################################################################
498 # Link scons to Yocto cross-toolchain ONLY when target_os is yocto
499 ######################################################################
500 if target_os == "yocto":
502 This code injects Yocto cross-compilation tools+flags into scons'
503 build environment in order to invoke the relevant tools while
508 CC = os.environ['CC']
509 target_prefix = CC.split()[0]
510 target_prefix = target_prefix[:len(target_prefix)-3]
511 tools = {"CC" : target_prefix+"gcc",
512 "CXX" : target_prefix+"g++",
513 "AS" : target_prefix+"as",
514 "LD" : target_prefix+"ld",
515 "GDB" : target_prefix+"gdb",
516 "STRIP" : target_prefix+"strip",
517 "RANLIB" : target_prefix+"ranlib",
518 "OBJCOPY" : target_prefix+"objcopy",
519 "OBJDUMP" : target_prefix+"objdump",
520 "AR" : target_prefix+"ar",
521 "NM" : target_prefix+"nm",
523 "STRINGS": target_prefix+"strings"}
524 PATH = os.environ['PATH'].split(os.pathsep)
526 if tool in os.environ:
528 if os.path.isfile(os.path.join(path, tools[tool])):
529 env[tool] = os.path.join(path, os.environ[tool])
531 env['CROSS_COMPILE'] = target_prefix[:len(target_prefix) - 1]
533 print "ERROR in Yocto cross-toolchain environment"
536 Now reset TARGET_OS to linux so that all linux specific build configurations
537 hereupon apply for the entirety of the build process.
539 env['TARGET_OS'] = 'linux'
541 We want to preserve debug symbols to allow BitBake to generate both DEBUG and
542 RELEASE packages for OIC.
544 env.AppendUnique(CCFLAGS = ['-g'])
546 Additional flags to pass to the Yocto toolchain.
548 if env.get('RELEASE'):
549 env.AppendUnique(CPPDEFINES = ['NDEBUG'])
550 env.AppendUnique(CPPDEFINES = ['__linux__', '_GNU_SOURCE'])
551 env.AppendUnique(CFLAGS = ['-std=gnu99'])
552 env.AppendUnique(CCFLAGS = ['-Wall', '-Wextra', '-fPIC'])
553 env.AppendUnique(LIBS = ['dl', 'pthread', 'uuid'])
557 If target_os is not Yocto, continue with the regular build process
559 # Load config of target os
560 env.SConscript(target_os + '/SConscript')
562 # Delete the temp files of configuration
563 if env.GetOption('clean'):
564 dir = env.get('SRC_DIR')
566 if os.path.exists(dir + '/config.log'):
567 Execute(Delete(dir + '/config.log'))
568 if os.path.exists(dir + '/.sconsign.dblite'):
569 Execute(Delete(dir + '/.sconsign.dblite'))
570 if os.path.exists(dir + '/.sconf_temp'):
571 Execute(Delete(dir + '/.sconf_temp'))
573 ######################################################################
574 # Check for PThreads support
575 ######################################################################
576 import iotivityconfig
577 from iotivityconfig import *
579 conf = Configure(env,
582 'CheckPThreadsSupport' : iotivityconfig.check_pthreads
585 # Identify whether we have pthreads support, which is necessary for
586 # threading and mutexes. This will set the environment variable
587 # POSIX_SUPPORTED, 1 if it is supported, 0 otherwise
588 conf.CheckPThreadsSupport()
591 ######################################################################
593 env.SConscript('external_libs.scons')