]> sourceware.org Git - automake.git/commitdiff
* automake.in (ac_config_files_location): Declare as a hash.
authorAlexandre Duret-Lutz <adl@gnu.org>
Mon, 17 Nov 2003 00:33:42 +0000 (00:33 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Mon, 17 Nov 2003 00:33:42 +0000 (00:33 +0000)
(handle_configure): Rewrite the computation of AC_CONFIG_FILES
dependencies; make sure we don't use $(srcdir) or $(top_srcdir)
for inputs which are also outputs, and do not check inputs
relatively to the current directory.
(scan_autoconf_config_files): Take $where as argument, and
fill $ac_config_files_location.
* tests/output8.test, tests/output9.test: New files.
* tests/Makefile.am (TESTS): Add output8.test and output9.test.
Report from Bruno Haible.

ChangeLog
automake.in
doc/Makefile.in
tests/Makefile.am
tests/Makefile.in
tests/output8.test [new file with mode: 0755]
tests/output9.test [new file with mode: 0755]

index a61a87d6f8d3484dc72e2056327206db7eca03c0..610398cfcf09618d9710a3d6b9ad561c40408c1f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2003-11-17  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * automake.in (ac_config_files_location): Declare as a hash.
+       (handle_configure): Rewrite the computation of AC_CONFIG_FILES
+       dependencies; make sure we don't use $(srcdir) or $(top_srcdir)
+       for inputs which are also outputs, and do not check inputs
+       relatively to the current directory.
+       (scan_autoconf_config_files): Take $where as argument, and
+       fill $ac_config_files_location.
+       * tests/output8.test, tests/output9.test: New files.
+       * tests/Makefile.am (TESTS): Add output8.test and output9.test.
+       Report from Bruno Haible.
+
 2003-11-14  Alexandre Duret-Lutz  <adl@gnu.org>
 
        * tests/aclibobj.test, tests/aclocal.test, tests/aclocal3.test,
index 1c83bbf31489b965a46a65bb036a317ad04d7c13..034090edc8dd4ab281ddddd0b711e4f6adf6ffdf 100755 (executable)
@@ -317,7 +317,7 @@ my @configure_input_files = ();
 # and their outputs.
 my @other_input_files = ();
 # Where the last AC_CONFIG_FILES/AC_OUTPUT appears.
-my $ac_config_files_location;
+my %ac_config_files_location = ();
 
 # List of directories to search for configure-required files.  This
 # can be set by AC_CONFIG_AUX_DIR.
@@ -3711,7 +3711,34 @@ sub handle_configure ($$$@)
            }
        }
 
-      my @rewritten_inputs = rewrite_inputs_into_dependencies (1, @inputs);
+      # An input file is either output by some other AC_CONFIG_FILES,
+      # or it must exist and be relative to $(top_srcdir).  In the
+      # latter case, we distribute it; in the former, we should not.
+      my @rewritten_inputs = ();
+      for my $i (@inputs)
+       {
+         if (exists $ac_config_files_location{$i})
+           {
+             if (dirname ($i) eq $relative_dir)
+               {
+                 $i = basename $i;
+               }
+             else
+               {
+                 $i = '$(top_builddir)/' . $i;
+               }
+           }
+         else
+           {
+             msg ('error', $ac_config_files_location{$file},
+                  "required file `$i' not found")
+               unless -f $i;
+             ($i) = rewrite_inputs_into_dependencies (1, $i);
+             push_dist_common ($i);
+           }
+         push @rewritten_inputs, $i;
+       }
+
       $output_rules .= ($local . ': '
                        . '$(top_builddir)/config.status '
                        . "@rewritten_inputs\n"
@@ -3722,10 +3749,6 @@ sub handle_configure ($$$@)
                        . '$@'
                        . "\n");
       push (@actual_other_files, $local);
-
-      # Require all input files.
-      require_file ($ac_config_files_location, FOREIGN,
-                   rewrite_inputs_into_dependencies (0, @inputs));
     }
 
   foreach my $struct (@config_links)
@@ -4339,13 +4362,13 @@ sub locate_am (@)
 
 my %make_list;
 
-# &scan_autoconf_config_files ($CONFIG-FILES)
-# -------------------------------------------
+# &scan_autoconf_config_files ($WHERE, $CONFIG-FILES)
+# ---------------------------------------------------
 # Study $CONFIG-FILES which is the first argument to AC_CONFIG_FILES
 # (or AC_OUTPUT).
-sub scan_autoconf_config_files ($)
+sub scan_autoconf_config_files ($$)
 {
-  my ($config_files) = @_;
+  my ($where, $config_files) = @_;
 
   # Look at potential Makefile.am's.
   foreach (split ' ', $config_files)
@@ -4368,6 +4391,7 @@ sub scan_autoconf_config_files ($)
          # rebuilt, but shouldn't generate itself.
          push (@other_input_files, $_);
         }
+      $ac_config_files_location{$local} = $where;
     }
 }
 
@@ -4451,8 +4475,7 @@ sub scan_autoconf_traces ($)
       elsif ($macro eq 'AC_CONFIG_FILES')
        {
          # Look at potential Makefile.am's.
-         $ac_config_files_location = $where;
-         &scan_autoconf_config_files ($args[1]);
+         scan_autoconf_config_files ($where, $args[1]);
        }
       elsif ($macro eq 'AC_CONFIG_HEADERS')
        {
@@ -6421,7 +6444,7 @@ sub require_file_internal ($$@)
 
     foreach my $file (@files)
     {
-        my $fullfile;
+       my $fullfile;
        my $errdir;
        my $errfile;
        my $save_dir;
index 87797311f74c8e93f88bd2a4e9c029afc852ab80..eba41325bc4e1c713ade4ec498132502f266ae8c 100644 (file)
@@ -422,8 +422,12 @@ install-info: install-info-am
 install-info-am: $(INFO_DEPS)
        @$(NORMAL_INSTALL)
        $(mkdir_p) $(DESTDIR)$(infodir)
-       @list='$(INFO_DEPS)'; \
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       list='$(INFO_DEPS)'; \
        for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+         esac; \
          if test -f $$file; then d=.; else d=$(srcdir); fi; \
          file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
          for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
index 5f1037d9b56ff7b233cd14ece2e2ae79ea1c996f..4f39f7bdbfe9bc95eb94f60fbe19ad51696647dc 100644 (file)
@@ -334,6 +334,8 @@ output4.test \
 output5.test \
 output6.test \
 output7.test \
+output8.test \
+output9.test \
 overrid.test \
 parse.test \
 percent.test \
index 807271ca3ef8770ea9a65fa8457c6498df98972a..a8d0c289e296e2325db9a8b1e65e9db232e02e37 100644 (file)
@@ -448,6 +448,8 @@ output4.test \
 output5.test \
 output6.test \
 output7.test \
+output8.test \
+output9.test \
 overrid.test \
 parse.test \
 percent.test \
diff --git a/tests/output8.test b/tests/output8.test
new file mode 100755 (executable)
index 0000000..7ef82b0
--- /dev/null
@@ -0,0 +1,58 @@
+#! /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 AC_CONFIG_FILES support for files starting with `../'.
+# Report from Bruno Haible.
+
+. ./defs || exit 1
+
+set -e
+
+mkdir testdir
+cd testdir
+
+mv ../configure.in .
+cat >> configure.in << END
+AC_CONFIG_FILES([a/foo.sh:../testdir/a/foo.sh.in])
+AC_CONFIG_FILES([a/Makefile])
+AC_OUTPUT
+END
+
+mkdir a
+
+echo SUBDIRS = a >Makefile.am
+: >a/Makefile.am
+
+echo foo >a/foo.sh.in
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure
+$MAKE
+test "`cat a/foo.sh`" = foo
+
+$sleep
+echo 'bar' >a/foo.sh.in
+
+cd a
+$MAKE foo.sh
+test "`cat foo.sh`" = bar
diff --git a/tests/output9.test b/tests/output9.test
new file mode 100755 (executable)
index 0000000..d2f4e90
--- /dev/null
@@ -0,0 +1,58 @@
+#! /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.
+
+# Make sure an AC_CONFIG_FILES can have an AC_CONFIG_FILES output as input.
+
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << END
+AC_CONFIG_FILES([a/mid.in:a/input.in.in])
+AC_CONFIG_FILES([b/out:a/mid.in])
+AC_CONFIG_FILES([a/Makefile b/Makefile])
+AC_OUTPUT
+END
+
+mkdir a
+mkdir b
+
+
+cat >Makefile.am <<\EOF
+SUBDIRS = a b
+dist-hook:
+       test -f $(distdir)/a/input.in.in
+       test ! -f $(distdir)/a/mid.in
+       if test ! -f check; then :; else : > ok; fi
+EOF
+
+: >a/Makefile.am
+: >b/Makefile.am
+
+echo foo >a/input.in.in
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+./configure
+: > check
+$MAKE distcheck
+test -f ok
This page took 0.042121 seconds and 5 git commands to generate.