From 6c3389c5e628b0585d58b8dd0cf3fe7f83a22837 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 11 Mar 1997 06:23:20 +0000 Subject: [PATCH] c++ -vs- libobjs fix --- ChangeLog | 5 +++++ THANKS | 3 ++- TODO | 2 ++ automake.in | 8 ++++++-- tests/ChangeLog | 4 ++++ tests/Makefile.am | 3 ++- tests/Makefile.in | 3 ++- tests/cxxlibobj.test | 25 +++++++++++++++++++++++++ 8 files changed, 48 insertions(+), 5 deletions(-) create mode 100755 tests/cxxlibobj.test diff --git a/ChangeLog b/ChangeLog index 034f95d..a925d79 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Mar 10 23:17:19 1997 Tom Tromey + + * automake.in (handle_lib_objects): Set seen_c_source as + appropriate. From Alexander V. Lukyanov. + Sat Mar 8 22:54:35 1997 Tom Tromey * texinfo.tex: New version. diff --git a/THANKS b/THANKS index 64d364f..b37e3ed 100644 --- a/THANKS +++ b/THANKS @@ -2,7 +2,7 @@ Automake was originally written by David J. MacKenzie . It would not be what it is today without the invaluable help of these people: -"Garrett D'Amore" +Alexander V. Lukyanov Andreas Schwab Anthony Green David A. Swierczek @@ -10,6 +10,7 @@ Dieter Baron Erick Branderhorst François Pinard Fred Fish +Garrett D'Amore Glenn Amerine Gord Matzigkeit Greg A. Woods diff --git a/TODO b/TODO index f71c718..b29d1f9 100644 --- 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 diff --git a/automake.in b/automake.in index ad07f18..0b1a873 100755 --- a/automake.in +++ b/automake.in @@ -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) diff --git a/tests/ChangeLog b/tests/ChangeLog index dcefe6d..4c8c81f 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +Mon Mar 10 23:21:03 1997 Tom Tromey + + * cxxlibobj.test: New file. + Wed Feb 26 13:05:42 1997 Tom Tromey * tagsub.test: New file. diff --git a/tests/Makefile.am b/tests/Makefile.am index bafa66a..b34b70d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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) diff --git a/tests/Makefile.in b/tests/Makefile.in index 0daa493..32bba0a 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 index 0000000..13add34 --- /dev/null +++ b/tests/cxxlibobj.test @@ -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 -- 2.7.4