summaryrefslogtreecommitdiff
path: root/top/maint.mk
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2010-01-25 10:55:34 +0000
committerJim Meyering <meyering@redhat.com>2010-01-25 13:27:18 +0100
commit22970f8ac1f173d882139e4dccc7831871252f47 (patch)
treed9fb436bea4b0cf17a6e8bd50eb233134d30066d /top/maint.mk
parent6d28070c3cc7a02107bf66402983b9fe4c6f8f6f (diff)
downloadgnulib-22970f8ac1f173d882139e4dccc7831871252f47.tar.gz
syntax-check: detect incorrect boolean macro values in config.h
* modules/maintainer-makefile (configure.ac): Parameterize the location of config.h which will be available to makefiles as $(CONFIG_INCLUDE). The logic is from Eric Blake and the location indicated by Jim Meyering. Note the more natural CONFIG_HEADER name is prohibited by automake for backwards compatibility reasons. * top/maint.mk (sc_Wundef_boolean): New rule.
Diffstat (limited to 'top/maint.mk')
-rw-r--r--top/maint.mk8
1 files changed, 8 insertions, 0 deletions
diff --git a/top/maint.mk b/top/maint.mk
index 346d6813bd..d384ca62b2 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -718,6 +718,14 @@ sc_copyright_check:
exit 1; }; \
fi
+# #if HAVE_... will evaluate to false for any non numeric string.
+# That would be flagged by using -Wundef, however gnulib currently
+# tests many undefined macros, and so we can't enable that option.
+# So at least preclude common boolean strings as macro values.
+sc_Wundef_boolean:
+ @grep -Ei '^#define.*(yes|no|true|false)$$' '$(CONFIG_INCLUDE)' && \
+ { echo 'Use 0 or 1 for macro values' 1>&2; exit 1; } || :
+
vc-diff-check:
(unset CDPATH; cd $(srcdir) && $(VC) diff) > vc-diffs || :
if test -s vc-diffs; then \