help_vars.Add(BoolVariable('RELEASE', 'Build for release?', True)) # set to 'no', 'false' or 0 for debug
help_vars.Add(EnumVariable('TARGET_OS', 'Target platform', host, host_target_map[host]))
+
+help_vars.Add(BoolVariable('WITH_RA', 'Build with Remote Access module', False))
+
if target_os in targets_disallow_multitransport:
- help_vars.Add(ListVariable('TARGET_TRANSPORT', 'Target transport', 'IP', ['BT', 'BLE', 'IP']))
+ help_vars.Add(ListVariable('TARGET_TRANSPORT', 'Target transport', 'IP', ['BT', 'BLE', 'IP']))
else:
- help_vars.Add(ListVariable('TARGET_TRANSPORT', 'Target transport', 'ALL', ['ALL', 'BT', 'BLE', 'IP']))
+ help_vars.Add(ListVariable('TARGET_TRANSPORT', 'Target transport', 'ALL', ['ALL', 'BT', 'BLE', 'IP']))
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('BUILD_SAMPLE', 'Build with sample', 'ON', allowed_values=('ON', 'OFF')))
help_vars.AddVariables(('DEVICE_NAME', 'Network display name for device (For Arduino)', device_name, None, None),)
+help_vars.Add(PathVariable('ANDROID_NDK', 'Android NDK path', None, PathVariable.PathAccept))
+help_vars.Add(PathVariable('ANDROID_HOME', 'Android SDK path', None, PathVariable.PathAccept))
+help_vars.Add(PathVariable('ANDROID_GRADLE', 'Gradle binary file', None, PathVariable.PathIsFile))
+
+AddOption('--prefix',
+ dest='prefix',
+ type='string',
+ nargs=1,
+ action='store',
+ metavar='DIR',
+ help='installation prefix')
######################################################################
# Platform(build target) specific options: SDK/NDK & toolchain
tools = ['gnulink', 'gcc', 'g++', 'ar', 'as']
)
else:
- env = Environment(variables = help_vars, TARGET_ARCH = target_arch, TARGET_OS = target_os)
+ env = Environment(variables = help_vars, TARGET_ARCH = target_arch, TARGET_OS = target_os, PREFIX = GetOption('prefix'))
Help(help_vars.GenerateHelpText(env))
Alias(name, i_n)
env.AppendUnique(TS = [name])
+def __installlib(ienv, targets, name):
+ user_prefix = env.get('PREFIX')
+ if user_prefix:
+ i_n = ienv.Install(user_prefix + '/lib', targets)
+ else:
+ i_n = ienv.Install(env.get('BUILD_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)
+
def __append_target(ienv, name, targets = None):
if targets:
env.Alias(name, targets)
env.AddMethod(__src_to_obj, 'SrcToObj')
env.AddMethod(__append_target, 'AppendTarget')
env.AddMethod(__install, 'InstallTarget')
+env.AddMethod(__installlib, 'UserInstallTargetLib')
+env.AddMethod(__installbin, 'UserInstallTargetBin')
env.SetDir(env.GetLaunchDir())
env['ROOT_DIR']=env.GetLaunchDir()+'/..'
env.AppendUnique(CPPDEFINES = ['TB_LOG'])
env.AppendUnique(CPPDEFINES = ['WITH_POSIX', '__linux__', '_GNU_SOURCE'])
env.AppendUnique(CFLAGS = ['-std=gnu99'])
- env.AppendUnique(CCFLAGS = ['-Wall', '-fPIC'])
+ env.AppendUnique(CCFLAGS = ['-Wall', '-Wextra', '-fPIC'])
env.AppendUnique(LINKFLAGS = ['-ldl', '-lpthread'])
env.AppendUnique(LIBS = ['uuid'])
Export('env')