diff -u -r automake_patch2/ChangeLog automake_patch3/ChangeLog --- automake_patch2/ChangeLog Thu Aug 2 01:39:14 2001 +++ automake_patch3/ChangeLog Thu Aug 2 02:34:28 2001 @@ -1,5 +1,14 @@ 2001-08-02 Richard Boulton + * automake.in (value_to_list): Check for whether $from is defined, + rather than whether it is true, so that empty $froms are allowed in + substitution reference patterns. + + * tests/substref.test: New file: test behavior of substitution + references when the $from side of the substitution is empty. + +2001-08-02 Richard Boulton + * automake.in (variable_conditions_sub): Handle variable substitution refs when computing conditions based on subvariable conditions. Fixes substitution refs of system variables when sub diff -u -r automake_patch2/automake.in automake_patch3/automake.in --- automake_patch2/automake.in Thu Aug 2 01:08:28 2001 +++ automake_patch3/automake.in Thu Aug 2 02:21:55 2001 @@ -6140,7 +6140,7 @@ @temp_list = &variable_value_as_list_worker ($1, $cond, $var); # Now rewrite the value if appropriate. - if ($from) + if (defined $from) { grep (s/$from$/$to/, @temp_list); } diff -u -r automake_patch2/tests/Makefile.am automake_patch3/tests/Makefile.am --- automake_patch2/tests/Makefile.am Thu Aug 2 01:42:44 2001 +++ automake_patch3/tests/Makefile.am Thu Aug 2 02:31:44 2001 @@ -278,6 +278,7 @@ subobj7.test \ subobj8.test \ subst.test \ +substref.test \ substtarg.test \ suffix.test \ suffix2.test \ diff -u -r automake_patch2/tests/Makefile.in automake_patch3/tests/Makefile.in --- automake_patch2/tests/Makefile.in Thu Aug 2 01:42:51 2001 +++ automake_patch3/tests/Makefile.in Thu Aug 2 02:31:48 2001 @@ -346,6 +346,7 @@ subobj7.test \ subobj8.test \ subst.test \ +substref.test \ substtarg.test \ suffix.test \ suffix2.test \ diff -u -r automake_patch2/tests/substref.test automake_patch3/tests/substref.test --- automake_patch2/tests/substref.test Thu Jan 1 01:00:00 1970 +++ automake_patch3/tests/substref.test Thu Aug 2 02:25:43 2001 @@ -0,0 +1,46 @@ +#! /bin/sh + +# Test for bug in variable substitution references when left hand pattern is +# null. +# Report from Richard Boulton + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AC_INIT(hello.c) +AM_INIT_AUTOMAKE(hello,0.23) +AC_PROG_CC +AC_OUTPUT(Makefile) +END + +cat > hello.c << 'END' +END + +cat > Makefile.am << 'END' + +var1 = dlmain + +var2 = $(var1:=.) + +helldl_SOURCES = $(var2:=c) + +echorule: + @echo $(helldl_SOURCES) $(helldl_OBJECTS) + +bin_PROGRAMS = helldl +END + +$needs_autoconf +(gcc -v) > /dev/null 2>&1 || exit 77 + +set -e + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +CC='gcc' ./configure + +val=`$MAKE echorule`; +echo $val +test "x$val" = "xdlmain.c dlmain.o"