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 <[email protected]>
---
 automake.in | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/automake.in b/automake.in
index 698549f..57be393 100644
--- a/automake.in
+++ b/automake.in
@@ -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;
-- 
1.7.12.rc0


Reply via email to