From: Alexandre Duret-Lutz Date: Thu, 4 Dec 2003 18:17:20 +0000 (+0000) Subject: * automake.in ($config_header_location): Remove. Use X-Git-Tag: Release-1-8~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f11286e1a9b633f116d61cb8f4a3f027323bf6e;p=thirdparty%2Fautomake.git * 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) : 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. --- diff --git a/ChangeLog b/ChangeLog index f68aab4ed..4ddac4ab0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2003-12-04 Alexandre Duret-Lutz + * 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) : 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). diff --git a/automake.in b/automake.in index 60308b50f..4ea84eb7c 100755 --- a/automake.in +++ b/automake.in @@ -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') { diff --git a/lib/am/remake-hdr.am b/lib/am/remake-hdr.am index 067c34844..56e9f3ed8 100644 --- a/lib/am/remake-hdr.am +++ b/lib/am/remake-hdr.am @@ -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% diff --git a/tests/Makefile.am b/tests/Makefile.am index 8cb87a262..122f05f7f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -129,6 +129,7 @@ conff.test \ conff2.test \ confh.test \ confh4.test \ +confh5.test \ config.test \ confincl.test \ conflnk.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index ddede65d9..6ff203cf4 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 index 000000000..d46eaa855 --- /dev/null +++ b/tests/confh5.test @@ -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