From 269ac80f8c18cf17cab38b9370102f4ceeafb9ff Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 20 Nov 2002 23:28:03 +0000 Subject: [PATCH] * automake.in (handle_single_transform_list): Don't strip the directory from $full_ansi. This reverts my patch of 2002-10-16. (lang_c_finish): Use the full filename, including the directory, in the .c -> _.c rule. These two files must reside in the same directory. * tests/ansi6.test: Also try to compile without ansi2knr. Reported by Andreas Schwab --- ChangeLog | 10 ++++++++++ automake.in | 9 ++++----- tests/ansi6.test | 7 +++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60fa609e..63002eb5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2002-11-21 Alexandre Duret-Lutz + + * automake.in (handle_single_transform_list): Don't strip the + directory from $full_ansi. This reverts my patch of 2002-10-16. + (lang_c_finish): Use the full filename, including the directory, + in the .c -> _.c rule. These two files must reside in the same + directory. + * tests/ansi6.test: Also try to compile without ansi2knr. + Reported by Andreas Schwab + 2002-11-20 Alexandre Duret-Lutz * lib/Automake/Conditional.pm (strip): New function. diff --git a/automake.in b/automake.in index 58a123ed..2350b028 100755 --- a/automake.in +++ b/automake.in @@ -2453,8 +2453,6 @@ sub handle_single_transform_list ($$$$@) if ($lang->ansi && defined $options{'ansi2knr'}) { $full_ansi =~ s/$KNOWN_EXTENSIONS_PATTERN$/\$U$&/; - $full_ansi = basename $full_ansi - unless defined $options{'subdir-objects'}; } my $val = ("$full_ansi $obj_sans_ext " @@ -5610,16 +5608,17 @@ sub lang_c_finish # we can't use $< -- some makes only define $< during a # suffix rule. my $ansfile = $de_ansi_files{$base} . $base . '.c'; - $output_rules .= ($base . "_.c: $ansfile \$(ANSI2KNR)\n\t" + my $root = $de_ansi_files{$base} . $base; + $output_rules .= ($root . "_.c: $ansfile \$(ANSI2KNR)\n\t" . '$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) ' . '`if test -f $(srcdir)/' . $ansfile . '; then echo $(srcdir)/' . $ansfile . '; else echo ' . $ansfile . '; fi` ' . "| sed 's/^# \\([0-9]\\)/#line \\1/' " - . '| $(ANSI2KNR) > ' . $base . "_.c" + . '| $(ANSI2KNR) > $@' # If ansi2knr fails then we shouldn't # create the _.c file - . " || rm -f ${base}_.c\n"); + . " || rm -f ${root}_.c\n"); push (@objects, $base . '_.$(OBJEXT)'); push (@objects, $base . '_.lo') if variable_defined ('LIBTOOL'); diff --git a/tests/ansi6.test b/tests/ansi6.test index f7c709aa..735b3a9c 100755 --- a/tests/ansi6.test +++ b/tests/ansi6.test @@ -74,3 +74,10 @@ grep ac_cv_prog_cc_stdc configure ./configure ac_cv_prog_cc_stdc=no $MAKE + +# Also run without forcing ansi2knr, so we make sure the +# rules work with ANSI compilers. +# Report from Andreas Schwab. +$MAKE distclean +./configure +$MAKE -- 2.43.5