changeset 12606:47c45341eca0

maint.mk: allow packages to add makefile @@ exceptions Rather than hard-coding a coreutils-specific exception, this allows a package to specify its own exceptions in cfg.mk. * top/maint.mk (_makefile_at_at_check_exceptions): New hook. (sc_makefile_check): Rename... (sc_makefile_at_at_check): ...to this, and use hook. Signed-off-by: Eric Blake <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Thu, 07 Jan 2010 16:25:45 -0700
parents c7910f932a31
children 6b3184074239
files ChangeLog top/maint.mk
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-01-08  Eric Blake  <ebb9@byu.net>
 
+	maint.mk: allow packages to add makefile @@ exceptions
+	* top/maint.mk (_makefile_at_at_check_exceptions): New hook.
+	(sc_makefile_check): Rename...
+	(sc_makefile_at_at_check): ...to this, and use hook.
+
 	dup2: work around mingw bug
 	* lib/dup2.c (rpl_dup2): Sanitize return value on mingw.
 	Reported by Simon Josefsson.
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -580,8 +580,12 @@
 # to emit a definition for each substituted variable.
 # We use perl rather than "grep -nE ..." to exempt a single
 # use of an @...@-delimited variable name in src/Makefile.am.
-sc_makefile_check:
-	@perl -ne '/\@[A-Z_0-9]+\@/ && !/^cu_install_program =/'	\
+# Allow the package to add exceptions via a hook in cfg.mk;
+# for example, @PRAGMA_SYSTEM_HEADER@ can be permitted by
+# setting this to ' && !/PRAGMA_SYSTEM_HEADER/'.
+_makefile_at_at_check_exceptions ?=
+sc_makefile_at_at_check:
+	@perl -ne '/\@[A-Z_0-9]+\@/'$(_makefile_at_at_check_exceptions)	\
 	  -e 'and (print "$$ARGV:$$.: $$_"), $$m=1; END {exit !$$m}'	\
 	    $$($(VC_LIST_EXCEPT) | grep -E '(^|/)Makefile\.am$$')	\
 	  && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :