import os
import platform
-print "Inside the Config SConscript"
+print("Inside the Config SConscript")
# Map of host os and allowed target os (host: allowed target os)
host_target_map = {
'linux': ['linux', 'android', 'arduino', 'yocto', 'tizen'],
host = platform.system().lower()
-if not host_target_map.has_key(host):
- print "\nError: Current system (%s) isn't supported\n" % host
+if host not in host_target_map:
+ print("\nError: Current system (%s) isn't supported\n" % host)
Exit(1)
######################################################################
target_os = ARGUMENTS.get('TARGET_OS', host).lower() # target os
if target_os not in host_target_map[host]:
- print "\nError: Unknown target os: %s (Allow values: %s)\n" % (target_os, host_target_map[host])
+ print("\nError: Unknown target os: %s (Allow values: %s)\n" % (target_os, host_target_map[host]))
Exit(1)
default_arch = platform.machine()
help_vars.Add(EnumVariable('SECURED', 'Build with DTLS', '0', allowed_values=('0', '1')))
help_vars.Add(EnumVariable('ROUTING', 'Enable routing', 'EP', allowed_values=('GW', 'EP')))
+AddOption('--prefix',
+ dest='prefix',
+ type='string',
+ nargs=1,
+ action='store',
+ metavar='DIR',
+ help='installation prefix')
######################################################################
# Platform(build target) specific options: SDK/NDK & toolchain
######################################################################
env.AppendUnique(LINKFLAGS = ['--sysroot=' + sys_root])
if prefix or tc_path:
- print tc_set_msg
+ print(tc_set_msg)
# Ensure scons be able to change its working directory
env.SConscriptChdir(1)
def __set_dir(env, dir):
if not os.path.exists(dir + '/SConstruct'):
- print '''
+ print('''
*************************************** Error *********************************
* The directory(%s) seems isn't a source code directory, no SConstruct file is
* found. *
*******************************************************************************
-''' % dir
+''' % dir)
Exit(1)
if env.get('RELEASE'):