binconfig-disabled.bbclass 916 B

12345678910111213141516171819202122232425262728293031323334
  1. #
  2. # Copyright OpenEmbedded Contributors
  3. #
  4. #
  5. # Class to disable binconfig files instead of installing them
  6. #
  7. # The list of scripts which should be disabled.
  8. BINCONFIG ?= ""
  9. FILES:${PN}-dev += "${bindir}/*-config"
  10. do_install:append () {
  11. for x in ${BINCONFIG}; do
  12. # Make the disabled script emit invalid parameters for those configure
  13. # scripts which call it without checking the return code.
  14. echo "#!/bin/sh" > ${D}$x
  15. echo "echo 'ERROR: $x should not be used, use an alternative such as pkg-config' >&2" >> ${D}$x
  16. echo "echo '--should-not-have-used-$x'" >> ${D}$x
  17. echo "exit 1" >> ${D}$x
  18. chmod +x ${D}$x
  19. done
  20. }
  21. SYSROOT_PREPROCESS_FUNCS += "binconfig_disabled_sysroot_preprocess"
  22. binconfig_disabled_sysroot_preprocess () {
  23. for x in ${BINCONFIG}; do
  24. configname=`basename $x`
  25. install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
  26. install ${D}$x ${SYSROOT_DESTDIR}${bindir_crossscripts}
  27. done
  28. }