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:26:08 -0700 |
| commit | c6b808413d5ff1dbfdc4d615917345503029a282 (patch) | |
| tree | 8aea6f97547e1e2c5e62ae79b1b666e4224426f1 /meta | |
| parent | 4c2baa237f925543ae5c87009ca74d75529e51a6 (diff) | |
| download | poky-c6b808413d5ff1dbfdc4d615917345503029a282.tar.gz | |
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.
(From OE-Core rev: 9e87f1347788beed181476dc4563085db14a4729)
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -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 () { | |||
| 118 | bb.fatal("Please add your architecture to siteinfo.bbclass") | 118 | bb.fatal("Please add your architecture to siteinfo.bbclass") |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | def siteinfo_get_files(d): | 121 | def siteinfo_get_files(d, no_cache = False): |
| 122 | sitedata = siteinfo_data(d) | 122 | sitedata = siteinfo_data(d) |
| 123 | sitefiles = "" | 123 | sitefiles = "" |
| 124 | for path in d.getVar("BBPATH", True).split(":"): | 124 | for path in d.getVar("BBPATH", True).split(":"): |
| @@ -127,6 +127,8 @@ def siteinfo_get_files(d): | |||
| 127 | if os.path.exists(filename): | 127 | if os.path.exists(filename): |
| 128 | sitefiles += filename + " " | 128 | sitefiles += filename + " " |
| 129 | 129 | ||
| 130 | if no_cache: return sitefiles | ||
| 131 | |||
| 130 | # Now check for siteconfig cache files | 132 | # Now check for siteconfig cache files |
| 131 | path_siteconfig = bb.data.getVar('SITECONFIG_SYSROOTCACHE', d, 1) | 133 | path_siteconfig = bb.data.getVar('SITECONFIG_SYSROOTCACHE', d, 1) |
| 132 | if os.path.isdir(path_siteconfig): | 134 | 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 () { | |||
| 101 | echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script | 101 | echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | #we get the cached site config in the runtime | ||
| 105 | TOOLCHAIN_CONFIGSITE_NOCACHE := "${@siteinfo_get_files(d, True)}" | ||
| 106 | TOOLCHAIN_CONFIGSITE_SYSROOTCACHE := "${STAGING_DATADIR}/${TARGET_SYS}_config_site.d" | ||
| 107 | TOOLCHAIN_NEED_CONFIGSITE_CACHE = "eglibc ncurses" | ||
| 108 | |||
| 104 | #This function create a site config file | 109 | #This function create a site config file |
| 105 | toolchain_create_sdk_siteconfig () { | 110 | toolchain_create_sdk_siteconfig () { |
| 106 | local siteconfig=$1 | 111 | local siteconfig=$1 |
| 107 | shift | ||
| 108 | local files=$@ | ||
| 109 | 112 | ||
| 110 | rm -f $siteconfig | 113 | rm -f $siteconfig |
| 111 | touch $siteconfig | 114 | touch $siteconfig |
| 112 | for sitefile in ${files} ; do | 115 | |
| 116 | for sitefile in ${TOOLCHAIN_CONFIGSITE_NOCACHE} ; do | ||
| 113 | cat $sitefile >> $siteconfig | 117 | cat $sitefile >> $siteconfig |
| 114 | done | 118 | done |
| 119 | |||
| 120 | #get cached site config | ||
| 121 | for sitefile in ${TOOLCHAIN_NEED_CONFIGSITE_CACHE}; do | ||
| 122 | if [ -r ${TOOLCHAIN_CONFIGSITE_SYSROOTCACHE}/${sitefile}_config ]; then | ||
| 123 | cat ${TOOLCHAIN_CONFIGSITE_SYSROOTCACHE}/${sitefile}_config >> $siteconfig | ||
| 124 | fi | ||
| 125 | done | ||
| 115 | } | 126 | } |
| 116 | 127 | ||
| 117 | #This function create a version information file | 128 | #This function create a version information file |
| @@ -124,3 +135,10 @@ toolchain_create_sdk_version () { | |||
| 124 | echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile | 135 | echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile |
| 125 | echo 'Timestamp: ${DATETIME}' >> $versionfile | 136 | echo 'Timestamp: ${DATETIME}' >> $versionfile |
| 126 | } | 137 | } |
| 138 | |||
| 139 | python __anonymous () { | ||
| 140 | deps = bb.data.getVarFlag('do_configure', 'depends', d) or "" | ||
| 141 | for dep in (bb.data.getVar('TOOLCHAIN_NEED_CONFIGSITE_CACHE', d, True) or "").split(): | ||
| 142 | deps += " %s:do_populate_sysroot" % dep | ||
| 143 | bb.data.setVarFlag('do_configure', 'depends', deps, d) | ||
| 144 | } | ||
