+2002-11-21 Alexandre Duret-Lutz <adl@gnu.org>
+
+ * 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 <adl@gnu.org>
* lib/Automake/Conditional.pm (strip): New function.
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 "
# 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');
./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