diff options
| author | Ken Raeburn <raeburn@mit.edu> | 2006-04-25 02:36:31 +0000 |
|---|---|---|
| committer | Ken Raeburn <raeburn@mit.edu> | 2006-04-25 02:36:31 +0000 |
| commit | 6739f1082f7cd81bcb913f2a33c75ae4fe6517c3 (patch) | |
| tree | b58a644dae26a875cb07d69e581275a0510c041f /src/util | |
| parent | a6a142604bb42e3cbd3504de17c581d39ef35f9a (diff) | |
Tweak configure script generation to check that all symbols produced
via AC_DEFINE are also present in the applicable configure-generated
header file, and error out otherwise. Currently doesn't apply in appl
and test trees.
* util/check-ac-syms: New script.
* config/post.in (.acsyms_okay): New target; runs check-ac-syms, unless we're
in the appl or tests trees.
(configure): Depend on .acsyms_okay.
* config/pre.in (AUTOCONF_HEADER): New variable.
* plugins/kdb/db2/libdb2/Makefile.in (AUTOCONF_HEADER): New variable.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17955 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util')
| -rwxr-xr-x | src/util/check-ac-syms | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/util/check-ac-syms b/src/util/check-ac-syms new file mode 100755 index 0000000000..a54a990425 --- /dev/null +++ b/src/util/check-ac-syms @@ -0,0 +1,33 @@ +#!/bin/sh + +# args: srcdir srctop-from-srcdir header-path + +d=`pwd` +head -1 $1/configure.in > config-in.tmp +echo "AC_CONFIG_HEADER(fooconfig.h:$d/fooconfig-h.tmp)" >> config-in.tmp +tail +2 $1/configure.in | grep -v AC_CONFIG_HEADER >> config-in.tmp +mv -f config-in.tmp config-in.ac~ + +if (cd $1 && autoheader --include=$2 $d/config-in.ac~) > /dev/null; then + rm -rf $1/autom4te.cache config-in.ac~ +else + rm -rf $1/autom4te.cache +# config-in.ac~ fooconfig-h.tmp + echo autoheader failed, eek + exit 1 +fi + +awk '/^#undef/ { print $2; }' < fooconfig-h.tmp | sort > acsyms.here +rm -f fooconfig-h.tmp +awk '/^#undef/ { print $2; }' < $3 | sort > acsyms.there + +comm -23 acsyms.here acsyms.there > acsyms.extra +rm -f acsyms.here acsyms.there + +if test -s acsyms.extra; then + echo ERROR: Symbol or symbols defined here but not in `basename $3`: `cat acsyms.extra` + rm -f acsyms.extra + exit 1 +fi +rm -f acsyms.extra +exit 0 |
