Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 1 | # |
| 2 | # Copyright OpenEmbedded Contributors |
| 3 | # |
| 4 | # SPDX-License-Identifier: MIT |
| 5 | # |
| 6 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 7 | python siteconfig_do_siteconfig () { |
Brad Bishop | a5c52ff | 2018-11-23 10:55:50 +1300 | [diff] [blame] | 8 | 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 17 | } |
| 18 | |
| 19 | EXTRASITECONFIG ?= "" |
| 20 | |
| 21 | siteconfig_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 | |
| 37 | do_populate_sysroot[sstate-interceptfuncs] += "do_siteconfig " |
| 38 | |
| 39 | EXPORT_FUNCTIONS do_siteconfig do_siteconfig_gencache |