summaryrefslogtreecommitdiff
path: root/maint.mk
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2009-04-28 15:54:35 +0200
committerSimon Josefsson <simon@josefsson.org>2009-04-28 15:54:35 +0200
commit872582914045517a505d36ecfa50910f47dfdc02 (patch)
treed821aedb796b2718d9eae7c6fe1a3c5b7f242254 /maint.mk
parentb46a2254323dde410bf18ff048c535082511f31f (diff)
downloadgnutls-872582914045517a505d36ecfa50910f47dfdc02.tar.gz
Update gnulib files.
Diffstat (limited to 'maint.mk')
-rw-r--r--maint.mk14
1 files changed, 9 insertions, 5 deletions
diff --git a/maint.mk b/maint.mk
index 229b0dc3a5..b7f68680ba 100644
--- a/maint.mk
+++ b/maint.mk
@@ -113,7 +113,7 @@ endef
sc_avoid_if_before_free:
@$(srcdir)/build-aux/useless-if-before-free \
$(useless_free_options) \
- $$($(VC_LIST_EXCEPT)) && \
+ $$($(VC_LIST_EXCEPT) | grep -v useless-if-before-free) && \
{ echo '$(ME): found useless "if" before "free" above' 1>&2; \
exit 1; } || :
@@ -191,10 +191,13 @@ sc_prohibit_have_config_h:
{ echo '$(ME): found use of HAVE''_CONFIG_H; remove' \
1>&2; exit 1; } || :
-# Nearly all .c files must include <config.h>.
+# Nearly all .c files must include <config.h>. However, we also permit this
+# via inclusion of a package-specific header, if cfg.mk specified one.
+# config_h_header must be suitable for grep -E.
+config_h_header ?= <config\.h>
sc_require_config_h:
- @if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \
- grep -L '^# *include <config\.h>' \
+ @if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \
+ grep -EL '^# *include $(config_h_header)' \
$$($(VC_LIST_EXCEPT) | grep '\.c$$') \
| grep . && \
{ echo '$(ME): the above files do not include <config.h>' \
@@ -203,12 +206,13 @@ sc_require_config_h:
fi
# You must include <config.h> before including any other header file.
+# This can possibly be via a package-specific header, if given by cfg.mk.
sc_require_config_h_first:
@if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then \
fail=0; \
for i in $$($(VC_LIST_EXCEPT) | grep '\.c$$'); do \
grep '^# *include\>' $$i | sed 1q \
- | grep '^# *include <config\.h>' > /dev/null \
+ | grep -E '^# *include $(config_h_header)' > /dev/null \
|| { echo $$i; fail=1; }; \
done; \
test $$fail = 1 && \