From 3f5ce1d893bf4655ae6f0fdf87cfe91fadbf1f51 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 2 Mar 1996 05:54:32 +0000 Subject: [PATCH] Bug fixes --- ChangeLog | 13 ++++++++++ NEWS | 2 ++ THANKS | 1 + TODO | 16 +++++++----- automake.in | 61 ++++++++++++++++++++++++++++++++-------------- automake.texi | 11 ++++++--- tests/ChangeLog | 8 ++++++ tests/Makefile.am | 2 +- tests/Makefile.in | 2 +- tests/badprog.test | 12 +++++++++ tests/defs | 6 +++-- tests/depend.test | 21 ++++++++++++++++ 12 files changed, 123 insertions(+), 32 deletions(-) create mode 100755 tests/badprog.test create mode 100755 tests/depend.test diff --git a/ChangeLog b/ChangeLog index 5ae5bd77..991e2ea3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,19 @@ Fri Mar 1 00:13:04 1996 Tom Tromey Changed `normal' to `foreign' everywhere. (parse_arguments): Handle --foreign. (initialize_global_constants): Document --foreign. + (handle_dependencies): Better error message. + (handle_texinfo): Don't push $vtexi on @texis. + (handle_texinfo): Only push $vtexi on @texi_deps if not null. + (handle_configure): install-sh is a config file; require it as + such. + (parse_arguments): Renamed --install-missing to --add-missing. + (add_missing): Renamed from install_missing. + (am_install_var): Check to make sure contents of install variable + are correct if primary requires it. Test badprog.test. + (initialize_global_constants): Initialize + %primary_uses_subobjects. + (handle_source_transform): Skip configure substitutions. Test + depend.test. Also, skip empty elements. Thu Feb 29 12:00:30 1996 Tom Tromey diff --git a/NEWS b/NEWS index c9a76642..f02b75c2 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ New in 0.31: * Bug fixes * Documentation updates from François Pinard * strictness `normal' now renamed to `foreign' +* Renamed --install-missing to --add-missing +* Now handles AC_CONFIG_AUX_DIR New in 0.30: * Bug fixes diff --git a/THANKS b/THANKS index 51750ffc..e70c1b92 100644 --- a/THANKS +++ b/THANKS @@ -5,6 +5,7 @@ people: François Pinard Gord Matzigkeit Greg A. Woods +Henrik Frystyk Nielsen Jerome Santini Jim Meyering Karl Berry diff --git a/TODO b/TODO index 89472c2e..1bcfbd5e 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,8 @@ Priorities for release: * Check all require_file errors to see if any should reference a line in Makefile.am or configure.in. [handle_configure does] -* handle AC_CONFIG_AUX_DIR; must include install-sh - what about mkinstalldirs, mdate-sh? -* Change --install-missing to --add-missing +* Error if program name not acceptable as makefile variable name +* Add prog_CFLAGS Franc,ois> * Do you speak somewhere of the capability Automake has to let Franc,ois> the user overrides definitions and goals? I think this is useful, @@ -18,7 +17,7 @@ Franc,ois> * The manual should tell about the fact the automake program, when Franc,ois> used for a single subdirectory, should be run from the top level, Franc,ois> with something like an explicit DIR/Makefile argument. -* look at ``'' issues. and look for 'definition' pragma +* look at ``'' issues in docs. and look for 'definition' pragma Other priorities: * Must rewrite am_install_var. Should break into multiple functions. @@ -26,9 +25,14 @@ Other priorities: * Rewrite clean targets. * Expand test suite. -should allow something like this: - pkgdata_DATA = samples/access samples/config samples/motd samples/users +>>>>> "JMS" == Joerg-Martin Schwarz writes: +JMS> make dist requires that automake be installed, even if the +JMS> current Makefile.in already includes all dependency files. This +JMS> way one cannot re-create the tar file from the extracted source +JMS> file tree. +Consider allowing mkinstalldirs, mdate-sh, and others to be put in +AC_CONFIG_AUX_DIR. Maybe even ansi2knr? Testing: allow support for Cygnus-style dejagnu-based test suites via an option diff --git a/automake.in b/automake.in index 9f701b19..85a6ac85 100755 --- a/automake.in +++ b/automake.in @@ -71,7 +71,7 @@ $exit_status = 0; $symlink_exists = (eval 'symlink ("", "");', $@ eq ''); # TRUE if missing standard files should be installed. -$install_missing = 0; +$add_missing = 0; # Files found by scanning configure.in for LIBOBJS. %libsources = (); @@ -244,9 +244,9 @@ sub parse_arguments shift (@arglist); $output_directory = $arglist[0]; } - elsif ($arglist[0] eq '--install-missing') + elsif ($arglist[0] eq '--add-missing') { - $install_missing = 1; + $add_missing = 1; } elsif ($arglist[0] eq '--verbose') { @@ -488,6 +488,15 @@ sub handle_source_transform # Skip things that look like macro references. next if /^\$\(.*\)$/; next if /^\$\{.*\}$/; + # Skip things that look like configure substitutions. + # FIXME maybe this should be an error? + next if /^\@.*\@$/; + + # One wonders how this can happen. But, apparently, + # it can. FIXME find out why. Anyway, skip empty + # strings. (See tests/depend.test for an example of + # how to trigger this code) + next if /^\s*$/; if (/^(.*)\.[yl]$/) { @@ -739,8 +748,6 @@ sub handle_texinfo if (defined $versions{$vtexi}); $versions{$vtexi} = $info_cursor; - # Got a hit. - push (@texis, $vtexi); # We number the stamp-vti files. This is doable since the # actual names don't matter much. We only number starting # with the second one, so that the common case looks nice. @@ -765,7 +772,8 @@ sub handle_texinfo # If user specified file_TEXINFOS, then use that as explicit # dependency list. @texi_deps = (); - push (@texi_deps, $info_cursor, $vtexi); + push (@texi_deps, $info_cursor); + push (@texi_deps, $vtexi) if $vtexi; if (defined $contents{$infobase . "_TEXINFOS"}) { push (@texi_deps, "\$" . $infobase . '_TEXINFOS'); @@ -1137,7 +1145,7 @@ sub handle_dependencies { if (! open (DEP_FILE, $depfile)) { - &am_error ("couldn't open $depfile", $!); + &am_error ("couldn't open \`$depfile': $!"); next; } print "automake: reading $depfile\n" if $verbose; @@ -1238,7 +1246,8 @@ sub handle_configure $output_rules .= &file_contents ('remake'); # Look for some files we need. - &require_file ($FOREIGN, 'install-sh', 'mkinstalldirs'); + &require_config_file ($FOREIGN, 'install-sh'); + &require_file ($FOREIGN, 'mkinstalldirs'); &am_error ("\`install.sh' is an anachronism; use \`install-sh' instead") @@ -1662,7 +1671,7 @@ sub handle_tests sub scan_configure { open (CONFIGURE, 'configure.in') - || die "automake: couldn't open configure.in: $!\n"; + || die "automake: couldn't open \`configure.in': $!\n"; print "automake: reading configure.in\n" if $verbose; # Reinitialize libsources here. This isn't really necessary, @@ -1920,7 +1929,7 @@ sub read_am_file ('s/\@top_builddir\@/' . $build_rx . '/g', 'header-vars'); - open (AM_FILE, $amfile) || die "automake: couldn't open $amfile: $!\n"; + open (AM_FILE, $amfile) || die "automake: couldn't open \`$amfile': $!\n"; print "automake: reading $amfile\n" if $verbose; $output_vars .= ("# Makefile.in generated automatically by automake " @@ -2107,7 +2116,7 @@ sub initialize_global_constants --gnu same as --strictness=gnu --help print this help, then exit --include-deps include generated dependencies in Makefile.in - --install-missing install missing standard files + --add-missing add missing standard files to package --output-dir=DIR put generated Makefile.in's into DIR --strictness=LEVEL set strictness level. LEVEL is foreign, gnu, gnits --verbose verbosely list files processed @@ -2118,7 +2127,14 @@ sub initialize_global_constants # Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -" +"; + + # Element is TRUE if primary variable is further parsed by + # Automake. In such a case the contents must be valid Makefile + # variable names. + %primary_uses_subobjects = + ('PROGRAMS', 1, + 'LIBRARIES', 1); } # (Re)-Initialize per-Makefile.am variables. @@ -2371,10 +2387,19 @@ sub am_install_var $one_name = $X . '_' . $primary; if (defined $contents{$one_name}) { - # Append actual contents to result. Skip elements that - # look like configure substitutions. - push (@result, grep (! /^\@.*\@$/, - split (/\s+/, $contents{$one_name}))); + # Append actual contents of where_PRIMARY variable to + # result. Skip elements that look like configure + # substitutions. Also, possibly check contents of + # variable for validity. + local ($rcurs); + foreach $rcurs (split (/\s+/, $contents{$one_name})) + { + next if $rcurs =~ /^\@.*\@$/; + push (@result, $rcurs); + &am_line_error ($one_name, "invalid object name \`$rcurs'") + if $primary_uses_subobjects{$primary} + && $rcurs !~ /^[A-Za-z_][A-Za-z_0-9]+$/; + } if ($do_clean) { @@ -2454,7 +2479,7 @@ sub require_file { # Only install missing files according to our desired # strictness level. - if ($install_missing && -f ($am_dir . '/' . $file)) + if ($add_missing && -f ($am_dir . '/' . $file)) { # Install the missing file. Symlink if we can, copy # if we must. @@ -2510,7 +2535,7 @@ sub require_config_file { # Only install missing files according to our desired # strictness level. - if ($install_missing && -f ($am_dir . '/' . $file)) + if ($add_missing && -f ($am_dir . '/' . $file)) { # Install the missing file. Symlink if we can, copy # if we must. diff --git a/automake.texi b/automake.texi index 204d35b4..bbd5ce35 100644 --- a/automake.texi +++ b/automake.texi @@ -177,6 +177,9 @@ out-of-date @file{Makefile.in}. Look for Automake data files in directory @var{dir} instead of in the installation directory. This is typically used for debugging. +@item --foreign +An alias for @samp{--strictness=foreign}. + @item --gnits An alias for @samp{--strictness=gnits}. @@ -192,7 +195,7 @@ Include all automatically generated dependency information @file{Makefile.in}. This is generally done when making a distribution; see @ref{Dist}. -@item --install-missing +@item --add-missing Automake requires certain common files to exist in certain situations; for instance @file{config.guess} is required if @file{configure.in} runs @samp{AC_CANONICAL_HOST}. Automake is distributed with several of these @@ -256,7 +259,7 @@ conformance. The valid strictness levels are: @table @samp -@item foriegn +@item foreign Automake will check for only those things which are absolutely required for proper operations. For instance, whereas GNU standards dictate the existence of a @file{NEWS} file, it will not be required in @@ -320,7 +323,7 @@ sbin_PROGRAMS = @@PROGRAMS@@ Defining a primary variable is an error. -Note that the common ``dir'' suffix is left off when constructing the +Note that the common @samp{dir} suffix is left off when constructing the variable names; thus one writes @samp{bin_PROGRAMS} and not @samp{bindir_PROGRAMS}. @@ -1090,7 +1093,7 @@ their work under terms like those of the GPL, but doing so is not required to use Automake. Some of the files that can be automatically installed via the -@samp{--install-missing} switch do fall under the GPL; examine each file +@samp{--add-missing} switch do fall under the GPL; examine each file to see. diff --git a/tests/ChangeLog b/tests/ChangeLog index 6feea6c8..0bce77c8 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,11 @@ +Fri Mar 1 17:23:53 1996 Tom Tromey + + * depend.test: New file. + + * badprog.test: New file. + + * defs (AUTOMAKE): Pass --foreign. + Thu Feb 29 20:23:42 1996 Tom Tromey More tests: diff --git a/tests/Makefile.am b/tests/Makefile.am index 372fdd8c..e40098d8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -6,6 +6,6 @@ AUTOMAKE_OPTIONS = gnits ## Perhaps he is right. 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 +confincl.test spelling.test prefix.test badprog.test depend.test DIST_OTHER = defs diff --git a/tests/Makefile.in b/tests/Makefile.in index 0a7b9eb0..d230100d 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -42,7 +42,7 @@ AUTOMAKE_OPTIONS = gnits 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 +confincl.test spelling.test prefix.test badprog.test depend.test DIST_OTHER = defs DIST_COMMON = ChangeLog Makefile.am Makefile.in diff --git a/tests/badprog.test b/tests/badprog.test new file mode 100755 index 00000000..69670c9e --- /dev/null +++ b/tests/badprog.test @@ -0,0 +1,12 @@ +#! /bin/sh + +# Test to make sure that programs with bad names are diagnosed. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +bin_PROGRAMS = a,b +END + +$AUTOMAKE && exit 1 +exit 0 diff --git a/tests/defs b/tests/defs index 6e01804c..9da62490 100644 --- a/tests/defs +++ b/tests/defs @@ -40,5 +40,7 @@ test -z "$VERBOSE" && { echo "=== Running test $0" -# See how Automake should be run. -AUTOMAKE="../../automake --amdir=$srcdir/.." +# See how Automake should be run. We put --foreign as the default +# strictness to avoid having to create lots and lots of files. A test +# can override this by specifying a different strictness. +AUTOMAKE="../../automake --amdir=$srcdir/.. --foreign" diff --git a/tests/depend.test b/tests/depend.test new file mode 100755 index 00000000..a0af6bf5 --- /dev/null +++ b/tests/depend.test @@ -0,0 +1,21 @@ +#! /bin/sh + +# This tests for a bug reported by Henrik Frystyk Nielsen +# In some cases the auto-dependency can get confused and try +# to `-include' a directory. +# This actually tests for two bugs: +# * A configure substitution in _SOURCES incorrectly ends up in DEP_FILES +# * A backslash-newline in _SOURCES causes just the directory to +# appear in DEP_FILES. + +. $srcdir/defs || exit 1 + +cat > Makefile.am << 'END' +bin_PROGRAMS = fred +fred_SOURCES = \ + @BLATT@ +END + +$AUTOMAKE || exit 1 + +grep '^DEP_FILES = *$' Makefile.in -- 2.43.5