From f641ac45d899e5f4be93bd084c191f4971e74b47 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 5 Mar 2001 07:49:42 +0000 Subject: [PATCH] * automake.in (register_language): Add entry for `-pure'. Added `pure=yes' entries for cxx, objc, f77, ppf77, ratfor, java. (finish_languages): Use `-pure' field of language map. --- ChangeLog | 6 ++++++ automake.in | 20 +++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 440bdcbb..51850342 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-03-05 Tom Tromey + + * automake.in (register_language): Add entry for `-pure'. + Added `pure=yes' entries for cxx, objc, f77, ppf77, ratfor, java. + (finish_languages): Use `-pure' field of language map. + 2001-03-03 Tom Tromey * tests/yaccvpath.test: No need to remove dummy files. diff --git a/automake.in b/automake.in index 6db3dbff..5cd3909b 100755 --- a/automake.in +++ b/automake.in @@ -375,12 +375,14 @@ my %configure_dist_common = (); 'compile=$(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)', 'compiler-name=CXXCOMPILE', 'output-arg=-c -o $@', + 'pure=yes', 'c++', 'cc', 'cpp', 'cxx', 'C'); ®ister_language ('objc', 'linker=OBJCLINK', 'autodep=OBJC', 'flags=OBJCFLAGS', 'compile=$(OBJC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)', 'compiler-name=OBJCCOMPILE', 'output-arg=-c -o $@', + 'pure=yes', 'm'); ®ister_language ('header', 'h', 'H', 'hxx', 'h++', 'hh', 'hpp', 'inc'); @@ -406,17 +408,20 @@ my %configure_dist_common = (); 'compile=$(F77) $(AM_FFLAGS) $(FFLAGS)', 'compiler-name=F77COMPILE', 'output-arg=-c -o $@', + 'pure=yes', 'f', 'for', 'f90'); ®ister_language ('ppf77', 'linker=F77LINK', 'flags=FFLAGS', 'compile=$(F77) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)', 'compiler-name=PPF77COMPILE', 'output-arg=-c -o $@', + 'pure=yes', 'F'); ®ister_language ('ratfor', 'linker=F77LINK', 'flags=RFLAGS', # FIXME also FFLAGS. 'compile=$(F77) $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) $(RFLAGS)', 'compiler-name=RCOMPILE', 'output-arg=-c -o $@', + 'pure=yes', 'r'); # FIXME: for now we can't do dependency tracking for Java. # autodep=GCJ @@ -424,6 +429,7 @@ my %configure_dist_common = (); 'compile=$(GCJ) $(DEFS) $(INCLUDES) $(AM_GCJFLAGS) $(GCJFLAGS)', 'compiler-name=GCJCOMPILE', 'output-arg=-c -o $@', + 'pure=yes', 'java', 'class', 'zip', 'jar'); @@ -1027,7 +1033,14 @@ sub finish_languages next if defined $done{$lang}; $done{$lang} = 1; - $non_c = 0 if $lang !~ /(objc|cxx|f77|ratfor)$/; + # If the source to a program consists entirely of code from a + # `pure' language, for instance C++ for Fortran 77, then we + # don't need the C compiler code. However if we run into + # something unusual then we do generate the C code. There are + # probably corner cases here that do not work properly. + # People linking Java code to Fortran code deserve pain. + $non_c = 0 + if $language_map{$lang . '-pure'} eq 'no'; if ($comp ne '') { @@ -5062,6 +5075,11 @@ sub register_language $language_map{$language . '-autodep'} = 'no'; $language_map{$language . '-derived-autodep'} = 'no'; + # `-pure' is `yes' or `no'. A `pure' language is one where, if + # all the files in a directory are of that language, then we do + # not require the C compiler or any code to call it. + $language_map{$language . '-pure'} = 'no'; + foreach my $iter (@options) { if ($iter =~ /^(.*)=(.*)$/) -- 2.43.5