blob: 0cfa5a683427ed027de83690f9b429df7d503f9e [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001python siteconfig_do_siteconfig () {
Brad Bishopa5c52ff2018-11-23 10:55:50 +13002 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'), 'site_config')):
6 bb.debug(1, "No site_config directory, skipping do_siteconfig")
7 return
8 sstate_install(shared_state, d)
9 bb.build.exec_func('do_siteconfig_gencache', d)
10 sstate_clean(shared_state, d)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011}
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 ${BPN}_cache
22 CONFIG_SITE="" ${EXTRASITECONFIG} ./configure ${CONFIGUREOPTS} --cache-file ${BPN}_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 < ${BPN}_cache > ${BPN}_config
26 mkdir -p ${SYSROOT_DESTDIR}${datadir}/${TARGET_SYS}_config_site.d
27 cp ${BPN}_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