[oe-commits] Lianhao Lu : toolchain-script.bbclass: Collected cached site config in runtime.

git version control git at git.openembedded.org
Thu Aug 25 02:28:07 UTC 2011


Module: openembedded-core.git
Branch: master
Commit: 9e87f1347788beed181476dc4563085db14a4729
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=9e87f1347788beed181476dc4563085db14a4729

Author: Lianhao Lu <lianhao.lu at intel.com>
Date:   Tue Aug 16 11:15:36 2011 +0800

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 at intel.com>

---

 meta/classes/siteinfo.bbclass          |    4 +++-
 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 a61b5e5..02294c4 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 b7e4e04..4a28e5f 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)
+}





More information about the Openembedded-commits mailing list