4 # This script checks for HAVE_ and ENABLE_ macros which are
5 # not included in config.h.in
7 # Usage: checkconfig.sh <top_srcdir> <srcfile> [<srcfile> ...]
9 # Copyright (C) 2007 Matthias Koenig <mkoenig@suse.de>
10 # Copyright (C) 2008 Karel Zak <kzak@redhat.com>
20 config="$srcdir/config.h.in"
22 [ -d "$srcdir" ] || die "$srcdir: not such directory."
23 [ -f "$config" ] || die "$config: not such file."
31 [ ! -f "$srcfile" ] && continue;
33 # Note that we use HAVE_ macros since util-linux-ng-2.14. The
34 # previous version also have used ENABLE_ too.
36 # ENABLE_ and HAVE_ macros shouldn't be used for any other pupose that
37 # for config/build options.
39 DEFINES=$(sed -n -e 's/.*[ \t(]\+\(HAVE_[[:alnum:]]\+[^ \t);]*\).*/\1/p' \
40 -e 's/.*[ \t(]\+\(ENABLE_[[:alnum:]]\+[^ \t);]*\).*/\1/p' \
42 [ -z "$DEFINES" ] && continue
46 HAVE_CONFIG_H) continue
48 *) grep -q "$d\( \|\>\)" $config || \
49 echo $(echo $srcfile | sed 's:\\'$srcdir/'::') ": $d"