Start of multi-language support
authorTom Tromey <tromey@redhat.com>
Tue, 6 Aug 1996 23:52:04 +0000 (23:52 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 6 Aug 1996 23:52:04 +0000 (23:52 +0000)
ChangeLog
TODO
automake.in
compile-vars.am

index ebbb948..4ac35bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,16 @@
 Tue Aug  6 10:58:37 1996  Tom Tromey  <tromey@creche.cygnus.com>
 
+       * 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 0473c18..33b146f 100644 (file)
--- 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
index e7278ee..10eed51 100755 (executable)
@@ -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_';
 
index 2815629..d732b30 100644 (file)
@@ -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@