2002-01-18 Tom Tromey <tromey@redhat.com>
+ For PR automake/288:
+ * automake.in (lang_c_rewrite): Don't prepend directory to base if
+ directory is `.'. Also, properly compute de_ansi_files entry in
+ subdir-objects case
+ * tests/Makefile.am (TESTS): Added ansi7.test.
+ * tests/ansi7.test: New file.
+
* aclocal.in (parse_arguments): Added 2002.
(write_aclocal): Likewise.
(parse_arguments): Updated my email address.
if (defined $options{'subdir-objects'})
{
$r = $LANG_SUBDIR;
- $base = $directory . '/' . $base;
+ $base = $directory . '/' . $base
+ unless $directory eq '.' || $directory eq '';
if (! $seen_cc_c_o)
{
}
require_conf_file ("$am_file.am", FOREIGN, 'compile');
+
+ # In this case we already have the directory information, so
+ # don't add it again.
+ $de_ansi_files{$base} = '';
+ }
+ else
+ {
+ $de_ansi_files{$base} = (($directory eq '.' || $directory eq '')
+ ? ''
+ : "$directory/");
}
- $de_ansi_files{$base} = (($directory eq '.' || $directory eq '')
- ? ''
- : "$directory/");
return $r;
}
ansi4.test \
ansi5.test \
ansi6.test \
+ansi7.test \
ar.test \
asm.test \
auxdir.test \
# Makefile.in generated by automake 1.5c from Makefile.am.
# @configure_input@
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
ansi4.test \
ansi5.test \
ansi6.test \
+ansi7.test \
ar.test \
asm.test \
auxdir.test \
--- /dev/null
+#! /bin/sh
+
+# Check ansi2knr on a source file in subdirectory.
+# From Kevin Ryde.
+
+required=gcc
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AC_INIT(ansi6, 1.0)
+AM_INIT_AUTOMAKE
+AC_PROG_CC
+AM_PROG_CC_C_O
+AM_C_PROTOTYPES
+AC_EXEEXT
+AC_OBJEXT
+AC_CONFIG_FILES(Makefile)
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = ansi2knr subdir-objects
+bin_PROGRAMS = hello
+hello_SOURCES = hello.c sub/dir.c
+END
+
+cat > hello.c << 'END'
+#include <stdio.h>
+
+extern int foo ();
+
+int
+main (int argc, char **argv)
+{
+ printf ("%d\n", foo ());
+}
+END
+
+mkdir sub
+
+cat > sub/dir.c << 'END'
+int
+foo ()
+{
+ return 23;
+}
+END
+
+set -e
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure am_cv_prog_cc_stdc=no
+$MAKE