From: Tom Tromey Date: Tue, 6 Aug 1996 23:52:04 +0000 (+0000) Subject: Start of multi-language support X-Git-Tag: Release-1-1c~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60e5f35c142c6110d91de61459b810dca94ca371;p=thirdparty%2Fautomake.git Start of multi-language support --- diff --git a/ChangeLog b/ChangeLog index ebbb9489e..4ac35bc4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,16 @@ Tue Aug 6 10:58:37 1996 Tom Tromey + * automake.in (handle_source_transform): Handle more C++ file + extensions. "Handle" Objective C. Handle more FORTRAN + extensions. + + * compile-vars.am (LEX): Removed. + (YACC): Removed. + * automake.in (handle_source_transform): Correctly handle lex - source. Test lex.test + source. Test lex.test. + (handle_source_transform): Skip more C++ headers. Generate macro + definitions for YACC and LEX on first use. * aclocal.in (parse_arguments): Mention GNU. * automake.in (parse_arguments): Mention GNU. diff --git a/TODO b/TODO index 0473c1807..33b146f3a 100644 --- a/TODO +++ b/TODO @@ -3,9 +3,6 @@ Priorities for release: ** when can aclocal.m4 be auto-generated? -** Consider using implicit .y.c and .l.c rules instead of current - lex/yacc trickery - multi-language support. Gord's idea is to have _FORTRAN_PROGRAMS, _CXX_PROGRAMS, etc, and have the right linker used by each. * seems to handle multi-language stuff ok ? @@ -16,6 +13,7 @@ _CXX_PROGRAMS, etc, and have the right linker used by each. ** many requests for a way to omit a file from the distribution. Should be done like `!foo' or `~foo' in _SOURCES, etc. Such files should be removed explicitly after the copy step! + Doing this requires rewriting macros before generating Makefile.in. add support for Makefile.tmpl that is auto-included in every Makefile.am. That makes it easier to do some non-std thing in every @@ -161,10 +159,13 @@ Lex, yacc support: * Consider supporting syntax from autoconf "derived:source", eg: y.tab.c:perly.y for yacc and lex source -* if AC_PROG_LEX used, ensure LEXLIB is in foo_LDADD +* if AC_PROG_LEX used, ensure (no, *PUT*) LEXLIB in foo_LDADD * require AC_DECL_YYTEXT for lex * Actually use $seen_prog_yacc * Require AC_PROG_LEX or equivalent +* Consider using implicit .y.c and .l.c rules instead of current + lex/yacc trickery + require AC_PROG_CXX if any C++ source files found? Better support for C++ all around diff --git a/automake.in b/automake.in index e7278ee84..10eed51c9 100755 --- a/automake.in +++ b/automake.in @@ -598,9 +598,14 @@ sub handle_source_transform local (@result) = (); foreach (@files) { - # Skip header files, including C++-ish ones. + # Skip header files, including C++-ish ones. The list + # of C++ header extensions comes from Emacs 19.32 + # etags. next if /\.[hH]$/; next if /\.hxx$/; + next if /\.h\+\+$/; + next if /\.hh$/; + next if /\.hpp$/; # Skip things that look like macro references. next if /^\$\(.*\)$/; next if /^\$\{.*\}$/; @@ -620,6 +625,12 @@ sub handle_source_transform . 'cd $(srcdir) && $(YACC) $(YFLAGS) $< && mv y.tab.c ' . $1 . '.c' . "\n"); } + + if (! &variable_defined ('YACC')) + { + $output_vars .= "YACC = \@YACC\@\n"; + $targets{'YACC'} = 1; + } } elsif (/^(.*)\.l$/) { @@ -632,12 +643,29 @@ sub handle_source_transform . 'cd $(srcdir) && $(LEX) $(LFLAGS) $< && mv lex.yy.c ' . $1 . '.c' . "\n"); } + + if (! &variable_defined ('LEX')) + { + $output_vars .= "LEX = \@YACC\@\n"; + $targets{'LEX'} = 1; + } } - # Transform source files into .o files. + # Transform source files into .o files. List of C++ + # extensions comes from Emacs 19.32 etags. + s/\.c\+\+$/$obj/g; s/\.cc$/$obj/g; + s/\.cpp$/$obj/g; s/\.cxx$/$obj/g; - s/\.[cCmylfs]$/$obj/g; + + # FORTRAN support. + s/\.f90$/$obj/g; + s/\.for$/$obj/g; + + # .C is C++. .y is yacc. .l is lex. .f and .F is + # fortran. .s is assembly. .M is Objective-C++. .m + # is Objective-C. + s/\.[cCylfFsmM]$/$obj/g; push (@result, $_) unless $prefix eq 'EXTRA_'; diff --git a/compile-vars.am b/compile-vars.am index 2815629ff..d732b3096 100644 --- a/compile-vars.am +++ b/compile-vars.am @@ -16,8 +16,6 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. CC = @CC@ -LEX = @LEX@ -YACC = @YACC@ DEFS = @DEFS@ -I. -I$(srcdir) @CONFIG_INCLUDE_SPEC@ CPPFLAGS = @CPPFLAGS@