build: Add automatic compare of config.h files to recursive waf build
authorAndrew Bartlett <abartlet@samba.org>
Thu, 31 May 2012 23:48:20 +0000 (09:48 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 1 Jun 2012 01:04:27 +0000 (03:04 +0200)
This uses the fact that we have both build systems running at the same time.

The krb5 checks are skipped because we typically are comparing internal Heimdal
with the system krb5, so they do not make sense.

The required checks for krb5 are pretty well understood in any case, as
we have a limited set of supported libraries.

Andrew Bartlett

buildtools/compare_config_h3-exceptions.grep [new file with mode: 0644]
buildtools/compare_config_h3.sh
source3/Makefile-smbtorture4

diff --git a/buildtools/compare_config_h3-exceptions.grep b/buildtools/compare_config_h3-exceptions.grep
new file mode 100644 (file)
index 0000000..aa8851f
--- /dev/null
@@ -0,0 +1,10 @@
+^.define HAVE_.*KRB5
+^.define HAVE_.*KEYTAB
+^.define HAVE__ET_LIST
+^.define HAVE_LIBK5CRYPTO
+^.define HAVE_GSS
+^.define static
+^.define STATIC
+^.define PACKAGE
+^.define STRING_STATIC_MODULES
+^.define perfcount_test_init
index 294af30930dc40ccb9b7ec3926a88569199a6fe7..a56dd2a147db9636c21ddd9f057c895d0adb3c35 100755 (executable)
@@ -3,17 +3,25 @@
 # compare the generated config.h from a waf build with existing samba
 # build
 
-OLD_CONFIG=$HOME/samba_old/source3/include/config.h
+OLD_CONFIG=source3/include/autoconf/config.h
 if test "x$1" != "x" ; then
        OLD_CONFIG=$1
 fi
 
+NEW_CONFIG=bin/default/include/config.h
+if test "x$2" != "x" ; then
+       NEW_CONFIG=$2
+fi
+
+EXCEPTIONS=`dirname $0`/compare_config_h3-exceptions.grep
+
 if test "x$DIFF" = "x" ; then
        DIFF="comm -23"
 fi
 
-grep "^.define" bin/default/source3/include/config.h | sort > waf-config.h
-grep "^.define" $OLD_CONFIG | sort > old-config.h
+grep "^.define" $NEW_CONFIG | grep -v -f $EXCEPTIONS | sort > waf-config.h
+grep "^.define" $OLD_CONFIG | grep -v -f $EXCEPTIONS | sort > old-config.h
 
 $DIFF old-config.h waf-config.h
+rm -f old-config.h waf-config.h
 
index c2fe87a2973f3698a1dcc1806dceab945708ad5b..bd1764b4860fe900b0258f80542ebbea5ed5e696 100644 (file)
@@ -10,7 +10,7 @@ samba4-configure:
 
 .PHONY: samba4-configure
 
-bin/smbtorture4: $(BINARY_PREREQS) samba4-configure
+bin/smbtorture4: $(BINARY_PREREQS) samba4-configure samba4-config-compare
        cd .. && $(WAF_BUILD) --targets=smbtorture
        cp ../bin/smbtorture bin/smbtorture4
 
@@ -21,3 +21,8 @@ bin/ndrdump4: $(BINARY_PREREQS) samba4-configure
        cp ../bin/ndrdump bin/ndrdump4
 
 .PHONY: bin/ndrdump4
+
+samba4-config-compare: samba4-configure
+       @echo "Comparing config.h from autoconf and waf"
+       @echo "Configure checks missing from WAF are:"
+       ../buildtools/compare_config_h3.sh include/autoconf/config.h ../bin/default/include/config.h