From 95b09bda4f36a974b85d5c6a45e8b9af51df8584 Mon Sep 17 00:00:00 2001 From: Richard Boulton Date: Fri, 3 Aug 2001 11:57:13 +0000 Subject: [PATCH] 2001-08-03 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. * tests/Makefile.am (TESTS): Added substref.test. --- ChangeLog | 10 ++++++++++ automake.in | 2 +- tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/substref.test | 46 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 59 insertions(+), 1 deletion(-) create mode 100755 tests/substref.test diff --git a/ChangeLog b/ChangeLog index 0243b59d..ec401316 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2001-08-03 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. + * tests/Makefile.am (TESTS): Added substref.test. + 2001-08-03 Alexandre Duret-Lutz * m4/install-sh.m4: New file. diff --git a/automake.in b/automake.in index 125829bb..cecb270f 100755 --- a/automake.in +++ b/automake.in @@ -6113,7 +6113,7 @@ sub value_to_list @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 --git a/tests/Makefile.am b/tests/Makefile.am index fc9bfda9..7932b2ce 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -275,6 +275,7 @@ subobj6.test \ subobj7.test \ subobj8.test \ subst.test \ +substref.test \ substtarg.test \ suffix.test \ suffix2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index d600297d..542e78e8 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -343,6 +343,7 @@ subobj6.test \ subobj7.test \ subobj8.test \ subst.test \ +substref.test \ substtarg.test \ suffix.test \ suffix2.test \ diff --git a/tests/substref.test b/tests/substref.test new file mode 100755 index 00000000..750a4040 --- /dev/null +++ b/tests/substref.test @@ -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" -- 2.43.5