bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sc_makefile_at_at_check and gettext LOCALEDIR


From: Jim Meyering
Subject: Re: sc_makefile_at_at_check and gettext LOCALEDIR
Date: Mon, 25 Apr 2011 10:29:19 +0200

Bruno Haible wrote:
> Simon Josefsson wrote:
>> > So the use of @...@ is not only appropriate here, it is even mandatory.
>>
>> So possibly the maint.mk check should be relaxed to permit constructs
>> matching FOO = ... @FOO@ then?
>
> Yes, this is what I meant.
>
>> Then I think the current behaviour of maint.mk shoudld stay, unless
>> anyone else finds other corner cases -- this warning resulted a change
>> to use a more modern style in one of my projects.
>
> It is also commonplace to use Makefile.am to tweak a definition found
> by Autoconf. For example, I have
>
>   MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
>
> in several projects, otherwise makeinfo will put German or French navigation
> helps into an otherwise English documentation.

Thanks to both of you, here are some improvements.
In addition, I've extended it to also check *.mk files,
so it may expose new uses of @VAR@ in some projects.


>From ea868d4a150963fafb230c888dc093a2e06a3613 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 25 Apr 2011 10:24:20 +0200
Subject: [PATCH] maint.mk: makefile_at_at_check extend and clean up

* top/maint.mk (sc_makefile_at_at_check): Check *.mk files
in addition to */Makefile.am.
Exempt legitimate uses of @VAR@ notation, e.g.,
MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
Remove obsolete coreutils-specific comment.
Prompted by discussion here:
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/26074
---
 ChangeLog    |   11 +++++++++++
 top/maint.mk |   15 +++++++++++----
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c9aa54d..65ed4a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-04-25  Jim Meyering  <address@hidden>
+
+       maint.mk: makefile_at_at_check extend and clean up
+       * top/maint.mk (sc_makefile_at_at_check): Check *.mk files
+       in addition to */Makefile.am.
+       Exempt legitimate uses of @VAR@ notation, e.g.,
+       MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
+       Remove obsolete coreutils-specific comment.
+       Prompted by discussion here:
+       http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/26074
+
 2011-04-24  Paul Eggert  <address@hidden>

        strtoul: remove dependency on strtol
diff --git a/top/maint.mk b/top/maint.mk
index 07a7773..47cb44e 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -942,16 +942,23 @@ update-NEWS-hash: NEWS
 # Ensure that we use only the standard $(VAR) notation,
 # not @...@ in Makefile.am, now that we can rely on automake
 # to emit a definition for each substituted variable.
-# We use perl rather than "grep -nE ..." to exempt a single
-# use of an @address@hidden variable name in src/Makefile.am.
+# However, there is still one case in which @VAR@ use is not just
+# legitimate, but actually required: when augmenting an automake-defined
+# variable with a prefix.  For example, gettext uses this:
+# MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
+# otherwise, makeinfo would put German or French (current locale)
+# navigation hints in the otherwise-English documentation.
+#
 # 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 '/address@hidden@/'$(_makefile_at_at_check_exceptions)        
\
+       @perl -ne '/address@hidden@/'                                   \
+          -e ' && !/([A-Z_0-9]+)address@hidden@$$/'                    \
+          -e ''$(_makefile_at_at_check_exceptions)                     \
          -e 'and (print "$$ARGV:$$.: $$_"), $$m=1; END {exit !$$m}'    \
-           $$($(VC_LIST_EXCEPT) | grep -E '(^|/)Makefile\.am$$')       \
+           $$($(VC_LIST_EXCEPT) | grep -E '(^|/)(Makefile\.am|[^/]+\.mk)$$') \
          && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :

 news-check: NEWS
--
1.7.5.rc3.316.gd1ff9



reply via email to

[Prev in Thread] Current Thread [Next in Thread]