]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Support for multiple inputs in AC_CONFIG_FILES.
authorAlexandre Duret-Lutz <adl@gnu.org>
Tue, 23 Sep 2003 08:14:35 +0000 (08:14 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Tue, 23 Sep 2003 08:14:35 +0000 (08:14 +0000)
Requested long ago by Harlan Stenn.
* automake.in (handle_dist): Remove unused argument $makefile.
(handle_subdirs): Expect SUBDIRS elements in $relative_dir,
not $am_relative_dir.
(rewrite_inputs_into_dependencies): Allow $add_srcdir to
be a filename that must always be prefixed by $(srcdir) or
$(top_srcdir).
(handle_configure, generate_makefile): Revamp to make the
Makefile.am, Makefile.in, Makefile more independent.
(locate_am): New function.
(scan_configure_dep, parse_arguments): Use locate_am.
(MAIN): Adjust call to generate_makefile.
* lib/am/configure.am: Remove %MAKEFILE-IN% from the dependencies
of %MAKEFILE%.  %MAKEFILE-IN% is already in %MAKEFILE-DEPS%.
* tests/output6.test, tests/output7.test: New files.
* tests/Makefile.am (TESTS): Add them.
* automake.texi (Requirements) <AC_CONFIG_FILES>: Document how
multiple inputs are scanned.

17 files changed:
ChangeLog
Makefile.in
NEWS
automake.in
automake.texi
lib/Automake/Makefile.in
lib/Automake/tests/Makefile.in
lib/Makefile.in
lib/am/Makefile.in
lib/am/configure.am
m4/Makefile.in
stamp-vti
tests/Makefile.am
tests/Makefile.in
tests/output6.test [new file with mode: 0755]
tests/output7.test [new file with mode: 0755]
version.texi

index 01fcb06e7142d4dccd2698f38d0af08f7fa5e23e..dca3139e67a439450437aa88d6de0e6df454ac2e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2003-09-23  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       Support for multiple inputs in AC_CONFIG_FILES.
+       Requested long ago by Harlan Stenn.
+       * automake.in (handle_dist): Remove unused argument $makefile.
+       (handle_subdirs): Expect SUBDIRS elements in $relative_dir,
+       not $am_relative_dir.
+       (rewrite_inputs_into_dependencies): Allow $add_srcdir to
+       be a filename that must always be prefixed by $(srcdir) or
+       $(top_srcdir).
+       (handle_configure, generate_makefile): Revamp to make the
+       Makefile.am, Makefile.in, Makefile more independent.
+       (locate_am): New function.
+       (scan_configure_dep, parse_arguments): Use locate_am.
+       (MAIN): Adjust call to generate_makefile.
+       * lib/am/configure.am: Remove %MAKEFILE-IN% from the dependencies
+       of %MAKEFILE%.  %MAKEFILE-IN% is already in %MAKEFILE-DEPS%.
+       * tests/output6.test, tests/output7.test: New files.
+       * tests/Makefile.am (TESTS): Add them.
+       * automake.texi (Requirements) <AC_CONFIG_FILES>: Document how
+       multiple inputs are scanned.
+
 2003-09-13  Alexandre Duret-Lutz  <adl@gnu.org>
 
        * Makefile.am (FETCHFILES, fetch): Do not fetch lib/Automake/XFile.pm
index fbde9e8458a22f0f032154c7609423195d2553b5..7cef79d1e949305617de9cabbf898f5fa5d505b8 100644 (file)
@@ -201,7 +201,7 @@ $(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4) $(
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  Makefile
-Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
+Makefile:  $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            echo ' $(SHELL) ./config.status'; \
diff --git a/NEWS b/NEWS
index b6e812f88247423e4a67991bc12c1cd21aa8d3ea..c2de8161c57b096b95481f8215bdc7aed9a55f32 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -95,6 +95,11 @@ New in 1.7a:
     will only be useful in projects generated with future versions of
     these tools.
 
+  - When using AC_CONFIG_FILES with multiple input files, Automake
+    generates the first ".in" input file for which a ".am" exists.
+    (Former versions would try to use only the first of the input
+    files.)
+
 * Obsolete features
 
   - lisp_DATA is now allowed.  If you are using the empty ELCFILES
index cd182f7427282fea7c866f19da6125d8a86b23a8..f241b7422fc682b26265ca7afc0608f406f9d65b 100755 (executable)
@@ -3041,13 +3041,11 @@ sub for_dist_common
 }
 
 
-# handle_dist ($MAKEFILE)
-# -----------------------
+# handle_dist
+# -----------
 # Handle 'dist' target.
-sub handle_dist
+sub handle_dist ()
 {
-  my ($makefile) = @_;
-
   # `make dist' isn't used in a Cygnus-style tree.
   # Omit the rules so that people don't try to use them.
   return if option 'cygnus';
@@ -3260,9 +3258,9 @@ sub handle_subdirs ()
       # Skip directories substituted by configure.
       next if $dir =~ /^\@.*\@$/;
 
-      if (! -d $am_relative_dir . '/' . $dir)
+      if (! -d $relative_dir . '/' . $dir)
        {
-         err_var ('SUBDIRS', "required directory $am_relative_dir/$dir "
+         err_var ('SUBDIRS', "required directory $relative_dir/$dir "
                   . "does not exist");
          next;
        }
@@ -3328,8 +3326,11 @@ sub scan_aclocal_m4 ()
 # AC_OUTPUT.  Consider what the dependencies should look like in this
 # case:
 #   AC_OUTPUT(src/out:src/in1:lib/in2)
-# The first argument, ADD_SRCDIR, is 1 if $(top_srcdir) should be added.
-# If 0 then files that require this addition will simply be ignored.
+# If the first argument, ADD_SRCDIR, is non-zero (e.g. 1), $(top_srcdir)
+# is added to files which are not in the current directory.
+# If ADD_SRCDIR is a filename and the filename occurs in INPUTS, it
+# will be prefixed with $(srcdir) unless already prefixed by $(top_srcdir)
+# by the above rule.
 sub rewrite_inputs_into_dependencies ($@)
 {
   my ($add_srcdir, @inputs) = @_;
@@ -3339,62 +3340,57 @@ sub rewrite_inputs_into_dependencies ($@)
     {
       if (dirname ($single) eq $relative_dir)
        {
-         push (@newinputs, basename ($single));
+         push (@newinputs,
+               ($add_srcdir eq $single ? '$(srcdir)/' : '')
+               . basename ($single));
        }
       else
        {
-         push (@newinputs, ($add_srcdir ? '$(top_srcdir)/' : '') . $single);
+         push (@newinputs,
+               ($add_srcdir ? '$(top_srcdir)/' : '') . $single);
        }
     }
   return @newinputs;
 }
 
 
-# &handle_configure ($LOCAL, $INPUT, @SECONDARY_INPUTS)
-# -----------------------------------------------------
+# &handle_configure ($MAKEFILE_AM, $MAKEFILE_IN, $MAKEFILE, @INPUTS)
+# ------------------------------------------------------------------
 # Handle remaking and configure stuff.
 # We need the name of the input file, to do proper remaking rules.
-sub handle_configure ($$@)
+sub handle_configure ($$$@)
 {
-  my ($local, $input, @secondary_inputs) = @_;
+  my ($makefile_am, $makefile_in, $makefile, @inputs) = @_;
 
-  my $input_base = basename ($input);
-  my $local_base = basename ($local);
-
-  my $amfile = $input_base . '.am';
-  # We know we can always add '.in' because it really should be an
-  # error if the .in was missing originally.
-  my $infile = '$(srcdir)/' . $input_base . '.in';
-  my $colon_infile = '';
-  if ($local ne $input || @secondary_inputs)
-    {
-      $colon_infile = ':' . $input . '.in';
-    }
-  $colon_infile .= ':' . join (':', @secondary_inputs)
-    if @secondary_inputs;
+  prog_error 'empty @inputs'
+    unless @inputs;
 
-  my @rewritten = rewrite_inputs_into_dependencies (1, @secondary_inputs);
+  my ($rel_makefile_am) = rewrite_inputs_into_dependencies (1, $makefile_am);
+  my ($rel_makefile_in) = rewrite_inputs_into_dependencies ($makefile_in,
+                                                           $makefile_in);
+  my $rel_makefile = basename $makefile;
 
+  my $colon_infile = ':' . join (':', @inputs);
+  $colon_infile = '' if $colon_infile eq ":$makefile.in";
+  my @rewritten = rewrite_inputs_into_dependencies ($makefile_in, @inputs);
   my ($regen_aclocal_m4, @aclocal_m4_deps) = scan_aclocal_m4;
-
-
   define_pretty_variable ('am__configure_deps', TRUE, INTERNAL,
                          @configure_deps);
 
   $output_rules .= file_contents
     ('configure',
      new Automake::Location,
-     MAKEFILE              => $local_base,
+     MAKEFILE              => $rel_makefile,
      'MAKEFILE-DEPS'       => "@rewritten",
      'CONFIG-MAKEFILE'     => ($relative_dir eq '.') ? '$@' : '$(subdir)/$@',
-     'MAKEFILE-IN'         => $infile,
+     'MAKEFILE-IN'         => $rel_makefile_in,
      'MAKEFILE-IN-DEPS'    => "@include_stack",
-     'MAKEFILE-AM'         => $amfile,
+     'MAKEFILE-AM'         => $rel_makefile_am,
      STRICTNESS            => global_option 'cygnus'
                                 ? 'cygnus' : $strictness_name,
      'USE-DEPS'            => global_option 'no-dependencies'
                                 ? ' --ignore-deps' : '',
-     'MAKEFILE-AM-SOURCES' =>  "$input$colon_infile",
+     'MAKEFILE-AM-SOURCES' => "$makefile$colon_infile",
      'REGEN-ACLOCAL-M4'    => $regen_aclocal_m4,
      ACLOCAL_M4_DEPS       => "@aclocal_m4_deps");
 
@@ -3540,7 +3536,8 @@ sub handle_configure ($$@)
        }
 
       # Automake files should not be stored in here, but in %MAKE_LIST.
-      prog_error "$lfile in \@other_input_files"
+      prog_error ("$lfile in \@other_input_files\n"
+                 . "\@other_input_files = (@other_input_files)")
        if -f $file . '.am';
 
       my $local = basename ($file);
@@ -4174,6 +4171,26 @@ sub split_config_file_spec ($)
   return ($output, @inputs);
 }
 
+# $input
+# locate_am (@POSSIBLE_SOURCES)
+# -----------------------------
+# AC_CONFIG_FILES allow specifications such as Makefile:top.in:mid.in:bot.in
+# This functions returns the first *.in file for which a *.am exists.
+# It returns undef otherwise.
+sub locate_am (@)
+{
+  my (@rest) = @_;
+  my $input;
+  foreach my $file (@rest)
+    {
+      if (($file =~ /^(.*)\.in$/) && -f "$1.am")
+       {
+         $input = $file;
+         last;
+       }
+    }
+  return $input;
+}
 
 my %make_list;
 
@@ -4184,27 +4201,18 @@ my %make_list;
 sub scan_autoconf_config_files ($)
 {
   my ($config_files) = @_;
+
   # Look at potential Makefile.am's.
   foreach (split ' ', $config_files)
     {
       # Must skip empty string for Perl 4.
       next if $_ eq "\\" || $_ eq '';
 
-      # Handle $local:$input syntax.  Note that we ignore
-      # every input file past the first, though we keep
-      # those around for later.
-      my ($local, $input, @rest) = split (/:/);
-      if (! $input)
-        {
-         $input = $local;
-        }
-      else
-        {
-         # FIXME: should be error if .in is missing.
-         $input =~ s/\.in$//;
-        }
-
-      if (-f $input . '.am')
+      # Handle $local:$input syntax.
+      my ($local, @rest) = split (/:/);
+      @rest = ("$local.in",) unless @rest;
+      my $input = locate_am @rest;
+      if ($input)
         {
          # We have a file that automake should generate.
          $make_list{$input} = join (':', ($local, @rest));
@@ -4424,14 +4432,14 @@ sub scan_autoconf_files ()
 
   scan_autoconf_traces ($configure_ac);
 
+  @configure_input_files = sort keys %make_list;
   # Set input and output files if not specified by user.
   if (! @input_files)
     {
-      @input_files = sort keys %make_list;
+      @input_files = @configure_input_files;
       %output_files = %make_list;
     }
 
-  @configure_input_files = sort keys %make_list;
 
   if (! $seen_init_automake)
     {
@@ -6501,13 +6509,13 @@ sub push_dist_common
 
 ################################################################
 
-# generate_makefile ($OUTPUT, $MAKEFILE)
-# --------------------------------------
+# generate_makefile ($MAKEFILE_AM, $MAKEFILE_IN)
+# ----------------------------------------------
 # Generate a Makefile.in given the name of the corresponding Makefile and
 # the name of the file output by config.status.
 sub generate_makefile ($$)
 {
-  my ($output, $makefile) = @_;
+  my ($makefile_am, $makefile_in) = @_;
 
   # Reset all the Makefile.am related variables.
   initialize_per_input;
@@ -6519,21 +6527,20 @@ sub generate_makefile ($$)
 
   # Name of input file ("Makefile.am") and output file
   # ("Makefile.in").  These have no directory components.
-  $am_file_name = basename ($makefile) . '.am';
-  $in_file_name = basename ($makefile) . '.in';
+  $am_file_name = basename ($makefile_am);
+  $in_file_name = basename ($makefile_in);
 
   # $OUTPUT is encoded.  If it contains a ":" then the first element
   # is the real output file, and all remaining elements are input
   # files.  We don't scan or otherwise deal with these input files,
   # other than to mark them as dependencies.  See
   # &scan_autoconf_files for details.
-  my (@secondary_inputs);
-  ($output, @secondary_inputs) = split (/:/, $output);
+  my ($makefile, @inputs) = split (/:/, $output_files{$makefile_in});
 
-  $relative_dir = dirname ($output);
-  $am_relative_dir = dirname ($makefile);
+  $relative_dir = dirname ($makefile);
+  $am_relative_dir = dirname ($makefile_am);
 
-  read_main_am_file ($makefile . '.am');
+  read_main_am_file ($makefile_am);
   if (handle_options)
     {
       # Process buffered warnings.
@@ -6582,7 +6589,7 @@ sub generate_makefile ($$)
   check_gnu_standards;
   check_gnits_standards;
 
-  handle_configure ($output, $makefile, @secondary_inputs);
+  handle_configure ($makefile_am, $makefile_in, $makefile, @inputs);
   handle_gettext;
   handle_libraries;
   handle_ltlibraries;
@@ -6618,11 +6625,11 @@ sub generate_makefile ($$)
   handle_tests;
 
   # This must come after most other rules.
-  handle_dist ($makefile);
+  handle_dist;
 
   handle_footer;
   do_check_merge_target;
-  handle_all ($output);
+  handle_all ($makefile);
 
   # FIXME: Gross!
   if (var ('lib_LTLIBRARIES') && var ('bin_PROGRAMS'))
@@ -6645,10 +6652,10 @@ sub generate_makefile ($$)
       mkdir ($output_directory . '/' . $am_relative_dir, 0755);
     }
 
-  my ($out_file) = $output_directory . '/' . $makefile . ".in";
+  my ($out_file) = $output_directory . '/' . $makefile_in;
 
   # We make sure that `all:' is the first target.
-  $output =
+  my $output =
     "$output_vars$output_all$output_header$output_rules$output_trailer";
 
   # Decide whether we must update the output file or not.
@@ -6871,25 +6878,19 @@ sub parse_arguments ()
                 . "Try `$0 --help' for more information.");
        }
 
-      # Handle $local:$input syntax.  Note that we only examine the
-      # first ":" file to see if it is automake input; the rest are
-      # just taken verbatim.  We still keep all the files around for
-      # dependency checking, however.
-      my ($local, $input, @rest) = split (/:/, $arg);
-      if (! $input)
+      # Handle $local:$input syntax.
+      my ($local, @rest) = split (/:/, $arg);
+      @rest = ("$local.in",) unless @rest;
+      my $input = locate_am @rest;
+      if ($input)
        {
-         $input = $local;
+         push @input_files, $input;
+         $output_files{$input} = join (':', ($local, @rest));
        }
       else
        {
-         # Strip .in; later on .am is tacked on.  That is how the
-         # automake input file is found.  Maybe not the best way, but
-         # it is easy to explain.
-         $input =~ s/\.in$//
-           or fatal "invalid input file name `$arg'\n.";
+         error "no Automake input file found in `$arg'";
        }
-      push (@input_files, $input);
-      $output_files{$input} = join (':', ($local, @rest));
     }
 }
 
@@ -6924,7 +6925,7 @@ do
   # Now do all the work on each file.
   foreach my $file (@input_files)
     {
-      $am_file = $file;
+      ($am_file = $file) =~ s/\.in$//;
       if (! -f ($am_file . '.am'))
        {
          error "`$am_file.am' does not exist";
@@ -6934,7 +6935,7 @@ do
          # Any warning setting now local to this Makefile.am.
          dup_channel_setup;
 
-         generate_makefile ($output_files{$am_file}, $am_file);
+         generate_makefile ($am_file . '.am', $file);
 
          # Back out any warning setting.
          drop_channel_setup;
index 5d2d143c992ac91209fae460f61afc8d402e2eaf..b8a34bb3611d93b0fc8536daab310cbc371db56c 100644 (file)
@@ -1120,7 +1120,13 @@ exists a file with the same name and the @file{.am} extension appended.
 Typically, @code{AC_CONFIG_FILES([foo/Makefile])} will cause Automake to
 generate @file{foo/Makefile.in} if @file{foo/Makefile.am} exists.
 
-These files are all removed by @code{make distclean}.
+When using @code{AC_CONFIG_FILES} with multiple input files, as in
+@code{AC_CONFIG_FILES([Makefile:top.in:Makefile.in:bot.in])}, Automake
+will generate the first @file{.in} input file for which a @file{.am}
+file exists.  If no such file exists the output file is not considered
+to be Automake generated.
+
+Files created by @code{AC_CONFIG_FILES} are removed by @code{make distclean}.
 @cvindex AC_CONFIG_FILES
 @cvindex AC_OUTPUT
 @end table
index 2f5196054260157af0e47e544c4f02e90143995d..77a1656fcd2ec6cd9ea78867c5b538d89bfbfa03 100644 (file)
@@ -176,7 +176,7 @@ $(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4) $(
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  lib/Automake/Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  lib/Automake/Makefile
-Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
+Makefile:  $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
index 0fe616fae19f5b0c99ef36baab547149a3edc69b..93855fb187fe6dbbc8cfcbb53a9851fa4265fe4f 100644 (file)
@@ -133,7 +133,7 @@ $(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4) $(
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  lib/Automake/tests/Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  lib/Automake/tests/Makefile
-Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
+Makefile:  $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
index 9cf0e494f6256c9c91ddbd23090f188c82eb3cff..c7dfed91e7818d97ab2a0e42d8de1dfbbd555529 100644 (file)
@@ -152,7 +152,7 @@ $(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4) $(
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  lib/Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  lib/Makefile
-Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
+Makefile:  $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
index 2e3a4ee2e42e7e4ac48c5fef860762d4b2c50361..2abc6723ddeecc0c992fbc4231b0ecd18ec0ba56 100644 (file)
@@ -138,7 +138,7 @@ $(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4) $(
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  lib/am/Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  lib/am/Makefile
-Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
+Makefile:  $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
index 2f399ae00e0372e360d1c871e8259054409208d8..a274ea4be722c893aacdbd0be4d97edac671d698 100644 (file)
@@ -54,7 +54,7 @@ endif %?TOPDIR_P%
          $(AUTOMAKE) --%STRICTNESS% %USE-DEPS% %MAKEFILE-AM-SOURCES%
 
 ## This rule remakes the Makefile.
-%MAKEFILE%: %MAINTAINER-MODE% %MAKEFILE-IN% %MAKEFILE-DEPS% $(top_builddir)/config.status
+%MAKEFILE%: %MAINTAINER-MODE% %MAKEFILE-DEPS% $(top_builddir)/config.status
 ## If Makefile is to be updated because of config.status, then run
 ## config.status without argument in order to (i) rerun all the
 ## AC_CONFIG_COMMANDS including those that are not visible to
index 477a5f074d4bf589b9d5c8b35b0b46724aa08bb5..4e91c9e64e33f292c485400848cf1979c9ac1fd2 100644 (file)
@@ -163,7 +163,7 @@ $(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4) $(
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  m4/Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  m4/Makefile
-Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
+Makefile:  $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
index 8ff20437024842e6300316ef23cba60cc0592c92..85ab91b3706b66a64553692da072c13b87d7073a 100644 (file)
--- a/stamp-vti
+++ b/stamp-vti
@@ -1,4 +1,4 @@
-@set UPDATED 6 September 2003
+@set UPDATED 23 September 2003
 @set UPDATED-MONTH September 2003
 @set EDITION 1.7a
 @set VERSION 1.7a
index 5b0a28f1d6b4e99b112bb94908502fca34cb8fd9..9b972521e886de32e0e86d0a6f5e48374370e49f 100644 (file)
@@ -328,6 +328,8 @@ output2.test \
 output3.test \
 output4.test \
 output5.test \
+output6.test \
+output7.test \
 overrid.test \
 parse.test \
 percent.test \
index a0e255a9ab6b18246283cd629dab01432345d7f3..66b3bb272dd3d98da83631035acc2f28183bb0f5 100644 (file)
@@ -438,6 +438,8 @@ output2.test \
 output3.test \
 output4.test \
 output5.test \
+output6.test \
+output7.test \
 overrid.test \
 parse.test \
 percent.test \
@@ -627,7 +629,7 @@ $(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4) $(
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  tests/Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  tests/Makefile
-Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
+Makefile:  $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
diff --git a/tests/output6.test b/tests/output6.test
new file mode 100755 (executable)
index 0000000..e245d31
--- /dev/null
@@ -0,0 +1,74 @@
+#! /bin/sh
+# Copyright (C) 2003  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Check for support for colon separated input files in AC_CONFIG_FILES
+
+required=GNUmake
+. ./defs || exit 1
+
+set -e
+
+cat > configure.in << END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES(foo:a.in:b.in:c.in:d.in)
+AC_OUTPUT
+END
+
+cat >a.in <<'EOF'
+a = A
+b = A
+c = A
+d = A
+EOF
+
+cat >b.in <<'EOF'
+b = B
+c = B
+d = B
+EOF
+
+cat >c.am <<'EOF'
+c = C
+d = C
+
+print:
+       @echo $a$b$c$d
+EOF
+
+echo 'd = D' > d.in
+
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE -f foo print | grep 'ABCD'
+
+$sleep
+cat >b.in <<'EOF'
+a = G
+b = F
+c = F
+d = F
+EOF
+
+# This involves the rebuild rule, hence it requires GNUmake
+$MAKE -f foo print | grep 'GFCD'
diff --git a/tests/output7.test b/tests/output7.test
new file mode 100755 (executable)
index 0000000..eb9c659
--- /dev/null
@@ -0,0 +1,66 @@
+#! /bin/sh
+# Copyright (C) 2003  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Check for support for colon separated input files in AC_CONFIG_FILES,
+# with sources in sub directories.
+
+. ./defs || exit 1
+
+set -e
+
+cat > configure.in << END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([
+  Makefile:mk/toplevel.in
+  sub/Makefile:mk/sub.in
+  mk/Makefile
+])
+AC_OUTPUT
+END
+
+mkdir mk sub
+cat >mk/Makefile.am <<'EOF'
+all-local:
+       @echo in--mk
+EOF
+
+cat >mk/sub.am <<'EOF'
+all-local:
+       @echo in--sub
+EOF
+
+cat >mk/toplevel.am <<'EOF'
+all-local:
+       @echo at--toplevel
+SUBDIRS = mk sub
+EOF
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE >output
+cat output
+grep in--mk output
+grep in--sub output
+grep at--toplevel output
+
+$MAKE distcheck
index 8ff20437024842e6300316ef23cba60cc0592c92..85ab91b3706b66a64553692da072c13b87d7073a 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 6 September 2003
+@set UPDATED 23 September 2003
 @set UPDATED-MONTH September 2003
 @set EDITION 1.7a
 @set VERSION 1.7a