From: Alexandre Duret-Lutz Date: Sat, 22 Nov 2003 18:05:35 +0000 (+0000) Subject: Fix for PR automake/411: X-Git-Tag: Release-1-7f~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=178206767611df77e3904774be7a6c0f4f96831a;p=thirdparty%2Fautomake.git Fix for PR automake/411: * automake.in (rewrite_inputs_into_dependencies): Simplify, and rename into ... (prepend_srcdir): ... this. (rewrite_inputs_into_dependencies): New function, extracted from ... (handle_configure): ... here. Adjust to use prepend_srcdir or rewrite_inputs_into_dependencies where needed. Especially, using (the new) rewrite_inputs_into_dependencies to compute Makefile dependencies will fix PR/411. * lib/am/configure.am (DIST_COMMON): Remove %MAKEFILE-IN%, it's already distributed by rewrite_inputs_into_dependencies. * tests/Makefile.am (TESTS): Add output10.test, remove distcom.test. * tests/colon3.test: Use set -e. Don't allow any AUTOMAKE invocation refer to zardoz. Make sure two.in and three.in appear as $(srcdir)/two.in and $(srcdir)/three.in dependencies. * tests/distcom.test: Delete. This is covered by tests/output9.test. * tests/output10.test: New file, for PR/411. --- diff --git a/ChangeLog b/ChangeLog index f24e6c506..8e027e69c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2003-11-22 Alexandre Duret-Lutz + + Fix for PR automake/411: + * automake.in (rewrite_inputs_into_dependencies): Simplify, and rename + into ... + (prepend_srcdir): ... this. + (rewrite_inputs_into_dependencies): New function, extracted from ... + (handle_configure): ... here. Adjust to use prepend_srcdir + or rewrite_inputs_into_dependencies where needed. Especially, + using (the new) rewrite_inputs_into_dependencies to compute + Makefile dependencies will fix PR/411. + * lib/am/configure.am (DIST_COMMON): Remove %MAKEFILE-IN%, it's + already distributed by rewrite_inputs_into_dependencies. + * tests/Makefile.am (TESTS): Add output10.test, remove distcom.test. + * tests/colon3.test: Use set -e. Don't allow any AUTOMAKE + invocation refer to zardoz. Make sure two.in and three.in + appear as $(srcdir)/two.in and $(srcdir)/three.in dependencies. + * tests/distcom.test: Delete. This is covered by tests/output9.test. + * tests/output10.test: New file, for PR/411. + 2003-11-21 Alexandre Duret-Lutz * automake.in (append_exeext): Do not append $(EXEEXT) to diff --git a/Makefile.in b/Makefile.in index 1273068c3..e648b6356 100644 --- a/Makefile.in +++ b/Makefile.in @@ -35,9 +35,9 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . -DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.in \ - $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL \ - Makefile.am NEWS THANKS TODO configure configure.ac +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ + ChangeLog INSTALL NEWS THANKS TODO configure configure.ac ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(top_srcdir)/m4/auxdir.m4 $(top_srcdir)/m4/init.m4 \ @@ -171,7 +171,7 @@ all: all-recursive .SUFFIXES: am--refresh: @: -$(srcdir)/Makefile.in: Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ diff --git a/automake.in b/automake.in index f37c3afc9..1ee5db42d 100755 --- a/automake.in +++ b/automake.in @@ -3441,45 +3441,72 @@ sub scan_aclocal_m4 () } -# @DEPENDENCY -# &rewrite_inputs_into_dependencies ($ADD_SRCDIR, @INPUTS) -# -------------------------------------------------------- -# Rewrite a list of input files into a form suitable to put on a -# dependency list. The idea is that if an input file has a directory -# part the same as the current directory, then the directory part is -# simply removed. But if the directory part is different, then -# $(top_srcdir) is prepended. Among other things, this is used to -# generate the dependency list for the output files generated by -# AC_OUTPUT. Consider what the dependencies should look like in this -# case: -# AC_OUTPUT(src/out:src/in1:lib/in2) -# 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) = @_; +# @DEPENDENCIES +# &prepend_srcdir (@INPUTS) +# ------------------------- +# Prepend $(srcdir) or $(top_srcdir) to all @INPUTS. The idea is that +# if an input file has a directory part the same as the current +# directory, then the directory part is simply replaced by $(srcdir). +# But if the directory part is different, then $(top_srcdir) is +# prepended. +sub prepend_srcdir (@) +{ + my @inputs = @_; my @newinputs; foreach my $single (@inputs) { if (dirname ($single) eq $relative_dir) { - push (@newinputs, - ($add_srcdir eq $single ? '$(srcdir)/' : '') - . basename ($single)); + push (@newinputs, '$(srcdir)/' . basename ($single)); } else { - push (@newinputs, - ($add_srcdir ? '$(top_srcdir)/' : '') . $single); + push (@newinputs, '$(top_srcdir)/' . $single); } } return @newinputs; } +# @DEPENDENCIES +# rewrite_inputs_into_dependencies ($OUTPUT, @INPUTS) +# --------------------------------------------------- +# Compute a list of dependencies appropriate for the rebuild +# rule of +# AC_CONFIG_FILES($OUTPUT:$INPUT[0]:$INPUTS[1]:...) +# Also distribute $INPUTs which are not build by another AC_CONFIG_FILES. +sub rewrite_inputs_into_dependencies ($@) +{ + my ($file, @inputs) = @_; + my @res = (); + + 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 exists $output_files{$i} || -f $i; + ($i) = prepend_srcdir ($i); + push_dist_common ($i); + } + push @res, $i; + } + return @res; +} + + # &handle_configure ($MAKEFILE_AM, $MAKEFILE_IN, $MAKEFILE, @INPUTS) # ------------------------------------------------------------------ @@ -3492,14 +3519,13 @@ sub handle_configure ($$$@) prog_error 'empty @inputs' unless @inputs; - my ($rel_makefile_am) = rewrite_inputs_into_dependencies (1, $makefile_am); - my ($rel_makefile_in) = rewrite_inputs_into_dependencies ($makefile_in, + my ($rel_makefile_am, $rel_makefile_in) = prepend_srcdir ($makefile_am, $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 @rewritten = rewrite_inputs_into_dependencies ($makefile, @inputs); my ($regen_aclocal_m4, @aclocal_m4_deps) = scan_aclocal_m4; define_pretty_variable ('am__aclocal_m4_deps', TRUE, INTERNAL, @configure_deps, @aclocal_m4_deps, @@ -3572,9 +3598,9 @@ sub handle_configure ($$$@) { error $config_header_location, "required file `$in' not found" unless -f $in; - push_dist_common (rewrite_inputs_into_dependencies (1, $in)); + push_dist_common (prepend_srcdir ($in)); } - @ins = rewrite_inputs_into_dependencies (1, @ins); + @ins = prepend_srcdir (@ins); # Header defined and in this directory. my @files; @@ -3711,33 +3737,7 @@ sub handle_configure ($$$@) } } - # 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; - } + my @rewritten_inputs = rewrite_inputs_into_dependencies ($file, @inputs); $output_rules .= ($local . ': ' . '$(top_builddir)/config.status ' diff --git a/doc/Makefile.in b/doc/Makefile.in index 0d19f79eb..f3e8e80b6 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -34,6 +34,9 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = doc +DIST_COMMON = $(automake_TEXINFOS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/stamp-vti \ + $(srcdir)/version.texi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(top_srcdir)/m4/auxdir.m4 $(top_srcdir)/m4/init.m4 \ @@ -44,8 +47,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(automake_TEXINFOS) $(srcdir)/Makefile.in \ - $(srcdir)/stamp-vti $(srcdir)/version.texi Makefile.am mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = @@ -143,7 +144,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .dvi .html .info .pdf .ps .texi -$(srcdir)/Makefile.in: Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index 219dd9d9b..85d6d0aa9 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -35,6 +35,8 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = lib/Automake +DIST_COMMON = $(dist_perllib_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(top_srcdir)/m4/auxdir.m4 $(top_srcdir)/m4/init.m4 \ @@ -45,7 +47,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(dist_perllib_DATA) $(srcdir)/Makefile.in Makefile.am mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = @@ -166,7 +167,7 @@ EXTRA_DIST = Config.in all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index 282c6b7da..4a9b9fe62 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -34,6 +34,7 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = lib/Automake/tests +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(top_srcdir)/m4/auxdir.m4 $(top_srcdir)/m4/init.m4 \ @@ -44,7 +45,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = @@ -125,7 +125,7 @@ EXTRA_DIST = $(TESTS) all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ diff --git a/lib/Makefile.in b/lib/Makefile.in index f9ac9637b..3d1c9feb9 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -35,6 +35,11 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = lib +DIST_COMMON = $(dist_pkgvdata_DATA) $(dist_script_DATA) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING INSTALL \ + ansi2knr.1 ansi2knr.c compile config.guess config.sub depcomp \ + elisp-comp install-sh mdate-sh missing mkinstalldirs \ + py-compile texinfo.tex ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(top_srcdir)/m4/auxdir.m4 $(top_srcdir)/m4/init.m4 \ @@ -45,11 +50,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(dist_pkgvdata_DATA) $(dist_script_DATA) \ - $(srcdir)/Makefile.in COPYING INSTALL Makefile.am ansi2knr.1 \ - ansi2knr.c compile config.guess config.sub depcomp elisp-comp \ - install-sh mdate-sh missing mkinstalldirs py-compile \ - texinfo.tex ylwrap mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = @@ -144,7 +144,7 @@ dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \ all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in index ac1b88727..cf1e3ce78 100644 --- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -35,6 +35,8 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = lib/am +DIST_COMMON = $(dist_am_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(top_srcdir)/m4/auxdir.m4 $(top_srcdir)/m4/init.m4 \ @@ -45,7 +47,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(dist_am_DATA) $(srcdir)/Makefile.in Makefile.am mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = @@ -130,7 +131,7 @@ texinfos.am yacc.am all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ diff --git a/lib/am/configure.am b/lib/am/configure.am index ede227ba0..8939be0ed 100644 --- a/lib/am/configure.am +++ b/lib/am/configure.am @@ -79,7 +79,7 @@ endif %?TOPDIR_P% cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe);; \ esac; -DIST_COMMON += %MAKEFILE-AM% %MAKEFILE-IN% +DIST_COMMON += %MAKEFILE-AM% ## --------------------------- ## diff --git a/m4/Makefile.in b/m4/Makefile.in index e4846f406..5cd693a03 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -35,6 +35,8 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = m4 +DIST_COMMON = $(dist_m4data_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(top_srcdir)/m4/auxdir.m4 $(top_srcdir)/m4/init.m4 \ @@ -45,7 +47,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = $(dist_m4data_DATA) $(srcdir)/Makefile.in Makefile.am mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = @@ -156,7 +157,7 @@ EXTRA_DIST = dirlist amversion.in all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ diff --git a/tests/Makefile.am b/tests/Makefile.am index 1bc548f38..0792a683d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -172,7 +172,6 @@ destdir.test \ dirforbid.test \ dirlist.test \ discover.test \ -distcom.test \ distcom2.test \ distcom3.test \ distcom4.test \ @@ -337,6 +336,7 @@ output6.test \ output7.test \ output8.test \ output9.test \ +output10.test \ overrid.test \ parse.test \ percent.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index a999b7083..5b0b5fd7b 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -34,6 +34,8 @@ NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = tests +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/aclocal.in $(srcdir)/automake.in $(srcdir)/defs.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(top_srcdir)/m4/auxdir.m4 $(top_srcdir)/m4/init.m4 \ @@ -44,8 +46,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/amversion.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -DIST_COMMON = README $(srcdir)/Makefile.in Makefile.am aclocal.in \ - automake.in defs.in mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs CONFIG_CLEAN_FILES = defs aclocal-${APIVERSION} automake-${APIVERSION} SOURCES = @@ -286,7 +286,6 @@ destdir.test \ dirforbid.test \ dirlist.test \ discover.test \ -distcom.test \ distcom2.test \ distcom3.test \ distcom4.test \ @@ -451,6 +450,7 @@ output6.test \ output7.test \ output8.test \ output9.test \ +output10.test \ overrid.test \ parse.test \ percent.test \ @@ -637,7 +637,7 @@ check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION) all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -666,11 +666,11 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -defs: $(top_builddir)/config.status defs.in +defs: $(top_builddir)/config.status $(srcdir)/defs.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -aclocal-${APIVERSION}: $(top_builddir)/config.status aclocal.in +aclocal-${APIVERSION}: $(top_builddir)/config.status $(srcdir)/aclocal.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -automake-${APIVERSION}: $(top_builddir)/config.status automake.in +automake-${APIVERSION}: $(top_builddir)/config.status $(srcdir)/automake.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ uninstall-info-am: tags: TAGS diff --git a/tests/colon3.test b/tests/colon3.test index 64d6d5ba9..41b2301fb 100755 --- a/tests/colon3.test +++ b/tests/colon3.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -23,6 +24,8 @@ . ./defs || exit 1 +set -e + cat > configure.in << 'END' AC_INIT AM_INIT_AUTOMAKE(nonesuch, nonesuch) @@ -33,26 +36,24 @@ END : > two.in : > three.in -$ACLOCAL || exit 1 -$AUTOMAKE || exit 1 +$ACLOCAL +$AUTOMAKE # We actually check several things here. # Automake should have created zardoz.in. -test -f zardoz.in || exit 1 +test -f zardoz.in # The generated file should refer to zardoz.in and zardoz.am, but -# never just "zardoz" -- except the actual automake invocation can -# refer to it (don't ask). +# never just "zardoz". echo Grep1 -grep zardoz zardoz.in | $FGREP -v 'zardoz.in' | $FGREP -v 'zardoz.am' \ - | $FGREP -v AUTOMAKE > O +grep zardoz zardoz.in | $EGREP -v 'zardoz.in' | $FGREP -v 'zardoz.am' > O || : # We cat the output file so we see in when verbose. cat O -test -z "`cat O`" || exit 1 +test -z "`cat O`" # Makefile should depend on two.in. echo Grep2 -grep '^Makefile:.* two.in' zardoz.in || exit 1 +grep '^Makefile:.* \$(srcdir)/two.in' zardoz.in # Likewise three.in. echo Grep3 -grep '^Makefile:.* three.in' zardoz.in +grep '^Makefile:.* \$(srcdir)/three.in' zardoz.in diff --git a/tests/distcom.test b/tests/output10.test similarity index 51% rename from tests/distcom.test rename to tests/output10.test index 24f36ffd8..21fab9a22 100755 --- a/tests/distcom.test +++ b/tests/output10.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 2003 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -18,30 +18,50 @@ # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. -# A test for failure to include files provided in AC_OUTPUT into -# DIST_COMMON -# From Derek R. Price. +# Make sure an AC_CONFIG_FILES can have an AC_CONFIG_FILES output as input. +# This is comparable to output9.test, but testing Makefile rules. +# PR/411 . ./defs || exit 1 -cat > configure.in << EOF -AC_INIT -AM_INIT_AUTOMAKE(nonesuch, nonesuch) -AC_OUTPUT(subdir/bar \ - Makefile \ - subdir/Makefile) -EOF +set -e + +cat >> configure.in << END +AC_SUBST([FOO], [top]) +AC_SUBST([BAR], [bot]) +AC_CONFIG_FILES([a/top]) +AC_CONFIG_FILES([a/bot]) +AC_CONFIG_FILES([b/Makefile:a/top:b/Makefile.in:a/bot]) +AC_OUTPUT +END -: > Makefile.am +mkdir a +mkdir b -mkdir subdir -: > subdir/Makefile.am -: > subdir/bar.in +cat >Makefile.am <<\EOF +SUBDIRS = b +dist-hook: + test ! -f $(distdir)/a/top + test ! -f $(distdir)/a/bot +EOF + +cat >b/Makefile.am <<\EOF +output: + echo $(TOP)$(BOT) > ok +EOF -$ACLOCAL || exit 1 -$AUTOMAKE || exit 1 +echo TOP=@FOO@ >a/top.in +echo BOT=@BAR@ >a/bot.in -# verify bar.in -grep 'DIST_COMMON.*bar.in' subdir/Makefile.in || exit 1 +$ACLOCAL +$AUTOCONF +$AUTOMAKE -exit 0 +mkdir build +cd build +../configure +cd b +$MAKE output +grep topbot ok +cd .. +$MAKE distcheck