generic-poky/meta/classes/binconfig-disabled.bbclass
Ross Burton 22a653d028 binconfig-disabled: write an message to stderr to help confused developers
Often configure scripts or Makefiles that use the stub scripts written by
binconfig-disabled fail mysteriously with no obvious problem.  Attempt to solve
this by writing an error to stderr which hopefully makes it to the logs.

[ YOCTO #8169 ]

(From OE-Core rev: c38acd720b3f6ffbeb544063692eb471dada8593)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:43 +01:00

30 lines
855 B
Text

#
# Class to disable binconfig files instead of installing them
#
# The list of scripts which should be disabled.
BINCONFIG ?= ""
FILES_${PN}-dev += "${bindir}/*-config"
do_install_append () {
for x in ${BINCONFIG}; do
# Make the disabled script emit invalid parameters for those configure
# scripts which call it without checking the return code.
echo "#!/bin/sh" > ${D}$x
echo "echo 'ERROR: $x should not be used, use an alternative such as pkg-config' >&2" >> ${D}$x
echo "echo '--should-not-have-used-$x'" >> ${D}$x
echo "exit 1" >> ${D}$x
done
}
SYSROOT_PREPROCESS_FUNCS += "binconfig_disabled_sysroot_preprocess"
binconfig_disabled_sysroot_preprocess () {
for x in ${BINCONFIG}; do
configname=`basename $x`
install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
install ${D}$x ${SYSROOT_DESTDIR}${bindir_crossscripts}
done
}