]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] automake: move processing of config-header rules in its own function
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 30 Jul 2012 12:12:11 +0000 (14:12 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 30 Jul 2012 15:06:00 +0000 (17:06 +0200)
This is a pure refactoring with no semantic changes intended.  It will
only be useful for future changes.

* automake.in (handle_configure): Move definition of $(AM_CONF_HEADERS)
from here ...
(handle_config_headers): ... to this new function, which will also ensure
that the $(AM_CONFIG_HEADERS) will always be defined (albeit possibly to
an empty value).
(generate_makefile): Call the new variable.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
automake.in

index 698549fa716f4e4348af4c77f310f8799e4c4461..57be393f8b8c046f0043417386dd7ceecdde6283 100644 (file)
@@ -3556,7 +3556,23 @@ sub rewrite_inputs_into_dependencies ($@)
   return @res;
 }
 
-
+sub handle_config_headers ()
+{
+  my @config_h;
+  foreach my $spec (@config_headers)
+    {
+      my ($out, @ins) = split_config_file_spec ($spec);
+      if ($relative_dir eq dirname ($out))
+       {
+         push @config_h, basename ($out);
+       }
+      else
+       {
+         push @config_h, "\$(top_builddir)/$out";
+       }
+    }
+  define_variable ("AM_CONFIG_HEADERS", INTERNAL, @config_h);
+}
 
 # &handle_configure ($MAKEFILE_AM, $MAKEFILE_IN, $MAKEFILE, @INPUTS)
 # ------------------------------------------------------------------
@@ -3658,22 +3674,6 @@ sub handle_configure ($$$@)
        }
     }
 
-  my @config_h;
-  foreach my $spec (@config_headers)
-    {
-      my ($out, @ins) = split_config_file_spec ($spec);
-      if ($relative_dir eq dirname ($out))
-       {
-         push @config_h, basename ($out);
-       }
-      else
-       {
-         push @config_h, "\$(top_builddir)/$out";
-       }
-    }
-  define_variable ("AM_CONFIG_HEADERS", INTERNAL, @config_h)
-    if @config_h;
-
   # Now look for other files in this directory which must be remade
   # by config.status, and generate rules for them.
   my @actual_other_files = ();
@@ -6865,6 +6865,7 @@ sub generate_makefile ($$)
 
   almost_verbatim ('am-dir');
 
+  handle_config_headers;
   handle_configure ($makefile_am, $makefile_in, $makefile, @inputs);
   handle_gettext;
   handle_libraries;