Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | python 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 | |
| 13 | EXTRASITECONFIG ?= "" |
| 14 | |
| 15 | siteconfig_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 | |
| 31 | do_populate_sysroot[sstate-interceptfuncs] += "do_siteconfig " |
| 32 | |
| 33 | EXPORT_FUNCTIONS do_siteconfig do_siteconfig_gencache |