blob: 953cafd285e3617770f2f2014965e4b7f676e419 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
Patrick Williamsc124f4f2015-09-15 14:41:29 -05007python siteconfig_do_siteconfig () {
Brad Bishopa5c52ff2018-11-23 10:55:50 +13008 shared_state = sstate_state_fromvars(d)
9 if shared_state['task'] != 'populate_sysroot':
10 return
11 if not os.path.isdir(os.path.join(d.getVar('FILE_DIRNAME'), 'site_config')):
12 bb.debug(1, "No site_config directory, skipping do_siteconfig")
13 return
14 sstate_install(shared_state, d)
15 bb.build.exec_func('do_siteconfig_gencache', d)
16 sstate_clean(shared_state, d)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017}
18
19EXTRASITECONFIG ?= ""
20
21siteconfig_do_siteconfig_gencache () {
22 mkdir -p ${WORKDIR}/site_config_${MACHINE}
23 gen-site-config ${FILE_DIRNAME}/site_config \
24 >${WORKDIR}/site_config_${MACHINE}/configure.ac
25 cd ${WORKDIR}/site_config_${MACHINE}
26 autoconf
27 rm -f ${BPN}_cache
28 CONFIG_SITE="" ${EXTRASITECONFIG} ./configure ${CONFIGUREOPTS} --cache-file ${BPN}_cache
29 sed -n -e "/ac_cv_c_bigendian/p" -e "/ac_cv_sizeof_/p" \
30 -e "/ac_cv_type_/p" -e "/ac_cv_header_/p" -e "/ac_cv_func_/p" \
31 < ${BPN}_cache > ${BPN}_config
32 mkdir -p ${SYSROOT_DESTDIR}${datadir}/${TARGET_SYS}_config_site.d
33 cp ${BPN}_config ${SYSROOT_DESTDIR}${datadir}/${TARGET_SYS}_config_site.d
34
35}
36
37do_populate_sysroot[sstate-interceptfuncs] += "do_siteconfig "
38
39EXPORT_FUNCTIONS do_siteconfig do_siteconfig_gencache