if target_os in ['android', 'arduino']: # Android/Arduino always uses GNU compiler regardless of the host
env = Environment(variables = help_vars,
- tools = ['gnulink', 'gcc', 'g++', 'ar', 'as']
+ tools = ['gnulink', 'gcc', 'g++', 'ar', 'as', 'textfile']
)
else:
- env = Environment(variables = help_vars, TARGET_ARCH = target_arch, TARGET_OS = target_os, PREFIX = GetOption('prefix'))
+ env = Environment(variables = help_vars, tools = ['default', 'textfile'], TARGET_ARCH = target_arch, TARGET_OS = target_os, PREFIX = GetOption('prefix'))
Help(help_vars.GenerateHelpText(env))
i_n = ienv.Install(env.get('BUILD_DIR'), targets)
ienv.Alias("install", i_n)
+def __installpcfile(ienv, targets, name):
+ user_prefix = env.get('PREFIX')
+ if user_prefix:
+ i_n = ienv.Install(user_prefix + '/lib/pkgconfig', 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(__installlib, 'UserInstallTargetLib')
env.AddMethod(__installbin, 'UserInstallTargetBin')
env.AddMethod(__installheader, 'UserInstallTargetHeader')
+env.AddMethod(__installpcfile, 'UserInstallTargetPCFile')
env.SetDir(env.GetLaunchDir())
env['ROOT_DIR']=env.GetLaunchDir()+'/..'
Export('env')
######################################################################
+# Scons to generate the iotivity.pc file from iotivity.pc.in file
+######################################################################
+pc_file = env.get('SRC_DIR') + '/iotivity.pc.in'
+
+user_prefix = env.get('PREFIX')
+
+if user_prefix:
+ pc_vars = {'\@PREFIX\@': user_prefix, '\@EXEC_PREFIX\@':user_prefix, '\@VERSION\@':'0.9.2'}
+else:
+ pc_vars = {'\@PREFIX\@': env.get('BUILD_DIR'), '\@EXEC_PREFIX\@': env.get('BUILD_DIR'), '\@VERSION\@':'0.9.2'}
+
+env.Substfile(pc_file, SUBST_DICT = pc_vars)
+
+######################################################################
# Link scons to Yocto cross-toolchain ONLY when target_os is yocto
######################################################################
if target_os == "yocto":