Fixed ansi2knr bug
authorTom Tromey <tromey@redhat.com>
Tue, 11 Aug 1998 03:14:07 +0000 (03:14 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 11 Aug 1998 03:14:07 +0000 (03:14 +0000)
ChangeLog
automake.in
tests/ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/ansi3.test [new file with mode: 0755]

index 062aea1..8ba532b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Aug 10 20:57:35 1998  Tom Tromey  <tromey@cygnus.com>
+
+       * automake.in (handle_yacc_lex_cxx): Redirect ansi2knr output to
+       correct file.  From Kave Ghazi.
+
 Sun Aug  2 16:05:16 1998  Tom Tromey  <tromey@cygnus.com>
 
        * Released 1.3a.
index 352a674..4a550cd 100755 (executable)
@@ -1035,7 +1035,7 @@ sub handle_yacc_lex_cxx
                              . '`if test -f $(srcdir)/' . $base . '.c'
                              . '; then echo $(srcdir)/' . $base . '.c'
                              . '; else echo ' . $base . '.c; fi` '
-                             . '| $(ANSI2KNR) ' . $base . "_.c\n");
+                             . '| $(ANSI2KNR) ' . $base . "_.c\n");
            push (@objects, $base . '_.o');
            push (@objects, $base . '_.lo') if $seen_libtool;
        }
index 7a8f536..30c157d 100644 (file)
@@ -1,3 +1,7 @@
+Mon Aug 10 21:05:15 1998  Tom Tromey  <tromey@cygnus.com>
+
+       * ansi3.test: New file.
+
 Sat Jul 18 00:27:26 1998  Tom Tromey  <tromey@cygnus.com>
 
        * recurs.test: New file.
index 7e41beb..4d0d3a1 100644 (file)
@@ -31,7 +31,8 @@ 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 libobj8.test version3.test instdata.test exdir2.test \
-colon5.test library.test syntax.test cond4.test cond5.test recurs.test
+colon5.test library.test syntax.test cond4.test cond5.test recurs.test \
+ansi3.test
 
 EXTRA_DIST = defs $(TESTS)
 
index be6af76..4fded1e 100644 (file)
@@ -94,7 +94,8 @@ 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 libobj8.test version3.test instdata.test exdir2.test \
-colon5.test library.test syntax.test cond4.test cond5.test recurs.test
+colon5.test library.test syntax.test cond4.test cond5.test recurs.test \
+ansi3.test
 
 EXTRA_DIST = defs $(TESTS)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff --git a/tests/ansi3.test b/tests/ansi3.test
new file mode 100755 (executable)
index 0000000..e42a7bd
--- /dev/null
@@ -0,0 +1,42 @@
+#! /bin/sh
+
+# Actual test of ansi2knr functionality.  Relies on existence
+# of working gcc.
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AC_INIT(hello.c)
+AM_INIT_AUTOMAKE(hello,0.23)
+AC_PROG_CC
+AM_C_PROTOTYPES
+AC_OUTPUT(Makefile)
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = ansi2knr
+bin_PROGRAMS = hello
+END
+
+cat > hello.c << 'END'
+#include <stdio.h>
+int
+main (int argc, char *argv[])
+{
+   printf ("yeah, yeah\n");
+   return 0;
+}
+END
+
+# Fail gracefully if no autoconf.
+(autoconf --version) > /dev/null 2>&1 || exit 0
+
+# Likewise for gcc.
+(gcc -v) > /dev/null 2>&1 || exit 0
+
+$ACLOCAL \
+   && autoconf \
+   && $AUTOMAKE -a \
+   && CC='gcc -traditional' ./configure \
+   && $MAKE ANSI2KNR=./ansi2knr U=_ \
+   && ./hello