siteconfig.bbclass 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. siteconfig_do_siteconfig() {
  2. if [ ! -d ${FILE_DIRNAME}/site_config ]; then
  3. exit 0
  4. fi
  5. mkdir ${WORKDIR}/site_config
  6. gen-site-config ${FILE_DIRNAME}/site_config \
  7. >${WORKDIR}/site_config/configure.ac
  8. cd ${WORKDIR}/site_config
  9. autoconf
  10. CONFIG_SITE="" ./configure ${CONFIGUREOPTS} --cache-file ${PN}_cache
  11. sed -n -e "/ac_cv_c_bigendian/p" -e "/ac_cv_sizeof_/p" \
  12. -e "/ac_cv_type_/p" -e "/ac_cv_header_/p" -e "/ac_cv_func_/p" \
  13. < ${PN}_cache > ${PN}_config
  14. mkdir -p ${SYSROOT_DESTDIR}${STAGING_DATADIR}/${TARGET_SYS}_config_site.d
  15. cp ${PN}_config ${SYSROOT_DESTDIR}${STAGING_DATADIR}/${TARGET_SYS}_config_site.d
  16. }
  17. # Ugly integration with sstate_task_postfunc for now. The normal package
  18. # sysroot components must be installed in order to generate the cache, but
  19. # the site cache must be generated before the staging archive is generated.
  20. python sstate_task_postfunc () {
  21. shared_state = sstate_state_fromvars(d)
  22. sstate_install(shared_state, d)
  23. if shared_state['name'] == 'populate-sysroot':
  24. bb.build.exec_func('do_siteconfig', d)
  25. sstate_clean(shared_state, d)
  26. sstate_install(shared_state, d)
  27. sstate_package(shared_state, d)
  28. }
  29. EXPORT_FUNCTIONS do_siteconfig