]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* automake.in ($config_header_location): Remove. Use
authorAlexandre Duret-Lutz <adl@gnu.org>
Thu, 4 Dec 2003 18:17:20 +0000 (18:17 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Thu, 4 Dec 2003 18:17:20 +0000 (18:17 +0000)
%ac_config_files_location instead.
(rewrite_inputs_into_dependencies): Do not prepend $(top_builddir)/
at the top-level.
(handle_configure): Use rewrite_inputs_into_dependencies to
distribute and compute AC_CONFIG_HEADERS dependencies.
(scan_autoconf_traces) <AC_CONFIG_HEADERS>: Fill
%ac_config_files_location.
* lib/am/remake-hdr.am ($(srcdir)/%CONFIG_HIN%): Rename as ...
(%CONFIG_HIN%): ... this.  $(srcdir) is already added in
scan_autoconf_traces.
* tests/Makefile.am (TESTS): Add confh5.test.
* tests/confh5.test: New file.

ChangeLog
automake.in
lib/am/remake-hdr.am
tests/Makefile.am
tests/Makefile.in
tests/confh5.test [new file with mode: 0755]

index f68aab4ed7e7a0d157c8fad5e3bfe5e8bc327dce..4ddac4ab0cadfbc62df21183c2452ff3dbe3ee11 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2003-12-04  Alexandre Duret-Lutz  <adl@gnu.org>
 
+       * automake.in ($config_header_location): Remove.  Use
+       %ac_config_files_location instead.
+       (rewrite_inputs_into_dependencies): Do not prepend $(top_builddir)/
+       at the top-level.
+       (handle_configure): Use rewrite_inputs_into_dependencies to
+       distribute and compute AC_CONFIG_HEADERS dependencies.
+       (scan_autoconf_traces) <AC_CONFIG_HEADERS>: Fill
+       %ac_config_files_location.
+       * lib/am/remake-hdr.am ($(srcdir)/%CONFIG_HIN%): Rename as ...
+       (%CONFIG_HIN%): ... this.  $(srcdir) is already added in
+       scan_autoconf_traces.
+       * tests/Makefile.am (TESTS): Add confh5.test.
+       * tests/confh5.test: New file.
+
        * tests/ltlibsrc.test: Fix the zoo_d_old2_la.c rule in Makefile.am,
        $< is not portable and the source is in $(srcdir).
 
index 60308b50f695fb0dad257b504f75cc58aa87d2fd..4ea84eb7c2a5530e67cabf23160030c7c006af76 100755 (executable)
@@ -296,8 +296,6 @@ my %libsources = ();
 
 # Names used in AC_CONFIG_HEADER call.
 my @config_headers = ();
-# Where AC_CONFIG_HEADER appears.
-my $config_header_location;
 
 # Names used in AC_CONFIG_LINKS call.
 my @config_links = ();
@@ -316,7 +314,7 @@ my @configure_input_files = ();
 # List of files in AC_CONFIG_FILES/AC_OUTPUT without Makefile.am's,
 # and their outputs.
 my @other_input_files = ();
-# Where each AC_CONFIG_FILES/AC_OUTPUT/AC_CONFIG_LINK appears.
+# Where each AC_CONFIG_FILES/AC_OUTPUT/AC_CONFIG_LINK/AC_CONFIG_HEADER appears.
 # The keys are the files created by these macros.
 my %ac_config_files_location = ();
 
@@ -3500,11 +3498,16 @@ sub rewrite_inputs_into_dependencies ($@)
     {
       if (exists $ac_config_files_location{$i})
        {
-         if (dirname ($i) eq $relative_dir)
+         my $di = dirname $i;
+         if ($di eq $relative_dir)
            {
              $i = basename $i;
            }
-         else
+         # In the top-level Makefile we do not use $(top_builddir), because
+         # we are already there, and since the targets are built without
+         # a $(top_builddir), it helps BSD Make to match them with 
+          # dependencies.
+         elsif ($relative_dir ne '.')
            {
              $i = '$(top_builddir)/' . $i;
            }
@@ -3609,14 +3612,8 @@ sub handle_configure ($$$@)
                }
            }
 
-         # Distribute all inputs.
-         for my $in (@ins)
-           {
-             error $config_header_location, "required file `$in' not found"
-               unless -f $in;
-             push_dist_common (prepend_srcdir ($in));
-           }
-         @ins = prepend_srcdir (@ins);
+         # This will also distribute all inputs.
+         @ins = rewrite_inputs_into_dependencies ($config_h_path, @ins);
 
          # Header defined and in this directory.
          my @files;
@@ -4495,8 +4492,12 @@ sub scan_autoconf_traces ($)
        }
       elsif ($macro eq 'AC_CONFIG_HEADERS')
        {
-         $config_header_location = $where;
-         push @config_headers, split (' ', $args[1]);
+         foreach my $spec (split (' ', $args[1]))
+           {
+             my ($dest, @src) = split (':', $spec);
+             $ac_config_files_location{$dest} = $where;
+             push @config_headers, $spec;
+           }
        }
       elsif ($macro eq 'AC_CONFIG_LINKS')
        {
index 067c34844daf49973e84f7d441567c0f40d31d66..56e9f3ed85f211ff1787e05db2beab3905f64765 100644 (file)
@@ -36,7 +36,7 @@
 ## Only the first file of AC_CONFIG_HEADERS is assumed to be generated
 ## by autoheader.
 if %?FIRST_CONFIG_HIN%
-$(srcdir)/%CONFIG_HIN%: %MAINTAINER-MODE% $(am__configure_deps) %FILES%
+%CONFIG_HIN%: %MAINTAINER-MODE% $(am__configure_deps) %FILES%
        cd $(top_srcdir) && $(AUTOHEADER)
 ## Whenever $(AUTOHEADER) has run, we must make sure that
 ## ./config.status will rebuild config.h.  The dependency from %STAMP%
@@ -74,5 +74,5 @@ $(srcdir)/%CONFIG_HIN%: %MAINTAINER-MODE% $(am__configure_deps) %FILES%
 ## must not changed gratuitously is config.h, which is already handled
 ## by config.status, there is no reason to make things complex for
 ## config.hin.
-       touch $(srcdir)/%CONFIG_HIN%
+       touch $@
 endif %?FIRST_CONFIG_HIN%
index 8cb87a26230d0f1e42007fa4c85806c2ebbfa125..122f05f7f40740f6b0ad68dfb498049b4e8c2455 100644 (file)
@@ -129,6 +129,7 @@ conff.test \
 conff2.test \
 confh.test \
 confh4.test \
+confh5.test \
 config.test \
 confincl.test \
 conflnk.test \
index ddede65d9542aed27cec98681c8c6ddf137c5316..6ff203cf4da8caddf522609afc21b72005dfa019 100644 (file)
@@ -243,6 +243,7 @@ conff.test \
 conff2.test \
 confh.test \
 confh4.test \
+confh5.test \
 config.test \
 confincl.test \
 conflnk.test \
diff --git a/tests/confh5.test b/tests/confh5.test
new file mode 100755 (executable)
index 0000000..d46eaa8
--- /dev/null
@@ -0,0 +1,56 @@
+#! /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 we do not distribute header sources when they are built.
+
+. ./defs || exit 1
+
+cat >> configure.in << 'END'
+AC_SUBST([FOO], [name])
+AC_CONFIG_FILES(include/config.h.in)
+AC_CONFIG_HEADERS(config.h)
+AC_CONFIG_HEADERS(include/config.h)
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+test: distdir
+       test -f $(distdir)/config.h.in
+       test -f $(distdir)/include/config.h.in.in
+       test ! -e $(distdir)/include/config.h.in
+END
+
+mkdir include
+: > include/config.h.in.in
+
+$ACLOCAL
+$AUTOCONF
+$AUTOHEADER
+$AUTOMAKE
+
+./configure
+$MAKE
+
+$sleep
+echo '#undef @FOO@' > include/config.h.in.in
+$MAKE include/config.h
+grep '/\*.*#undef.*name' include/config.h
+$MAKE test
+$MAKE distcheck