From: Alexandre Duret-Lutz Date: Tue, 1 Oct 2002 19:59:32 +0000 (+0000) Subject: * automake.in (handle_source_transform): If foo_SOURCES is defined X-Git-Tag: Release-1-7b~413 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=941640d6394ca28ac8f6bd5b752d3c57c8edc89b;p=automake.git * automake.in (handle_source_transform): If foo_SOURCES is defined conditionally, create and use am__foo_SOURCES_DIST for distribution. * tests/condd.test: Extend to check distributed files. * tests/substref.test: Make sure we don't use such a variable when it's not needed. Reported by Marcus Brinkmann. --- diff --git a/ChangeLog b/ChangeLog index ff3d4fd7..4b9bc9c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-10-01 Alexandre Duret-Lutz + + * automake.in (handle_source_transform): If foo_SOURCES is defined + conditionally, create and use am__foo_SOURCES_DIST for distribution. + * tests/condd.test: Extend to check distributed files. + * tests/substref.test: Make sure we don't use such a variable when + it's not needed. + Reported by Marcus Brinkmann. + 2002-09-30 Ezra Peisach * tests/defs.in: Run $MAKE --version -v. diff --git a/THANKS b/THANKS index dbf94d88..8f26ad65 100644 --- a/THANKS +++ b/THANKS @@ -112,6 +112,7 @@ Laurent Morichetti laurentm@cup.hp.com Maciej Stachowiak mstachow@mit.edu Maciej W. Rozycki macro@ds2.pg.gda.pl Manu Rouat emmanuel.rouat@wanadoo.fr +Marcus Brinkmann Marcus.Brinkmann@ruhr-uni-bochum.de Marcus G. Daniels mgd@ute.santafe.edu Marius Vollmer mvo@zagadka.ping.de Mark Eichin eichin@cygnus.com diff --git a/automake.in b/automake.in index 8b183511..14fced53 100755 --- a/automake.in +++ b/automake.in @@ -2802,8 +2802,23 @@ sub handle_source_transform unless $prefix =~ /EXTRA_/; push @sources, "\$($var)"; - push @dist_sources, "\$($var)" - unless $prefix =~ /^nodist_/; + if ($prefix !~ /^nodist_/) + { + # If the VAR wasn't definined conditionally, we add + # it to DIST_SOURCES as is. Otherwise we create a + # am__VAR_DIST variable which contains all possible values, + # and add this variable to DIST_SOURCES. + my $distvar = "$var"; + my @conds = variable_conditions_recursive ($var); + if (@conds && $conds[0] ne 'TRUE') + { + $distvar = "am__${var}_DIST"; + my @files = + uniq (variable_value_as_list_recursive ($var, 'all')); + define_pretty_variable ($distvar, '', $where, @files); + } + push @dist_sources, "\$($distvar)" + } @substfroms = (); @substtos = (); diff --git a/tests/condd.test b/tests/condd.test index 127de542..244ad506 100755 --- a/tests/condd.test +++ b/tests/condd.test @@ -22,9 +22,14 @@ . ./defs || exit 1 +set -e + cat >> configure.in << 'END' AC_PROG_CC -AM_CONDITIONAL(COND1, true) +AM_CONDITIONAL(COND1, false) +AC_CONFIG_FILES([foo/Makefile]) +AC_CONFIG_FILES([bar/Makefile]) +AC_OUTPUT END cat > Makefile.am << 'END' @@ -41,9 +46,25 @@ hello_SOURCES += hello-cond1.c else hello_SOURCES += hello-generic.c endif + +test: distdir + test -f $(distdir)/foo/Makefile.am + test -f $(distdir)/bar/Makefile.am + test -f $(distdir)/hello-common.c + test -f $(distdir)/hello-cond1.c + test -f $(distdir)/hello-generic.c END mkdir foo bar -$ACLOCAL || exit 1 +: > foo/Makefile.am +: > bar/Makefile.am +: > hello-common.c +: > hello-cond1.c +: > hello-generic.c + +$ACLOCAL +$AUTOCONF $AUTOMAKE +./configure +$MAKE test diff --git a/tests/substref.test b/tests/substref.test index 37e54cbb..5edc0736 100755 --- a/tests/substref.test +++ b/tests/substref.test @@ -64,3 +64,9 @@ CC='gcc' ./configure val=`$MAKE -s echorule`; echo $val test "x$val" = "xdlmain.c dlmain.o" + +# This is unrelated to the rest of this test. But while we are +# at it, make sure we don't use am__helldl_SOURCES_DIST here, since +# it's not needed. DIST_SOURCES should contains $(helldl_SOURCES). +grep am__helldl_SOURCES_DIST Makefile && exit 1 +grep 'DIST_SOURCES.*\(helldl_SOURCES\)' Makefile