ansi2knr fix from jim meyering
authorTom Tromey <tromey@redhat.com>
Mon, 23 Mar 1998 18:00:22 +0000 (18:00 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 23 Mar 1998 18:00:22 +0000 (18:00 +0000)
ChangeLog
automake.in
tests/ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/libobj8.test [new file with mode: 0755]

index db5a4c2..8bc3089 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 Mon Mar 23 07:55:04 1998  Tom Tromey  <tromey@cygnus.com>
 
+       * automake.in (handle_yacc_lex_cxx): Push lib sources onto
+       de_ansi_files before generating ._c dependencies.  Test
+       libobj8.test.
+
        * m4/mktime.m4: New version from Jim Meyering.
 
        * aclocal.in (usage): Document --print-ac-dir.
index aec2b2f..2b49d47 100755 (executable)
@@ -983,6 +983,19 @@ sub handle_yacc_lex_cxx
     #
     # Handle some ansi2knr cleanup.
     #
+
+    # Push all libobjs files onto de_ansi_files.  We actually only
+    # push files which exist in the current directory, and which are
+    # genuine source files.  This is moderately lame.  FIXME.
+    local ($file);
+    foreach $file (keys %libsources)
+    {
+       if ($file =~ /^(.*)\.[cly]$/ && -f "$relative_dir/$file")
+       {
+           $de_ansi_files{$1} = 1;
+       }
+    }
+
     if (defined $options{'ansi2knr'} && keys %de_ansi_files)
     {
        # Make all _.c files depend on their corresponding .c files.
index bec14b6..846304e 100644 (file)
@@ -1,3 +1,7 @@
+Mon Mar 23 10:52:36 1998  Tom Tromey  <tromey@cygnus.com>
+
+       * libobj8.test: New file.
+
 Fri Mar 20 00:32:16 1998  Tom Tromey  <tromey@cygnus.com>
 
        * lex2.test: New file.
index 9fb4766..e5f6022 100644 (file)
@@ -30,7 +30,7 @@ install.test libobj7.test objc.test cond3.test cxxcpp.test \
 aclocal.test alpha.test whoami.test unused.test condman.test \
 texinfo5.test aclocali.test texinfo6.test condman2.test colon4.test \
 java.test sinclude.test javaprim.test javasubst.test aclocalii.test \
-lex2.test
+lex2.test libobj8.test
 
 EXTRA_DIST = defs $(TESTS)
 
index dd17324..9b7d61d 100644 (file)
@@ -93,7 +93,7 @@ install.test libobj7.test objc.test cond3.test cxxcpp.test \
 aclocal.test alpha.test whoami.test unused.test condman.test \
 texinfo5.test aclocali.test texinfo6.test condman2.test colon4.test \
 java.test sinclude.test javaprim.test javasubst.test aclocalii.test \
-lex2.test
+lex2.test libobj8.test
 
 EXTRA_DIST = defs $(TESTS)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff --git a/tests/libobj8.test b/tests/libobj8.test
new file mode 100755 (executable)
index 0000000..a4b4090
--- /dev/null
@@ -0,0 +1,36 @@
+#! /bin/sh
+
+# Test to make sure `_.c' dependencies are generated for LIBOBJS
+# objects.
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+PACKAGE=nonesuch
+VERSION=nonesuch
+AC_PROG_CC
+AC_ARG_PROGRAM
+AC_PROG_INSTALL
+AC_PROG_RANLIB
+AC_REPLACE_FUNCS(basename dirname strsignal)
+AM_C_PROTOTYPES
+AC_OUTPUT(Makefile)
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = ansi2knr
+noinst_LIBRARIES = libtu.a
+libtu_a_SOURCES =
+libtu_a_LIBADD = @LIBOBJS@
+END
+
+: > basename.c
+: > dirname.c
+: > strsignal.c
+
+: > ansi2knr.1
+: > ansi2knr.c
+
+$AUTOMAKE || exit 1
+
+grep 'strsignal_.c:' Makefile.in