# Map of host os and allowed target os (host: allowed target os)
host_target_map = {
'linux': ['linux', 'android', 'arduino', 'yocto', 'tizen'],
- 'windows': ['windows', 'winrt', 'android', 'arduino'],
+ 'windows': ['windows', 'android', 'arduino'],
'darwin': ['darwin', 'ios', 'android', 'arduino'],
}
'tizen': ['x86', 'x86_64', 'arm', 'arm64'],
'android': ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'arm64-v8a'],
'windows': ['x86', 'amd64', 'arm'],
- 'winrt': ['arm'],
'darwin': ['i386', 'x86_64'],
'ios': ['i386', 'x86_64', 'armv7', 'armv7s', 'arm64'],
'arduino': ['avr', 'arm'],
- 'yocto': ['i586', 'x86_64', 'arm', 'powerpc', 'powerpc64', 'mips', 'mipsel'],
+ 'yocto': ['i586', 'i686', 'x86_64', 'arm', 'aarch64', 'powerpc', 'powerpc64', 'mips', 'mipsel'],
}
host = platform.system().lower()
help_vars.Add(EnumVariable('TARGET_ARCH', 'Target architecture', default_arch, os_arch_map[target_os]))
help_vars.Add(EnumVariable('SECURED', 'Build with DTLS', '0', allowed_values=('0', '1')))
help_vars.Add(BoolVariable('UPLOAD', 'Upload binary ? (For Arduino)', require_upload))
+help_vars.Add(EnumVariable('ROUTING', 'Enable routing', 'EP', allowed_values=('GW', 'EP')))
help_vars.Add(EnumVariable('BUILD_SAMPLE', 'Build with sample', 'ON', allowed_values=('ON', 'OFF')))
+help_vars.Add(BoolVariable('WITH_TCP', 'Enable TCP', False))
+help_vars.Add(BoolVariable('DISABLE_TCP_SERVER', 'Disable TCP server', False))
+help_vars.Add(BoolVariable('DISABLE_BLE_SERVER', 'Disable BLE server', False))
+help_vars.Add(ListVariable('WITH_MQ', 'Build with MQ publisher/subscriber/broker', 'OFF', ['OFF', 'SUB', 'PUB', 'BROKER']))
help_vars.AddVariables(('DEVICE_NAME', 'Network display name for device', 'OIC-DEVICE', None, None),)
Exit(1)
if env.get('RELEASE'):
- build_dir = dir + '/out/' + target_os + '/' + target_arch + '/release/'
+ build_dir = os.path.join(dir, 'out', target_os, target_arch, 'release') + os.sep
else:
- build_dir = dir + '/out/' + target_os + '/' + target_arch + '/debug/'
+ build_dir = os.path.join(dir, 'out', target_os, target_arch, 'debug') + os.sep
env.VariantDir(build_dir, dir, duplicate=0)
env.Replace(BUILD_DIR = build_dir)
def __installlib(ienv, targets, name):
user_prefix = env.get('PREFIX')
if user_prefix:
- i_n = ienv.Install(user_prefix + '/lib', targets)
+ install_lib_dir = os.path.join(user_prefix, 'lib')
else:
- i_n = ienv.Install(env.get('BUILD_DIR'), targets)
+ install_lib_dir = os.path.join(env.get('BUILD_DIR'), 'lib')
+ i_n = ienv.Install(install_lib_dir, targets)
ienv.Alias("install", i_n)
def __installbin(ienv, targets, name):
user_prefix = env.get('PREFIX')
if user_prefix:
i_n = ienv.Install(user_prefix + '/bin', targets)
- else:
- i_n = ienv.Install(env.get('BUILD_DIR'), targets)
- ienv.Alias("install", i_n)
+ ienv.Alias("install", i_n)
def __append_target(ienv, target):
env.AppendUnique(TS = [target])
env.AppendUnique(CPPDEFINES = ['WITH_POSIX', '__linux__', '_GNU_SOURCE'])
env.AppendUnique(CFLAGS = ['-std=gnu99'])
env.AppendUnique(CCFLAGS = ['-Wall', '-fPIC'])
- env.AppendUnique(LINKFLAGS = ['-ldl', '-lpthread'])
+ if target_os in ['linux']:
+ env.AppendUnique(LIBS = ['dl', 'pthread'])
Export('env')
else:
'''