From c0462bd490ff697ef9458a1cfc3659fb6b6ea631 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 1 Dec 1996 20:35:30 +0000 Subject: [PATCH] More fixes --- ChangeLog | 21 +++++++++++++ README-alpha | 6 ++++ TODO | 11 ++++++- automake.in | 78 +++++++++++++++++++++++++++-------------------- automake.texi | 12 ++------ lib/am/libtool.am | 5 +-- lib/am/progs.am | 4 ++- libtool.am | 5 +-- ltlibs.am | 6 ++-- m4/header.m4 | 2 +- progs.am | 4 ++- tests/ChangeLog | 4 +++ tests/extra2.test | 18 +++++++++++ version.texi | 2 +- 14 files changed, 124 insertions(+), 54 deletions(-) create mode 100755 tests/extra2.test diff --git a/ChangeLog b/ChangeLog index e1d1bb7a..7f0363c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,26 @@ Sun Nov 24 00:33:50 1996 Tom Tromey + * automake.in (handle_source_transform): Don't define + EXTRA_prog_SOURCES unnecessarily. Test extra2.test. + + * automake.in (initialize_per_input): New variables + included_generic_compile, included_knr_compile, + included_libtool_compile. + (get_object_extension): Use them. + + * automake.in (handle_single_transform_list): Removed + Objective-C/C++ support (didn't really work anyway). + (handle_single_transform_list): Handle assembly specially. + + * automake.in (handle_yacc_lex_cxx): Set --mode=compile or + --mode=link when running libtool. + + * ltlibs.am: Set --mode=install when running libtool. + (uninstall-@DIR@PROGRAMS): Set --mode=uninstall when running + libtool. + * libtool.am (.c.lo): Set --mode=compile when running libtool. + * progs.am: Set --mode=install when running libtool. + Fix for bug reported by François Pinard: * automake.in (do_check_merge_target): New sub. (do_one_merge_target): No longer handle `check'. diff --git a/README-alpha b/README-alpha index 61b8d337..fceb6054 100644 --- a/README-alpha +++ b/README-alpha @@ -4,6 +4,12 @@ GNU mailing list or newsgroup. A few notes on this particular release: +* automake now requires a very recent version of autoconf. + +* Fortran support will be in the next release + +A few things that I still haven't gotten to fixing: + * The `missing' program is still not in use. * The `acinstall' program is distributed but not used; I still must diff --git a/TODO b/TODO index 951dd677..6ce01b7e 100644 --- a/TODO +++ b/TODO @@ -11,7 +11,12 @@ Priorities for release: * Scan multiple input files when Makefile is generated? This would provide flexibility for large projects; subsumes the "Makefile.tmpl" idea - Figuring out when to update the sub-parts is hard, maybe + + [ can't do this. must explain why in manual. + basically, solving all the problems is too hard + like: how to remove redundancies between generated .in files + instead should implement `include' directive for Makefile.am ] + * figure out what to pass as CONFIG_HEADER to config.status * look @ jim's $(t:=foo) problem @@ -19,6 +24,10 @@ Priorities for release: * should install-foo target for a new dir (eg fooexecdir) be run via install-data or install-exec? Consider examining name of variable. +* no mention of $(LIBTOOL) in "clean" Makefile (?) + +* compatibility with older versions of autoconf if not --gnu + ================================================================ * only remove libtool at top level? diff --git a/automake.in b/automake.in index d443252c..3d98e8de 100755 --- a/automake.in +++ b/automake.in @@ -591,11 +591,14 @@ sub get_object_extension { local ($out) = @_; + # Always set this. + $dir_holds_sources = 1; + # Maybe require libtool library object files. - local ($l) = ''; + local ($l, $extension) = ('', 'o'); $l = 'l' if ($out =~ /^lib.*\.la$/); - if (! $dir_holds_sources) + if (! $included_generic_compile) { # Boilerplate. local ($xform) = ''; @@ -623,22 +626,29 @@ sub get_object_extension } } - # Check for automatic de-ANSI-fication. - $dir_holds_sources = 'o'; push (@suffixes, '.c', '.o'); push (@clean, 'compile'); - if ($seen_libtool) - { - # Output the libtool compilation rules. - $output_rules .= &file_contents ('libtool'); - &push_phony_cleaners ('libtool'); + $included_generic_compile = 1; + } - push (@suffixes, '.lo'); - push (@clean, 'libtool'); - } + if ($seen_libtool && ! $included_libtool_compile) + { + # Output the libtool compilation rules. + $output_rules .= &file_contents ('libtool'); + &push_phony_cleaners ('libtool'); + + push (@suffixes, '.lo'); + push (@clean, 'libtool'); + + $included_libtool_compile = 1; + } - if (defined $options{'ansi2knr'}) + # Check for automatic de-ANSI-fication. + if (defined $options{'ansi2knr'}) + { + $extension = '$o'; + if (! $included_knr_compile) { if (! $am_c_prototypes) { @@ -649,8 +659,8 @@ sub get_object_extension $am_c_prototypes = 1; } - $dir_holds_sources = '$o'; push (@suffixes, '._c', '._o'); + push (@suffixes, '._lo') if $seen_libtool; # Only require ansi2knr files if they should appear in # this directory. @@ -686,11 +696,11 @@ sub get_object_extension push (@clean, 'kr'); &push_phony_cleaners ('kr'); - # FIXME - should be able to do libtool objects, too. + $included_knr_compile = 1; } } - return '.' . $l . $dir_holds_sources; + return '.' . $l . $extension; } # Handle yacc and lex. @@ -768,7 +778,7 @@ sub handle_yacc_lex_cxx if ($seen_libtool) { &define_configure_variable ("LIBTOOL"); - $libtool = '$(LIBTOOL) '; + $libtool = '$(LIBTOOL) --mode=link '; } # @@ -790,7 +800,7 @@ sub handle_yacc_lex_cxx $output_rules .= ("$ext.o:\n" . "\t\$(CXXCOMPILE) -c \$<\n"); $output_rules .= ("$ext.lo:\n" - . "\t\$(LIBTOOL) $(CXXCOMPILE) -c \$<\n") + . "\t\$(LIBTOOL) --mode=compile $(CXXCOMPILE) -c \$<\n") if ($seen_libtool); } @@ -917,10 +927,13 @@ sub handle_single_transform_list { # FORTRAN support. FIXME: not finished. } - elsif (s/\.[clysmM]$/._o/) + elsif (s/\.s$/.o/) + { + # .s is assembly. Just rewrite it. FIXME: not finished. + } + elsif (s/\.[cly]$/._o/) { - # .c is C. .l is lex. .y is yacc. .s is assembly. - # .M is Objective-C++. .m is Objective-C. + # .c is C. .l is lex. .y is yacc. # Note: first we rewrite (eg) foo.c to foo._o and push # the file onto the list of objects that require @@ -929,10 +942,6 @@ sub handle_single_transform_list # required. $de_ansi_objects{$_} = 1; s/\._o$/$obj/; - - # FIXME: of course, this should only happen for C - # source. The multi-language support must really be - # cleaned up more globally. $seen_c_source = 1; } else @@ -999,10 +1008,6 @@ sub handle_source_transform push (@objects, $unxformed . $obj); push (@files, $unxformed . '.c'); } - else - { - &define_variable ("EXTRA_" . $one_file . "_SOURCES", ''); - } ($temp, @result) = &handle_single_transform_list (@files); $linker = $temp if $linker eq ''; @@ -3933,10 +3938,17 @@ sub initialize_per_input @sources = (); @objects = (); - # TRUE if current directory holds any C source files. (Actually - # holds object extension, but this information is encapsulated in - # the function get_object_extension). - $dir_holds_sources = ''; + # TRUE if current directory holds any C source files. + $dir_holds_sources = 0; + + # These variables track inclusion of various compile-related .am + # files. $included_generic_compile is TRUE if the basic code has + # been included. $included_knr_compile is TRUE if the ansi2knr + # code has been included. $included_libtool_compile is TRUE if + # libtool support has been included. + $included_generic_compile = 0; + $included_knr_compile = 0; + $included_libtool_compile = 0; # TRUE if current directory holds any headers. $dir_holds_headers = 0; diff --git a/automake.texi b/automake.texi index 8e58e9aa..3d896a10 100644 --- a/automake.texi +++ b/automake.texi @@ -7,14 +7,6 @@ @include version.texi -@c Yes, this appears in many Texinfo files. He's just a likeable guy. -@ifinfo -@set Francois Franc,ois -@end ifinfo -@tex -@set Francois Fran\noexpand\ptexc cois -@end tex - @dircategory GNU admin @direntry * automake: (automake). Making Makefile.in's @@ -28,7 +20,7 @@ @ifinfo This file documents GNU automake @value{VERSION} -Copyright (C) 1995 Free Software Foundation, Inc. +Copyright (C) 1995, 96 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -59,7 +51,7 @@ by the Foundation. @c copyright page @page @vskip 0pt plus 1filll -Copyright @copyright{} 1995 Free Software Foundation, Inc. +Copyright @copyright{} 1995, 96 Free Software Foundation, Inc. @sp 2 This is the first edition of the GNU Automake documentation,@* and is consistent with GNU Automake @value{VERSION}.@* diff --git a/lib/am/libtool.am b/lib/am/libtool.am index 0c3e6a4f..512b839b 100644 --- a/lib/am/libtool.am +++ b/lib/am/libtool.am @@ -16,10 +16,11 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. .c.lo: - $(LIBTOOL) $(COMPILE) -c $< +## Note that we explicitly set the libtool mode. This avoids any lossage +## if the program doesn't have a name that libtool expects. + $(LIBTOOL) --mode=compile $(COMPILE) -c $< mostlyclean-libtool: -## Don't remove 'core.*' because some distributions have eg "core.c". rm -f *.lo clean-libtool: diff --git a/lib/am/progs.am b/lib/am/progs.am index bd667e47..401a3a30 100644 --- a/lib/am/progs.am +++ b/lib/am/progs.am @@ -25,7 +25,9 @@ install-@DIR@PROGRAMS: $(@DIR@_PROGRAMS) ## It is harmless to unconditionally use $(LIBTOOL) here because it ## will be null in non-libtoolized packages, and even if it is set to ## a real libtool, its behaviour is identical to normal INSTALL_PROGRAM. - $(LIBTOOL) $(INSTALL_PROGRAM) $$p $(@DIR@dir)/`echo $$p|sed '$(transform)'`; \ +## Note that we explicitly set the libtool mode. This avoids any lossage +## if the program doesn't have a name that libtool expects. + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(@DIR@dir)/`echo $$p|sed '$(transform)'`; \ else :; fi; \ done diff --git a/libtool.am b/libtool.am index 0c3e6a4f..512b839b 100644 --- a/libtool.am +++ b/libtool.am @@ -16,10 +16,11 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. .c.lo: - $(LIBTOOL) $(COMPILE) -c $< +## Note that we explicitly set the libtool mode. This avoids any lossage +## if the program doesn't have a name that libtool expects. + $(LIBTOOL) --mode=compile $(COMPILE) -c $< mostlyclean-libtool: -## Don't remove 'core.*' because some distributions have eg "core.c". rm -f *.lo clean-libtool: diff --git a/ltlibs.am b/ltlibs.am index 92b15975..12996e35 100644 --- a/ltlibs.am +++ b/ltlibs.am @@ -22,11 +22,13 @@ install-@DIR@PROGRAMS: $(@DIR@_PROGRAMS) ## a syntax error in sh. list="$(@DIR@_PROGRAMS)"; for p in $$list; do \ if test -f $$p; then \ - $(LIBTOOL) $(INSTALL_PROGRAM) $$p $(@DIR@dir)/$$p; \ +## Note that we explicitly set the libtool mode. This avoids any lossage +## if the program doesn't have a name that libtool expects. + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(@DIR@dir)/$$p; \ else :; fi; \ done uninstall-@DIR@PROGRAMS: list="$(@DIR@_PROGRAMS)"; for p in $$list; do \ - $(LIBTOOL) rm -f $(@DIR@dir)/$$p; \ + $(LIBTOOL) --mode=uninstall rm -f $(@DIR@dir)/$$p; \ done diff --git a/m4/header.m4 b/m4/header.m4 index 6b15c345..c2592232 100644 --- a/m4/header.m4 +++ b/m4/header.m4 @@ -1,7 +1,7 @@ # Like AC_CONFIG_HEADER, but automatically create stamp file. AC_DEFUN(AM_CONFIG_HEADER, -[AC_PREREQ([2.11.2]) +[AC_PREREQ([2.12]) AC_CONFIG_HEADER([$1]) dnl When config.status generates a header, we must update the stamp-h file. dnl This file resides in the same directory as the config header diff --git a/progs.am b/progs.am index bd667e47..401a3a30 100644 --- a/progs.am +++ b/progs.am @@ -25,7 +25,9 @@ install-@DIR@PROGRAMS: $(@DIR@_PROGRAMS) ## It is harmless to unconditionally use $(LIBTOOL) here because it ## will be null in non-libtoolized packages, and even if it is set to ## a real libtool, its behaviour is identical to normal INSTALL_PROGRAM. - $(LIBTOOL) $(INSTALL_PROGRAM) $$p $(@DIR@dir)/`echo $$p|sed '$(transform)'`; \ +## Note that we explicitly set the libtool mode. This avoids any lossage +## if the program doesn't have a name that libtool expects. + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(@DIR@dir)/`echo $$p|sed '$(transform)'`; \ else :; fi; \ done diff --git a/tests/ChangeLog b/tests/ChangeLog index 8aefc528..c6bff3ac 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +Sun Nov 24 14:36:00 1996 Tom Tromey + + * extra2.test: New file. + Fri Nov 22 00:10:04 1996 Tom Tromey * stdlib.test: New file. diff --git a/tests/extra2.test b/tests/extra2.test new file mode 100755 index 00000000..27a6f0eb --- /dev/null +++ b/tests/extra2.test @@ -0,0 +1,18 @@ +#! /bin/sh + +# Check to make sure EXTRA_foo_SOURCES not defined unnecessarily. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = foo +END + +$AUTOMAKE || exit 1 + +grep EXTRA_foo_SOURCES Makefile.in && exit 1 +exit 0 diff --git a/version.texi b/version.texi index 21068a39..fc7b8194 100644 --- a/version.texi +++ b/version.texi @@ -1,3 +1,3 @@ -@set UPDATED 21 November 1996 +@set UPDATED 28 November 1996 @set EDITION 1.1h @set VERSION 1.1h -- 2.43.5