From 7e8df9b77e2aa4eb7e75b45bca13fb604fdf176f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 11 Oct 1996 07:18:34 +0000 Subject: [PATCH] Don't rewrite .cc files when de-ansifying. Lex fixups --- ChangeLog | 3 +++ TODO | 5 +---- automake.in | 34 +++++++++++++++++++++------------- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8d5714c5..6adbd930 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ Fri Oct 11 00:44:49 1996 Tom Tromey + * automake.in (handle_source_transform): Only rewrite c, yacc, lex + to use de-ansi-fication. + * automake.in (handle_lib_objects): Added $lex_seen argument. Error if lex file used but LEXLIB not seen. (handle_programs): Ditto. diff --git a/TODO b/TODO index c1d5c879..00657056 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,5 @@ Priorities for release: +!! MUST finish new deansification scheme... !! documentation (eg new macros) * `acinstall' * echo in installs? @@ -253,10 +254,6 @@ Some things for --strictness=gnits: * Look for 'ln -s' and warn about using $(LN) and AC_PROG_LN_S * Look for $(LN) and require AC_PROG_LN_S -automake.in: should ".cc" really -> "$o"? This doesn't really seem -right, but maybe it is so names can be rewritten uniformly? Must -check - Auto-distribute "ChangeLog.[0-9]+"? "ChangeLog.[a-z]+"? Internationalize. [ gettext doesn't have the necessary machinery yet ] diff --git a/automake.in b/automake.in index 0aa5d225..164d1013 100755 --- a/automake.in +++ b/automake.in @@ -781,6 +781,8 @@ sub handle_source_transform local ($one_file, $unxformed, $obj) = @_; local ($objpat) = $obj; $objpat =~ s/(\W)/\\$1/g; + # Handle explicit `.o' as well as whatever we're passed. + $objpat = '(' . $objpat . "|\\.o)"; local ($linker) = ''; @@ -861,11 +863,11 @@ sub handle_source_transform # Transform source files into .o files. List of C++ # extensions comes from Emacs 19.32 etags. - if (s/\.c\+\+$/$obj/g - || s/\.cc$/$obj/g - || s/\.cpp$/$obj/g - || s/\.cxx$/$obj/g - || s/\.C$/$obj/g) + if (s/\.c\+\+$/.o/g + || s/\.cc$/.o/g + || s/\.cpp$/.o/g + || s/\.cxx$/.o/g + || s/\.C$/.o/g) { $cxx_extensions{$&} = 1; $linker = 'CXXLINK'; @@ -873,13 +875,17 @@ sub handle_source_transform else { # FORTRAN support. FIXME: not finished. - s/\.f90$/$obj/g; - s/\.for$/$obj/g; + s/\.f90$/.o/g; + s/\.for$/.o/g; - # .y is yacc. .l is lex. .f and .F is fortran. - # .s is assembly. .M is Objective-C++. .m is - # Objective-C. - s/\.[cylfFsmM]$/$obj/g; + # C, yacc, and lex need special $obj extension, + # for de-ansification. Hopefully someday this + # will go away. + s/\.[cly]$/$obj/g; + + # .f and .F is fortran. .s is assembly. .M is + # Objective-C++. .m is Objective-C. + s/\.[fFsmM]$/$obj/g; # FIXME: of course, this should only happen for C # source. The multi-language support must really @@ -932,7 +938,9 @@ sub handle_lib_objects # LDADD. local ($lsearch); local (@dep_list) = (); - local ($lex_ok) = 0; + + # If no lex source seen, just assume this is ok. + local ($lex_ok) = $lex_seen ? 0 : 1; foreach $lsearch (&variable_value_as_list ($var)) { @@ -1612,7 +1620,7 @@ sub handle_dist_worker # Prepend $(distdir) to each directory given. Doing it via a # hash lets us ensure that each directory is used only once. local (%dhash); - grep ($dhash{'$(distdir)/' . _} = 1, @dist_dirs); + grep ($dhash{'$(distdir)/' . $_} = 1, @dist_dirs); $output_rules .= "\t"; &pretty_print_rule ('$(mkinstalldirs)', "\t ", sort keys %dhash); } -- 2.43.5