blob: e8ac41b2d40f1002baf1ae0ac07475b8903c7a50 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001#
2# Class to disable binconfig files instead of installing them
3#
4
5# The list of scripts which should be disabled.
6BINCONFIG ?= ""
7
Patrick Williams213cb262021-08-07 19:21:33 -05008FILES:${PN}-dev += "${bindir}/*-config"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05009
Patrick Williams213cb262021-08-07 19:21:33 -050010do_install:append () {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011 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
Brad Bishop6e60e8b2018-02-01 10:27:11 -050018 chmod +x ${D}$x
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019 done
20}
21
22SYSROOT_PREPROCESS_FUNCS += "binconfig_disabled_sysroot_preprocess"
23
24binconfig_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}