]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - tools/checkconfig.sh
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>
21 echo " $0 <top_srcdir> <srcfile> [<srcfile> ...]"
23 echo " find . -name '*.c' | xargs $0 \$(git rev-parse --show-toplevel)"
31 config
="$srcdir/config.h.in"
33 [ -d "$srcdir" ] || die
"$srcdir: not such directory."
34 [ -f "$config" ] || die
"$config: not such file."
38 while [ "$#" -ne 0 ]; do
42 [ ! -f "$srcfile" ] && continue;
44 # Note that we use HAVE_ macros since util-linux-ng-2.14. The
45 # previous version also have used ENABLE_ too.
47 # ENABLE_ and HAVE_ macros shouldn't be used for any other pupose that
48 # for config/build options.
50 DEFINES
=$
(sed -n -e 's/.*[ \t(]\+\(HAVE_[[:alnum:]]\+[^ \t);]*\).*/\1/p' \
51 -e 's/.*[ \t(]\+\(ENABLE_[[:alnum:]]\+[^ \t);]*\).*/\1/p' \
53 [ -z "$DEFINES" ] && continue
57 HAVE_CONFIG_H
) continue
59 *) grep -q "$d\( \|\>\)" $config || \
60 echo $
(echo $srcfile |
sed 's:\\'$srcdir/'::') ": $d"