From 76290aa7b217907d3ff796aae35f287a6f562d61 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 26 Apr 1996 04:43:26 +0000 Subject: [PATCH] More bug fixes --- ChangeLog | 14 ++++++++++++++ TODO | 20 ++++++++++++-------- automake.in | 47 +++++++++++++++++++++++++++++++++++++++++------ automake.texi | 9 ++++++++- dist-vars.am | 2 ++ tests/ChangeLog | 4 ++++ tests/Makefile.am | 2 +- tests/Makefile.in | 4 +++- tests/exdir.test | 2 +- tests/noinst.test | 18 ++++++++++++++++++ version.texi | 2 +- 11 files changed, 105 insertions(+), 19 deletions(-) create mode 100755 tests/noinst.test diff --git a/ChangeLog b/ChangeLog index c91e02d8e..05d4121da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +Thu Apr 25 18:40:06 1996 Tom Tromey + + * automake.in (handle_dist_worker): Use $(TAR), not tar. + (handle_merge_targets): Make sure config header is built before + recursing into subdirs. + (handle_libraries): Generate LIBFILES for check_LIBRARIES. + (handle_merge_targets): Handle case where nothing is installed but + something must be built -- "make install" must still work. + + * dist-vars.am (TAR): New macro. + + * automake.in (scan_configure): Support AC_REPLACE_GNU_GETOPT. + (handle_configure): Require stamp-h.in when config header used. + Tue Apr 23 17:57:13 1996 Andreas Schwab * doc/mdate-sh: Extract the last field from the date output, not diff --git a/TODO b/TODO index eb663a4a2..c7e808d3b 100644 --- a/TODO +++ b/TODO @@ -1,19 +1,18 @@ Priorities for release: -??? targets for EXTRA_ should not be generated!!! * Fix all mkinstalldirs invocations * separate dist and distdir targets, so recursive uses of Automake work ok +* make the auto-dep code crash if GNU make not in use? * Add no-remake option * scripts are installed in $exec_prefix/bin, not $prefix/bin Bug or feature? -* Add support for libtool -* At top level, config.h is not depended on... -* Must look for/enforce existence of stamp-h.in in srcdir? - ... there is something broken here... * Should be a way to have "nobuild_PROGRAMS" which aren't even built, but which could be by running the magic make command. +* Should have tool like "autoreconf" that only remakes Makefiles that + need it. Probably autoreconf should be modified to handle automake + Other priorities: * Must rewrite am_install_var. Should break into multiple functions. This will allow the callers to be a little smarter. @@ -27,8 +26,6 @@ Things to finish libtool support: * Handle clean changes * New definition for LINK -* search for gnu tar and substitute in dist targets? - Scan source directories and warn about missing files, eg .c/.h files that aren't mentioned? @@ -41,7 +38,8 @@ Currently gettext requires @INTLSUB@ and @POSUB@ in SUBDIRS. In the future this will be just intl and po. When that happens, re-enable warnings in handle_subdirs. -Need way to say there are no suffixes in a Makefile +Need way to say there are no suffixes in a Makefile (Franc,ois' +"override" idea suffices here) Check to make sure various scripts are executable (IE when looking for them in a directory) @@ -59,6 +57,9 @@ MAINT_CHARSET and DIST_CHARSET are not identical. NOTE: gettext must arrange for all .po files not to be recoded. In the long term this might be a problem (consider when some systems use Unicode but the rest do not) + MAINT_CHARSET *must* be local to each Makefile.am, to enable + merged distributions. + DIST_CHARSET must be passed down to subdir makes during a "make dist" Handle dist-zoo and dist-zip. Generally add more DOS support. Maybe run "doschk" (why isn't this merged with "pathchk"?) when doing a @@ -222,6 +223,9 @@ Make a definition of the term "source" need xref to libtool in docs +document how to use Automake with CVS. Idea from Mark Galassi. Also +include Greg Woods' more sophisticated "cvs-dist" target. + ================================================================ Libraries: diff --git a/automake.in b/automake.in index 1499d72b4..ef6aed420 100755 --- a/automake.in +++ b/automake.in @@ -722,7 +722,7 @@ sub handle_libraries # am_install_var. local ($onedir, $onelib); local (@outlist); - foreach $onedir ('lib', 'pkglib', 'noinst') + foreach $onedir ('lib', 'pkglib', 'noinst', 'check') { if (&variable_defined ($onedir . '_LIBRARIES')) { @@ -1171,7 +1171,7 @@ sub handle_dist_worker } else { - $output_rules .= 'tar chozf $(distdir).tar.gz $(distdir)'; + $output_rules .= '$(TAR) chozf $(distdir).tar.gz $(distdir)'; } $output_rules .= "\n\t" . 'rm -rf $(distdir)' . "\n"; } @@ -1399,7 +1399,8 @@ sub handle_configure &push_dist_common ($config_name . '.bot'); } - &push_dist_common ('stamp-h.in'); + &require_file_with_conf_line ($config_header_line, $FOREIGN, + 'stamp-h.in'); $output_rules .= &file_contents ('remake-hdr'); $output_vars .= "CONFIG_HEADER_IN = ${config_header}\n"; @@ -1613,10 +1614,33 @@ sub handle_merge_targets if (@all) { + local (@hackall) = (); + if ($config_name && &dirname ($config_name) eq $relative_dir) + { + + # This is kind of a hack, but I couldn't see a better + # way to handle it. In this particular case, we need + # to make sure config.h is built before we recurse. + # We can't do this by changing the order of + # dependencies to the "all" because that breaks when + # using parallel makes. Instead we handle things + # explicitly. + $output_rules .= ('all-recursive-hack: $(CONFIG_HEADER)' + . "\n\t" . '$(MAKE) all-recursive' + . "\n\n"); + push (@hackall, 'all-recursive-hack'); + push (@phony, 'all-recursive-hack'); + } + else + { + push (@hackall, 'all-recursive'); + } + $output_rules .= ('all-am: ' . join (' ', @all) . "\n\n"); - @all = ('all-recursive', 'all-am'); + @all = @hackall; + push (@all, 'all-am'); push (@phony, 'all-am'); } else @@ -1663,7 +1687,8 @@ sub handle_merge_targets } } - # Step three: print definitions users can use. + # Step three: print definitions users can use. Code below knows + # that install-exec is done before install-data, beware. $output_rules .= ("install-exec: " . join (' ', @install_exec) . "\n"); @@ -1689,7 +1714,12 @@ sub handle_merge_targets # If no dependencies for 'install', add 'all'. Why? That way # "make install" at top level of distclean'd distribution won't # fail because stuff in 'lib' fails to build. - push (@install, 'all') if ! @install; + if (! @install || ($#install == 1 + && $install[0] eq 'install-exec' + && $install[1] eq 'install-data')) + { + push (@install, 'all'); + } $output_rules .= ('install: ' . join (' ', @install) # Use "@:" as empty command so nothing prints. @@ -1896,6 +1926,11 @@ sub scan_configure $libsources{$_ . '.c'} = 1; } } + elsif (/AC_REPLACE_GNU_GETOPT/) + { + $libsources{'getopt.c'} = 1; + $libsources{'getopt1.c'} = 1; + } elsif (/LIBOBJS="(.*)\s+\$LIBOBJS"/ || /LIBOBJS="\$LIBOBJS\s+(.*)"/) { diff --git a/automake.texi b/automake.texi index 1ecc3aa51..74ac7d147 100644 --- a/automake.texi +++ b/automake.texi @@ -432,7 +432,12 @@ and their effects are: @table @code @item AC_CONFIG_HEADER Automake will generate rules to automatically regenerate the config -header. +header. If you do use this macro, you must create the file +@file{stamp-h.in}. It can be empty. Also, the @code{AC_OUTPUT} command +in @file{configure.in} must create @file{stamp-h}, eg: +@example +AC_OUTPUT(Makefile, [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h]) +@end example @cvindex AC_CONFIG_HEADER @item AC_CONFIG_AUX_DIR @@ -470,6 +475,7 @@ exist. @item fp_FUNC_FNMATCH @item AC_FUNC_FNMATCH @item AC_REPLACE_FUNCS +@item AC_REPLACE_GNU_GETOPT Automake will ensure that the appropriate source files are part of the distribution, and will ensure that the appropriate dependencies are generated for these objects. @xref{A Library} for more @@ -481,6 +487,7 @@ information. @cvindex fp_FUNC_FNMATCH @cvindex AC_FUNC_FNMATCH @cvindex AC_REPLACE_FUNCS +@cvindex AC_REPLACE_GNU_GETOPT Automake will also detect statements which put @samp{.o} files into @code{LIBOBJS}, and will treat these additional files in a similar way. diff --git a/dist-vars.am b/dist-vars.am index 69013afd7..13db7569b 100644 --- a/dist-vars.am +++ b/dist-vars.am @@ -24,3 +24,5 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \ ## Like DISTFILES, but look at INFO_DEPS, not INFOS. DEP_DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \ $(TEXINFOS) $(INFO_DEPS) $(MANS) $(EXTRA_DIST) $(DATA) + +TAR = tar diff --git a/tests/ChangeLog b/tests/ChangeLog index f468b1fef..ec956900e 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,5 +1,9 @@ Thu Apr 25 17:12:30 1996 Tom Tromey + * noinst.test: New file + + * exdir.test: Quoting change from Gord Matzigkeit. + * extra.test (EXTRA_PROGRAMS): New file. Tue Apr 9 22:55:07 1996 Tom Tromey diff --git a/tests/Makefile.am b/tests/Makefile.am index 43caf55fa..d705ae933 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -6,6 +6,6 @@ TESTS = mdate.test vtexi.test acoutput.test instexec.test checkall.test \ acoutnoq.test acouttbs.test libobj.test proginst.test acoutqnl.test \ confincl.test spelling.test prefix.test badprog.test depend.test exdir.test \ canon.test installsh.test empty.test rulepat.test insh.test canon2.test \ -target.test extra.test +target.test extra.test noinst.test EXTRA_DIST = defs $(TESTS) diff --git a/tests/Makefile.in b/tests/Makefile.in index c812e0b15..5e7f1b4e0 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -44,7 +44,7 @@ TESTS = mdate.test vtexi.test acoutput.test instexec.test checkall.test \ acoutnoq.test acouttbs.test libobj.test proginst.test acoutqnl.test \ confincl.test spelling.test prefix.test badprog.test depend.test exdir.test \ canon.test installsh.test empty.test rulepat.test insh.test canon2.test \ -target.test extra.test +target.test extra.test noinst.test EXTRA_DIST = defs $(TESTS) DIST_COMMON = ChangeLog Makefile.am Makefile.in @@ -57,6 +57,8 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \ $(TEXINFOS) $(INFOS) $(MANS) $(EXTRA_DIST) $(DATA) DEP_DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \ $(TEXINFOS) $(INFO_DEPS) $(MANS) $(EXTRA_DIST) $(DATA) + +TAR = tar default: all diff --git a/tests/exdir.test b/tests/exdir.test index dd438e560..0ef3cbe5a 100755 --- a/tests/exdir.test +++ b/tests/exdir.test @@ -12,4 +12,4 @@ EOF $AUTOMAKE || exit 1 -grep ^DATA Makefile.in | grep html +grep '^DATA' Makefile.in | grep html diff --git a/tests/noinst.test b/tests/noinst.test new file mode 100755 index 000000000..342e88699 --- /dev/null +++ b/tests/noinst.test @@ -0,0 +1,18 @@ +#! /bin/sh + +# Check to make sure "make install" will build all in directory with +# nothing to install. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +all-local: + exit 1 +END + +$AUTOMAKE || exit 1 + +# "make install" should fail here if there is a bug. +make -f Makefile.in install && exit 1 + +exit 0 diff --git a/version.texi b/version.texi index ba0010965..7a7e0e1e2 100644 --- a/version.texi +++ b/version.texi @@ -1,3 +1,3 @@ -@set UPDATED 5 April 1996 +@set UPDATED 25 April 1996 @set EDITION 0.32 @set VERSION 0.32 -- 2.11.4.GIT