diff options
author | Lianhao Lu <lianhao.lu@intel.com> | 2011-08-16 11:15:36 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-08-24 19:25:33 -0700 |
commit | 9e87f1347788beed181476dc4563085db14a4729 (patch) | |
tree | ae4c8eaaa02a2fa2f465d82829e80beb7a99b9cc /meta/classes | |
parent | 19fb07bf337e1d724798e2eb4479c35fc45b1941 (diff) | |
download | openembedded-core-9e87f1347788beed181476dc4563085db14a4729.tar.gz openembedded-core-9e87f1347788beed181476dc4563085db14a4729.tar.bz2 openembedded-core-9e87f1347788beed181476dc4563085db14a4729.zip |
toolchain-script.bbclass: Collected cached site config in runtime.
[YOCTO #892]
Modify the function toolchain_create_sdk_siteconfig to collect the
cached site config files which are specified by
TOOLCHAIN_NEED_CONFIGSITE_CACHE in runtime.
Also added task dependency to ensure the cached site config files are
generated.
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/siteinfo.bbclass | 4 | ||||
-rw-r--r-- | meta/classes/toolchain-scripts.bbclass | 24 |
2 files changed, 24 insertions, 4 deletions
diff --git a/meta/classes/siteinfo.bbclass b/meta/classes/siteinfo.bbclass index a61b5e50cd..02294c4d2e 100644 --- a/meta/classes/siteinfo.bbclass +++ b/meta/classes/siteinfo.bbclass @@ -118,7 +118,7 @@ python () { bb.fatal("Please add your architecture to siteinfo.bbclass") } -def siteinfo_get_files(d): +def siteinfo_get_files(d, no_cache = False): sitedata = siteinfo_data(d) sitefiles = "" for path in d.getVar("BBPATH", True).split(":"): @@ -127,6 +127,8 @@ def siteinfo_get_files(d): if os.path.exists(filename): sitefiles += filename + " " + if no_cache: return sitefiles + # Now check for siteconfig cache files path_siteconfig = bb.data.getVar('SITECONFIG_SYSROOTCACHE', d, 1) if os.path.isdir(path_siteconfig): diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass index b7e4e04eaf..4a28e5fe38 100644 --- a/meta/classes/toolchain-scripts.bbclass +++ b/meta/classes/toolchain-scripts.bbclass @@ -101,17 +101,28 @@ toolchain_create_sdk_env_script_for_installer () { echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script } +#we get the cached site config in the runtime +TOOLCHAIN_CONFIGSITE_NOCACHE := "${@siteinfo_get_files(d, True)}" +TOOLCHAIN_CONFIGSITE_SYSROOTCACHE := "${STAGING_DATADIR}/${TARGET_SYS}_config_site.d" +TOOLCHAIN_NEED_CONFIGSITE_CACHE = "eglibc ncurses" + #This function create a site config file toolchain_create_sdk_siteconfig () { local siteconfig=$1 - shift - local files=$@ rm -f $siteconfig touch $siteconfig - for sitefile in ${files} ; do + + for sitefile in ${TOOLCHAIN_CONFIGSITE_NOCACHE} ; do cat $sitefile >> $siteconfig done + + #get cached site config + for sitefile in ${TOOLCHAIN_NEED_CONFIGSITE_CACHE}; do + if [ -r ${TOOLCHAIN_CONFIGSITE_SYSROOTCACHE}/${sitefile}_config ]; then + cat ${TOOLCHAIN_CONFIGSITE_SYSROOTCACHE}/${sitefile}_config >> $siteconfig + fi + done } #This function create a version information file @@ -124,3 +135,10 @@ toolchain_create_sdk_version () { echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile echo 'Timestamp: ${DATETIME}' >> $versionfile } + +python __anonymous () { + deps = bb.data.getVarFlag('do_configure', 'depends', d) or "" + for dep in (bb.data.getVar('TOOLCHAIN_NEED_CONFIGSITE_CACHE', d, True) or "").split(): + deps += " %s:do_populate_sysroot" % dep + bb.data.setVarFlag('do_configure', 'depends', deps, d) +} |