From: Stefano Lattarini Date: Sun, 27 May 2012 13:48:30 +0000 (+0200) Subject: [ng] compile: rename make variable CONFIG_HEADER -> AM_CONFIG_HEADERS X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b740587e3f076c6338523b2bbb130e72f5dfef0;p=thirdparty%2Fautomake.git [ng] compile: rename make variable CONFIG_HEADER -> AM_CONFIG_HEADERS 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 --- diff --git a/NG-NEWS b/NG-NEWS index 216c95bba..5250741f7 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 eeafd295b..fb53813cc 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 `-I.@am__isrc@` # 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 61e32be04..e4928e806 100644 --- a/lib/am/remake-hdr.am +++ b/lib/am/remake-hdr.am @@ -15,7 +15,7 @@ ## along with this program. If not, see . %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 b34a35d07..dd8d00bc4 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_% :