c++ -vs- libobjs fix
authorTom Tromey <tromey@redhat.com>
Tue, 11 Mar 1997 06:23:20 +0000 (06:23 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 11 Mar 1997 06:23:20 +0000 (06:23 +0000)
ChangeLog
THANKS
TODO
automake.in
tests/ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/cxxlibobj.test [new file with mode: 0755]

index 034f95d..a925d79 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Mar 10 23:17:19 1997  Tom Tromey  <tromey@cygnus.com>
+
+       * automake.in (handle_lib_objects): Set seen_c_source as
+       appropriate.  From Alexander V. Lukyanov.
+
 Sat Mar  8 22:54:35 1997  Tom Tromey  <tromey@cygnus.com>
 
        * texinfo.tex: New version.
diff --git a/THANKS b/THANKS
index 64d364f..b37e3ed 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -2,7 +2,7 @@ Automake was originally written by David J. MacKenzie <djm@uunet.uu.net>.
 It would not be what it is today without the invaluable help of these
 people:
 
-"Garrett D'Amore" <garrett@qualcomm.com>
+Alexander V. Lukyanov <lav@yars.free.net>
 Andreas Schwab <schwab@lamothe.informatik.uni-dortmund.de>
 Anthony Green <green@cygnus.com>
 David A. Swierczek <swiercze@mr.med.ge.com>
@@ -10,6 +10,7 @@ Dieter Baron <dillo@stieltjes.smc.univie.ac.at>
 Erick Branderhorst <branderh@iaehv.nl>
 François Pinard <pinard@iro.umontreal.ca>
 Fred Fish <fnf@ninemoons.com>
+Garrett D'Amore <garrett@qualcomm.com>
 Glenn Amerine <glenn@pie.mhsc.org>
 Gord Matzigkeit <gord@enci.ucalgary.ca>
 Greg A. Woods <woods@most.weird.com>
diff --git a/TODO b/TODO
index f71c718..b29d1f9 100644 (file)
--- a/TODO
+++ b/TODO
@@ -245,6 +245,8 @@ Lex, yacc support:
 * Consider supporting syntax from autoconf "derived:source", eg:
        y.tab.c:perly.y
   for yacc and lex source
+* what if you use flex and the option to avoid -lfl?
+  should support this?
 
 Multi-language support:
 * should have mapping of file extensions to languages
index ad07f18..0b1a873 100755 (executable)
@@ -1220,7 +1220,11 @@ sub handle_lib_objects
            local ($iter, $rewrite);
            foreach $iter (keys %libsources)
            {
-               if ($iter =~ /\.h$/)
+               if ($iter =~ /\.[cly]$/)
+               {
+                   $seen_c_source = 1;
+               }
+               elsif ($iter =~ /\.h$/)
                {
                    &require_file_with_line ($var, $FOREIGN, $iter);
                }
@@ -1240,6 +1244,7 @@ sub handle_lib_objects
                if ! defined $libsources{'alloca.c'};
            $dep_files{'.deps/alloca.P'} = 1;
            &require_file_with_line ($var, $FOREIGN, 'alloca.c');
+           $seen_c_source = 1;
        }
        elsif ($lsearch eq '@LEXLIB@')
        {
@@ -1249,7 +1254,6 @@ sub handle_lib_objects
            # made, I think.
            $lex_ok = 1;
        }
-
     }
 
     if (! $lex_ok)
index dcefe6d..4c8c81f 100644 (file)
@@ -1,3 +1,7 @@
+Mon Mar 10 23:21:03 1997  Tom Tromey  <tromey@cygnus.com>
+
+       * cxxlibobj.test: New file.
+
 Wed Feb 26 13:05:42 1997  Tom Tromey  <tromey@cygnus.com>
 
        * tagsub.test: New file.
index bafa66a..b34b70d 100644 (file)
@@ -23,7 +23,8 @@ distdir.test lex2.test libobj4.test libobj5.test version.test \
 ranlib.test confvar.test confvar2.test stdlib.test cxxo.test \
 colon2.test colon3.test remake.test output.test output2.test \
 remake2.test output3.test output4.test colneq2.test subst.test \
-defun2.test yaccpp.test texinfo3.test texinfo4.test tagsub.test
+defun2.test yaccpp.test texinfo3.test texinfo4.test tagsub.test \
+cxxlibobj.test
 
 EXTRA_DIST = defs $(TESTS)
 
index 0daa493..32bba0a 100644 (file)
@@ -66,7 +66,8 @@ distdir.test lex2.test libobj4.test libobj5.test version.test \
 ranlib.test confvar.test confvar2.test stdlib.test cxxo.test \
 colon2.test colon3.test remake.test output.test output2.test \
 remake2.test output3.test output4.test colneq2.test subst.test \
-defun2.test yaccpp.test texinfo3.test texinfo4.test tagsub.test
+defun2.test yaccpp.test texinfo3.test texinfo4.test tagsub.test \
+cxxlibobj.test
 
 EXTRA_DIST = defs $(TESTS)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff --git a/tests/cxxlibobj.test b/tests/cxxlibobj.test
new file mode 100755 (executable)
index 0000000..13add34
--- /dev/null
@@ -0,0 +1,25 @@
+#! /bin/sh
+
+# Test to make sure LIBOBJS and C++ sources work right.
+
+. $srcdir/defs || exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CXX
+AC_PROG_CC
+AC_REPLACE_FUNCS(strdup)
+END
+
+cat > Makefile.am << 'END'
+sbin_PROGRAMS = anonymous
+anonymous_SOURCES = doe.C jane.C
+anonymous_LDADD = @LIBOBJS@
+END
+
+: > strdup.c
+: > doe.C
+: > jane.C
+
+$AUTOMAKE || exit 1
+
+grep CC Makefile.in