From: Ken Raeburn Date: Tue, 25 Apr 2006 02:36:31 +0000 (+0000) Subject: Tweak configure script generation to check that all symbols produced X-Git-Tag: krb5-1.5-alpha1~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6739f1082f7cd81bcb913f2a33c75ae4fe6517c3;p=thirdparty%2Fkrb5.git 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 --- diff --git a/src/config/post.in b/src/config/post.in index 237ceb3181..300f0fcf30 100644 --- a/src/config/post.in +++ b/src/config/post.in @@ -135,6 +135,7 @@ $(thisconfigdir)/config.status: $(srcdir)/$(thisconfigdir)/configure # mixing. So nuke it. $(srcdir)/$(thisconfigdir)/configure: @MAINT@ \ $(srcdir)/$(thisconfigdir)/configure.in \ + $(thisconfigdir)/.acsyms_okay \ $(SRCTOP)/patchlevel.h \ $(SRCTOP)/aclocal.m4 -$(RM) -r $(srcdir)/$(thisconfigdir)/autom4te.cache @@ -142,6 +143,17 @@ $(srcdir)/$(thisconfigdir)/configure: @MAINT@ \ $(AUTOCONF) --include=$(CONFIG_RELTOPDIR) $(AUTOCONFFLAGS) -$(RM) -r $(srcdir)/$(thisconfigdir)/autom4te.cache +$(thisconfigdir)/.acsyms_okay: @MAINT@ \ + $(srcdir)/$(thisconfigdir)/configure.in \ + $(SRCTOP)/patchlevel.h \ + $(SRCTOP)/aclocal.m4 + case "$(myfulldir)" in \ + "" ) echo myfulldir not set in makefile ; exit 1 ;; \ + appl* | tests* ) echo skipping ac syms check here ;; \ + *) $(SRCTOP)/util/check-ac-syms $(srcdir) $(BUILDTOP) $(AUTOCONF_HEADER) ;; \ + esac + touch .acsyms_okay + RECURSE_TARGETS=all-recurse clean-recurse distclean-recurse install-recurse \ generate-files-mac-recurse \ check-recurse depend-recurse Makefiles-recurse install-headers-recurse diff --git a/src/config/pre.in b/src/config/pre.in index bea1c7a86e..9391f64980 100644 --- a/src/config/pre.in +++ b/src/config/pre.in @@ -551,6 +551,9 @@ EXTRA_FILES=@EXTRA_FILES@ # variable settings with "@RUN_ENV@ KRB5_CONFIG=foo ..." MAYBE_VALGRIND= # valgrind --tool=memcheck --log-file=$(BUILDTOP)/valgrind.out --trace-children=yes -v --leak-check=yes env +# +AUTOCONF_HEADER=$(SRCTOP)/include/autoconf.h.in + ## ## end of pre.in ############################################################ diff --git a/src/plugins/kdb/db2/libdb2/Makefile.in b/src/plugins/kdb/db2/libdb2/Makefile.in index 5e53de4238..93fed6f3c0 100644 --- a/src/plugins/kdb/db2/libdb2/Makefile.in +++ b/src/plugins/kdb/db2/libdb2/Makefile.in @@ -15,6 +15,8 @@ RELDIR=../plugins/kdb/db2/libdb2 HDRDIR=$(BUILDTOP)/include HDRS = $(HDRDIR)/db.h $(HDRDIR)/db-config.h $(HDRDIR)/db-ndbm.h +AUTOCONF_HEADER=$(SRCTOP)/plugins/kdb/db2/libdb2/include/config.h.in + all-unix:: includes all-libs all-prerecurse: include/config.h include/db-config.h clean-unix:: clean-libs clean-includes 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