X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fconnectivity%2Fsamples%2Ftizen%2FSConscript;h=7013cf40911a4b739221ee74cafd892c5f4d63db;hb=8c01dff2c5bc5496f7dc1632c498943ec6ecb015;hp=be3619bcddb2ebdde343fba006062d9b423619ea;hpb=935fdb9b67b6c10d007e652e9e2e028fd6ccfe09;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/connectivity/samples/tizen/SConscript b/resource/csdk/connectivity/samples/tizen/SConscript index be3619b..7013cf4 100644 --- a/resource/csdk/connectivity/samples/tizen/SConscript +++ b/resource/csdk/connectivity/samples/tizen/SConscript @@ -56,6 +56,15 @@ help_vars.Add(ListVariable('TARGET_TRANSPORT', 'Target transport', 'ALL', ['ALL' 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'))) + +AddOption('--prefix', + dest='prefix', + type='string', + nargs=1, + action='store', + metavar='DIR', + help='installation prefix') + ###################################################################### # Platform(build target) specific options: SDK/NDK & toolchain ###################################################################### @@ -73,7 +82,7 @@ if target_os in ['android', 'arduino']: # Android/Arduino always uses GNU compil 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)) @@ -149,6 +158,22 @@ def __install(ienv, targets, name): def __append_target(ienv, target): env.AppendUnique(TS = [target]) +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 __print_targets(env): Help(''' =============================================================================== @@ -167,6 +192,8 @@ env.AddMethod(__print_targets, 'PrintTargets') 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()