binconfig-disabled.bbclass 949 B

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