automake-ng
[Top][All Lists]
Advanced

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

[Automake-NG] [PATCH 2/4] compile: rename make variable CONFIG_HEADER ->


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 2/4] compile: rename make variable CONFIG_HEADER -> AM_CONFIG_HEADERS
Date: Mon, 28 May 2012 11:35:03 +0200

The automake-generated variable 'CONFIG_HEADER' has never been
documented, and it violates user namespace.  So rename it to
'AM_CONFIG_HEADERS', to make it clear that it is owned by Automake.
We prefer that name to something that would sound more "private",
like 'am__config_headers', because there are possibly legitimate
usages of that variable on the user's part.

* automake.in: Do the rename.  Also, don't bother explicitly
rejecting the setting of 'CONFIG_HEADER' as an anachronism:
that warning has been active so long that any still maintained
Makefile.am file should have stopped doing that long ago.
* NG-NEWS: Update.
* lib/am/remake-hdr.am: Update a comment.
* syntax-checks.mk (modern.CONFIG_HEADER): New, define to
'AM_CONFIG_HEADERS'.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 NG-NEWS              |    6 ++++++
 automake.in          |   14 +++++---------
 lib/am/remake-hdr.am |    2 +-
 syntax-checks.mk     |    3 ++-
 4 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/NG-NEWS b/NG-NEWS
index 216c95b..5250741 100644
--- a/NG-NEWS
+++ b/NG-NEWS
@@ -265,6 +265,12 @@ Miscellaneous
   variable $(AM_MAKEFLAGS) has been removed, and its content is no more
   passed to recursive make invocations.
 
+* The make variable 'CONFIG_HEADER' had never been documented in mainline
+  Automake, and since when the support for user setting of it has been
+  removed (in favour of the use of the 'AC_CONFIG_HEADERS' autoconf macro
+  in configure.ac), it has been intended as an internal variable only.
+  So we've renamed it to 'AM_CONFIG_HEADERS'.  Do not override its value
+  in your Makefiles!
 
 -----
 
diff --git a/automake.in b/automake.in
index eeafd29..fb53813 100644
--- a/automake.in
+++ b/automake.in
@@ -2281,7 +2281,7 @@ sub handle_compile ()
       {
        my @incs = ('-I.', subst ('am__isrc'));
 
-       my $var = var 'CONFIG_HEADER';
+       my $var = var 'AM_CONFIG_HEADERS';
        if ($var)
          {
            foreach my $hdr (split (' ', $var->variable_value))
@@ -2292,8 +2292,9 @@ sub handle_compile ()
        # We want '-I. -I$(srcdir)', but the latter -I is redundant
        # and unaesthetic in non-VPATH builds.  We use address@hidden@`
        # instead.  It will be replaced by '-I.' or '-I. -I$(srcdir)'.
-       # Items in CONFIG_HEADER are never in $(srcdir) so it is safe
-       # to just put @am__isrc@ right after '-I.', without a space.
+       # Items in AM_CONFIG_HEADERS are never in $(srcdir) so it
+        # is safe to just put @am__isrc@ right after '-I.', without a
+        # space.
        ($default_includes = ' ' . uniq (@incs)) =~ s/ @/@/;
       }
 
@@ -3992,15 +3993,10 @@ sub handle_configure ($$$@)
                                  FILES => "@distclean_config")
     if @distclean_config;
 
-  reject_var ('CONFIG_HEADER',
-             "'CONFIG_HEADER' is an anachronism; now determined "
-             . "automatically\nfrom '$configure_ac'");
-
   my @config_h;
   foreach my $spec (@config_headers)
     {
       my ($out, @ins) = split_config_file_spec ($spec);
-      # Generate CONFIG_HEADER define.
       if ($relative_dir eq dirname ($out))
        {
          push @config_h, basename ($out);
@@ -4010,7 +4006,7 @@ sub handle_configure ($$$@)
          push @config_h, "\$(top_builddir)/$out";
        }
     }
-  define_variable ("CONFIG_HEADER", "@config_h", INTERNAL)
+  define_variable ("AM_CONFIG_HEADERS", "@config_h", INTERNAL)
     if @config_h;
 
   # Now look for other files in this directory which must be remade
diff --git a/lib/am/remake-hdr.am b/lib/am/remake-hdr.am
index 61e32be..e4928e8 100644
--- a/lib/am/remake-hdr.am
+++ b/lib/am/remake-hdr.am
@@ -15,7 +15,7 @@
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 %CONFIG_H%: %STAMP%
-## Recover from removal of CONFIG_HEADER.  Break up in two invocations
+## Recover from removal of config headers.  Break up in two invocations
 ## so that "make -n" is properly honored.
        @test -f $@ || rm -f %STAMP%
        @test -f $@ || $(MAKE) %STAMP%
diff --git a/syntax-checks.mk b/syntax-checks.mk
index b34a35d..dd8d00b 100644
--- a/syntax-checks.mk
+++ b/syntax-checks.mk
@@ -324,8 +324,9 @@ modern.DIST_SOURCES = am__dist_sources
 modern.am__TEST_BASES = am__test_bases
 modern.am__TEST_LOGS = am__test_logs
 modern.am__TEST_RESULTS = am__test_results
+modern.CONFIG_HEADER = AM_CONFIG_HEADERS
 
-sc_renamed_variables_rules = \
+Sc_renamed_variables_rules = \
   $(patsubst modern.%,sc_no_%,$(filter modern.%,$(.VARIABLES)))
 
 $(sc_renamed_variables_rules): sc_no_% :
-- 
1.7.9.5




reply via email to

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