-
-
Notifications
You must be signed in to change notification settings - Fork 318
Notes
Mats Wichmann edited this page Nov 7, 2019
·
3 revisions
Yocto build system is supporting scons using scons class to
But there is a (semi minor) issue with PATH variable, Yocto updates some variables to use sysroot, while Scons avoid to be polluted by env variables.
You could use this code snippet as one solution to export/import env between 2 worlds:
Add in your bitbake file :
inherit scons pkgconfig
EXTRA_OESCONS += " CONFIG_ENVIRONMENT_IMPORT=True "
To this SConscript
# Import env variables only if reproducibility is ensured
if target_os in ['yocto']:
env['CONFIG_ENVIRONMENT_IMPORT'] = True
else:
env['CONFIG_ENVIRONMENT_IMPORT'] = False
if env['CONFIG_ENVIRONMENT_IMPORT'] == True:
print "warning: importing some environment variables for OS: %s" % target_os
for ev in ['PATH', 'PKG_CONFIG', 'PKG_CONFIG_PATH', 'PKG_CONFIG_SYSROOT_DIR']:
if os.environ.get(ev) != None:
env['ENV'][ev] = os.environ.get(ev)
if os.environ['LDFLAGS'] != None:
env.AppendUnique(LINKFLAGS = Split(os.environ['LDFLAGS']))