summaryrefslogtreecommitdiff
path: root/maint.mk
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2011-02-20 16:25:16 +0100
committerSimon Josefsson <simon@josefsson.org>2011-02-20 16:26:21 +0100
commitaee017b8888c904c42a303586f05a193f778cedb (patch)
treea44f8ee5f243968fdef3bc5f5719387360831479 /maint.mk
parent8f177e5e8fc4ea89d3611be2a70832147dba5e82 (diff)
downloadgnutls-aee017b8888c904c42a303586f05a193f778cedb.tar.gz
Update gnulib files.
Diffstat (limited to 'maint.mk')
-rw-r--r--maint.mk55
1 files changed, 46 insertions, 9 deletions
diff --git a/maint.mk b/maint.mk
index 958be698e3..ff2fbbb382 100644
--- a/maint.mk
+++ b/maint.mk
@@ -2,7 +2,7 @@
# This Makefile fragment tries to be general-purpose enough to be
# used by many projects via the gnulib maintainer-makefile module.
-## Copyright (C) 2001-2010 Free Software Foundation, Inc.
+## Copyright (C) 2001-2011 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -126,8 +126,13 @@ syntax-check-rules := $(sort $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
$(srcdir)/$(ME) $(_cfg_mk)))
.PHONY: $(syntax-check-rules)
-local-checks-available = \
- $(syntax-check-rules)
+ifeq ($(shell $(VC_LIST) >/dev/null 2>&1; echo $$?),0)
+local-checks-available += $(syntax-check-rules)
+else
+local-checks-available += no-vc-detected
+no-vc-detected:
+ @echo "No version control files detected; skipping syntax check"
+endif
.PHONY: $(local-checks-available)
# Arrange to print the name of each syntax-checking rule just before running it.
@@ -292,10 +297,10 @@ sc_prohibit_atoi_atof:
# Use STREQ rather than comparing strcmp == 0, or != 0.
sc_prohibit_strcmp:
- @grep -nE '! *str''cmp *\(|\<str''cmp *\([^)]+\) *==' \
+ @grep -nE '! *str''cmp *\(|\<str''cmp *\(.+\) *[!=]=' \
$$($(VC_LIST_EXCEPT)) \
- | grep -vE ':# *define STREQ\(' && \
- { echo '$(ME): use STREQ in place of the above uses of str''cmp' \
+ | grep -vE ':# *define STRN?EQ\(' && \
+ { echo '$(ME): replace str''cmp calls above with STREQ/STRNEQ' \
1>&2; exit 1; } || :
# Pass EXIT_*, not number, to usage, exit, and error (when exiting)
@@ -571,6 +576,13 @@ sc_prohibit_intprops_without_use:
re='\<($(_intprops_syms_re)) *\(' \
$(_sc_header_without_use)
+_stddef_syms_re = NULL|offsetof|ptrdiff_t|size_t|wchar_t
+# Prohibit the inclusion of stddef.h without an actual use.
+sc_prohibit_stddef_without_use:
+ @h='<stddef.h>' \
+ re='\<($(_stddef_syms_re)) *\(' \
+ $(_sc_header_without_use)
+
sc_obsolete_symbols:
@prohibit='\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
halt='do not use HAVE''_FCNTL_H or O'_NDELAY \
@@ -1118,9 +1130,34 @@ no-submodule-changes:
: ; \
fi
+submodule-checks ?= no-submodule-changes public-submodule-commit
+
+# Ensure that each sub-module commit we're using is public.
+# Without this, it is too easy to tag and release code that
+# cannot be built from a fresh clone.
+.PHONY: public-submodule-commit
+public-submodule-commit:
+ $(AM_V_GEN)if test -d $(srcdir)/.git; then \
+ cd $(srcdir) && \
+ git submodule --quiet foreach test '$$(git rev-parse $$sha1)' \
+ = '$$(git merge-base origin $$sha1)' \
+ || { echo '$(ME): found non-public submodule commit' >&2; \
+ exit 1; }; \
+ else \
+ : ; \
+ fi
+# This rule has a high enough utility/cost ratio that it should be a
+# dependent of "check" by default. However, some of us do occasionally
+# commit a temporary change that deliberately points to a non-public
+# submodule commit, and want to be able to use rules like "make check".
+# In that case, run e.g., "make check gl_public_submodule_commit="
+# to disable this test.
+gl_public_submodule_commit ?= public-submodule-commit
+check: $(gl_public_submodule_commit)
+
.PHONY: alpha beta stable
ALL_RECURSIVE_TARGETS += alpha beta stable
-alpha beta stable: $(local-check) writable-files no-submodule-changes
+alpha beta stable: $(local-check) writable-files $(submodule-checks)
test $@ = stable \
&& { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \
|| { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
@@ -1208,8 +1245,8 @@ refresh-po:
INDENT_SOURCES ?= $(C_SOURCES)
.PHONY: indent
indent:
- indent -nut $(INDENT_SOURCES)
- indent -nut $(INDENT_SOURCES)
+ indent $(INDENT_SOURCES)
+ indent $(INDENT_SOURCES)
# If you want to set UPDATE_COPYRIGHT_* environment variables,
# put the assignments in this variable.