summaryrefslogtreecommitdiffstats
path: root/meta/classes/siteconfig.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/siteconfig.bbclass')
-rw-r--r--meta/classes/siteconfig.bbclass33
1 files changed, 33 insertions, 0 deletions
diff --git a/meta/classes/siteconfig.bbclass b/meta/classes/siteconfig.bbclass
new file mode 100644
index 0000000..9a4d03b
--- /dev/null
+++ b/meta/classes/siteconfig.bbclass
@@ -0,0 +1,33 @@
1python siteconfig_do_siteconfig () {
2 shared_state = sstate_state_fromvars(d)
3 if shared_state['task'] != 'populate_sysroot':
4 return
5 if not os.path.isdir(os.path.join(d.getVar('FILE_DIRNAME', True), 'site_config')):
6 bb.debug(1, "No site_config directory, skipping do_siteconfig")
7 return
8 bb.build.exec_func('do_siteconfig_gencache', d)
9 sstate_clean(shared_state, d)
10 sstate_install(shared_state, d)
11}
12
13EXTRASITECONFIG ?= ""
14
15siteconfig_do_siteconfig_gencache () {
16 mkdir -p ${WORKDIR}/site_config_${MACHINE}
17 gen-site-config ${FILE_DIRNAME}/site_config \
18 >${WORKDIR}/site_config_${MACHINE}/configure.ac
19 cd ${WORKDIR}/site_config_${MACHINE}
20 autoconf
21 rm -f ${PN}_cache
22 CONFIG_SITE="" ${EXTRASITECONFIG} ./configure ${CONFIGUREOPTS} --cache-file ${PN}_cache
23 sed -n -e "/ac_cv_c_bigendian/p" -e "/ac_cv_sizeof_/p" \
24 -e "/ac_cv_type_/p" -e "/ac_cv_header_/p" -e "/ac_cv_func_/p" \
25 < ${PN}_cache > ${PN}_config
26 mkdir -p ${SYSROOT_DESTDIR}${datadir}/${TARGET_SYS}_config_site.d
27 cp ${PN}_config ${SYSROOT_DESTDIR}${datadir}/${TARGET_SYS}_config_site.d
28
29}
30
31do_populate_sysroot[sstate-interceptfuncs] += "do_siteconfig "
32
33EXPORT_FUNCTIONS do_siteconfig do_siteconfig_gencache