Re: typo in comment in tests/defs.in
Hi William, * William Pursell wrote on Sat, Oct 11, 2008 at 06:58:47AM CEST: --- a/tests/defs.in +++ b/tests/defs.in @@ -152,7 +152,7 @@ do CC=icc export CC # There is no way to ask *only* the compiler's version. - # This tool always want to do something (by default + # This tool always wants to do something (by default Thanks, applied (master and branch-1-10). http://git.savannah.gnu.org/gitweb/?p=automake.git;a=commit;h=e7af73ee9a7f85eb5c7672d6ee61ced6bdb10f95 Cheers, Ralf
parallel-tests: Ensure backward-compatible semantics. [2/4]
parallel-tests: Ensure backward-compatible semantics. For each test in Automake's test suite that uses TESTS, generate an identical one that uses the `parallel-tests' option, for coverage of backward-compatible functionality. * tests/gen-parallel-tests: New file, generates distributed Makefile.am snippet tests/parallel-tests.am to list all tests that use the TESTS interface but not yet the `parallel-tests' option, with names mangled to use suffix `-p.test', in ... (parallel_tests): ... this new make macro. * tests/Makefile.am ($(srcdir)/parallel-tests.am) ($(parallel_tests), defs-p): New rules. (TESTS): Add $(parallel_tests). (check_SCRIPTS): Add defs-p, $(parallel_tests). (check-clean-local): Remove `defs-p'. (EXTRA_DIST): Distribute gen-parallel-tests. * bootstrap: Generate parallel-tests.am. * tests/check8.test: Check for circular dependencies in rules. * tests/check11.test: New test, check that SKIPs are not counted as passed tests. * tests/defs.in: Unset DISABLE_HARD_ERRORS, LAZY_TEST_SUITE, VERBOSE, so the tests are not influenced by the way our test suite is invoked. diff --git a/bootstrap b/bootstrap index aa50f5d..1abde1d 100755 --- a/bootstrap +++ b/bootstrap @@ -122,6 +122,11 @@ dosubst m4/amversion.in m4/amversion.m4 # Create temporary replacement for automake dosubst automake.in automake.tmp +# Create tests/parallel-tests.am. +cd tests +$BOOTSTRAP_SHELL ./gen-parallel-tests parallel-tests.am +cd .. + # Run the autotools. $PERL ./aclocal.tmp -I m4 autoconf diff --git a/tests/.gitignore b/tests/.gitignore index a6827fd..cfd4565 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,6 +1,9 @@ aclocal-* automake-* defs +defs-p +parallel-tests.am *.dir *.log *.log-t +*-p.test diff --git a/tests/Makefile.am b/tests/Makefile.am index 9cc6dbe..b56e7e0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -7,6 +7,19 @@ auxdir2.test \ cond17.test\ txinfo5.test +include $(srcdir)/parallel-tests.am + +$(srcdir)/parallel-tests.am: gen-parallel-tests Makefile.am + (cd $(srcdir) $(SHELL) ./gen-parallel-tests) $@ + +$(parallel_tests): $(parallel_tests:-p.test=.test) Makefile.am + input=`echo $@ | sed 's,.*/,,; s,-p.test$$,.test,'`; \ + sed 's,^\. \./defs,. ./defs-p,' $(srcdir)/$$input $@ + chmod a+rx $@ + +defs-p: defs Makefile.am + sed 's,^AM_INIT_AUTOMAKE$$,([parallel-tests]),' defs $@ + TESTS =\ aclibobj.test \ aclocal.test \ @@ -98,6 +111,7 @@ check7.test \ check8.test \ check9.test \ check10.test \ +check11.test \ checkall.test \ clean.test \ clean2.test \ @@ -664,15 +678,16 @@ yacc6.test \ yacc7.test \ yacc8.test \ yaccpp.test \ -yaccvpath.test +yaccvpath.test \ +$(parallel_tests) -EXTRA_DIST = ChangeLog-old $(TESTS) +EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS) # Each test case depends on defs, aclocal, and automake. -check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION) +check_SCRIPTS = defs defs-p aclocal-$(APIVERSION) automake-$(APIVERSION) $(parallel_tests) clean-local: check-clean-local check-clean-local: -chmod -R u+rwx *.dir - -rm -rf *.dir + -rm -rf defs-p *.dir diff --git a/tests/check11.test b/tests/check11.test new file mode 100755 index 000..d4f6edc --- /dev/null +++ b/tests/check11.test @@ -0,0 +1,53 @@ +#! /bin/sh +# Copyright (C) 2008 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. + +# Check skip summary. + +. ./defs || Exit 1 + +set -e + +cat configure.in 'END' +AC_OUTPUT +END + +cat Makefile.am 'END' +TESTS = skip skip2 +END + +cat skip 'END' +#! /bin/sh +exit 77 +END +chmod a+x skip +cp skip skip2 + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +unset TESTS || : + +./configure +env TESTS=skip $MAKE -e check stdout +cat stdout +grep '1.*passed' stdout Exit 1 + +env TESTS=skip skip2 $MAKE -e check stdout +cat stdout +grep '2.*passed' stdout Exit 1 + +: diff --git a/tests/check8.test b/tests/check8.test index 242be56..3e38ccf 100755 --- a/tests/check8.test +++ b/tests/check8.test @@ -67,14 +67,20 @@ $AUTOMAKE -a unset TESTS || : ./configure -AM_COLOR_TESTS=always $MAKE -e check stdout { cat stdout; Exit 1; } +AM_COLOR_TESTS=always $MAKE -e check stdout 2stderr + { cat stdout;
Documentation for the parallel-tests driver. [4/4]
Documentation for the parallel-tests driver. * doc/automake.texi (Tests, Options): Document the `parallel-tests' option, including new features of the test driver. * NEWS: Update. diff --git a/NEWS b/NEWS index ed71e9e..6171e2e 100644 --- a/NEWS +++ b/NEWS @@ -101,6 +101,11 @@ New in 1.10a: - The `color-tests' option causes colored test result output on terminals. + - The `parallel-tests' option enables a new test driver that allows for +parallel test execution, and formatted result output as RST +(reStructuredText) and HTML. Enabling this option may require some +changes to your test suite setup; see the manual for details. + - New prefix `notrans_' for manpages which should not be transformed by --program-transform. diff --git a/doc/automake.texi b/doc/automake.texi index 9c157ae..8e494e8 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -8323,7 +8323,8 @@ default, only the @code{dist-gzip} target is hooked to @code{dist}. @cindex @code{make check} @trindex check -Automake supports two forms of test suites. +Automake supports three forms of test suites, the first two of which +are very similar. @section Simple Tests @@ -8359,7 +8360,7 @@ terminal with @samp{AM_COLOR_TESTS=always}. @vindex TESTS @vindex TESTS_ENVIRONMENT The variable @code{TESTS_ENVIRONMENT} can be used to set environment -variables for the test run; the environment variable @code{srcdir} is +variables for the test run; the environment variable @env{srcdir} is set in the rule. If all your test programs are scripts, you can also set @code{TESTS_ENVIRONMENT} to an invocation of the shell (e.g. @samp{$(SHELL) -x} can be useful for debugging the tests), or any other @@ -8396,6 +8397,107 @@ that @code{check_PROGRAMS} are @emph{not} automatically added to by the tests, not the tests themselves. Of course you can set @code{TESTS = $(check_PROGRAMS)} if all your programs are test cases. + [EMAIL PROTECTED] Simple tests using @samp{parallel-tests} [EMAIL PROTECTED] @option{parallel-tests}, Using +The option @option{parallel-tests} (@pxref{Options}) enables a test +suite driver that is mostly compatible to the simple test driver +described above, but provides a few more features and slightly different +semantics. It features concurrent execution of tests with @code{make -j}, +allows to specify inter-test dependencies, lazy reruns of tests that +have not completed in a prior run, summary and verbose output in [EMAIL PROTECTED] (reStructuredText) and @samp{HTML} format, and hard errors +for early abort of test runs. Similar to the simple test driver, [EMAIL PROTECTED], @code{AM_COLOR_TESTS}, @code{XFAIL_TESTS}, and +the @code{check_*} variables are honored, and the environment variable [EMAIL PROTECTED] is set during test execution. + [EMAIL PROTECTED] TEST_SUITE_LOG [EMAIL PROTECTED] TEST_LOGS +The driver operates by defining a set of @command{make} rules to create +a summary log file, @code{TEST_SUITE_LOG}, which defaults to [EMAIL PROTECTED] and requires a @file{.log} suffix. This file +depends upon log files created for each single test program listed in [EMAIL PROTECTED], which in turn contain all output produced by the +corresponding tests. + [EMAIL PROTECTED] TEST_SUFFIXES +Each log file is created when the corresponding test has completed. +The set of log files is listed in the read-only variable [EMAIL PROTECTED], and defaults to @code{TESTS}, with the executable +extension if any (@pxref{EXEEXT}), as well as any suffix listed in [EMAIL PROTECTED] removed, and @file{.log} appended. [EMAIL PROTECTED] defaults to @file{.test}. Results are undefined +if a test file name ends in several concatenated suffixes. + [EMAIL PROTECTED] VERBOSE +As with the simple driver above, by default one status line is printed +per completed test, and a short summary after the suite has completed. +If the variable @samp{VERBOSE} is set, the @file{test-suite.log} file is +appended after the summary. + [EMAIL PROTECTED] mostlyclean [EMAIL PROTECTED] check-html [EMAIL PROTECTED] RST2HTML [EMAIL PROTECTED] TEST_SUITE_HTML +With @code{make check-html}, the log files may be converted from RST +(reStructuredText, see @uref{http://docutils.sourceforge.net/@/rst.html}) +to HTML using @samp{RST2HTML}, which defaults to @command{rst2html} or [EMAIL PROTECTED] The variable @samp{TEST_SUITE_HTML} contains the +set of converted log files. The log and HTML files are removed upon [EMAIL PROTECTED] mostlyclean}. + [EMAIL PROTECTED] DISABLE_HARD_ERRORS [EMAIL PROTECTED] Exit status 99, special interpretation +Sometimes, a condition may arise during a test suite run that makes it +desirable to avoid running further tests, for example when an external +resource like disk space is exhausted. Unless the variable [EMAIL PROTECTED] is set to a nonempty value, an exit status of +99 of a test will prevent further tests from being spawned. + [EMAIL PROTECTED] LAZY_TEST_SUITE +By default, all tests
Re: magic variables for included fragments (was: Feature request)
[ moving to automake-patches; this is http://thread.gmane.org/gmane.comp.sysutils.automake.general/9824 ] * Ralf Wildenhues wrote on Sun, Oct 12, 2008 at 10:46:06PM CEST: I'll follow up on automake-patches with a patch to test. Here we go. WDYT? Cheers, Ralf Recursive `include' and helper macros. * automake.in (am_subdir, am_prefix, am_canon, am_reverse): New globals. (initialize_per_input): Initialize them. (simplify, relativize): New functions; relativize taken from likewise named function in gnulib-tool written by Bruno Haible, rewritten for perl. (read_am_file): Substitute the literal strings `$(AM_SUBDIR)', `$(AM_PREFIX)', `$(AM_CANON)', and `$(AM_REVERSE)' in the input, using the new globals, before any other transformation. Adjust values upon `include' statements. Change semantics of `include local-path' to not be relative to $(srcdir) but to $(AM_PREFIX). * doc/automake.texi (Alternative): Index `non-recursive'. Mention include fragments and special variables. (Include): Document changed `include fragment' semantics and special variables. * tests/include3.test: New test. * tests/Makefile.am: Update. * NEWS: Update. Idea and suggestion from Akim Demaille. diff --git a/NEWS b/NEWS index 6171e2e..cf8832e 100644 --- a/NEWS +++ b/NEWS @@ -119,6 +119,15 @@ New in 1.10a: - AM_MAINTAINER_MODE now allows for an optional argument specifying the default setting. + - The semantics of the `include fragment.am' statement (without a prefix +of `$(srcdir)/' or `$(top_srcdir)/' to the file name) is now documented, +and was changed to search the file relative to the location of the current +include fragment. +Furthermore, Automake now provides special variables that allow to +refer to the location of the currently included fragment relative to +the Makefile.am file that includes it. This helps to write location- +independent fragments. + Bugs fixed in 1.10a: * Long standing bugs: diff --git a/automake.in b/automake.in index decb35a..1cad013 100755 --- a/automake.in +++ b/automake.in @@ -503,6 +503,14 @@ my @cond_stack; # This holds the set of included files. my @include_stack; +# subdir path from Makefile.am to current include file, prefix (usable +# without appending a slash, and empty if subdir is '.'), canonicalized +# prefix, and reverse path. +my $am_subdir; +my $am_prefix; +my $am_canon; +my $am_reverse; + # List of dependencies for the obvious targets. my @all; my @check; @@ -657,6 +665,11 @@ sub initialize_per_input () @include_stack = (); +$am_subdir = '.'; +$am_prefix = ''; +$am_canon = ''; +$am_reverse = '.'; + @all = (); @check = (); @check_tests = (); @@ -1091,6 +1104,68 @@ sub backname ($) return join ('/', @res) || '.'; } + +# simplify ($DIR) +# --- +# Kill instances of `/.' and `sub/..' from a path. +sub simplify ($) +{ +my ($dir) = @_; +my @res = (); +foreach my $d (grep (!/^\.$/, split (/\//, $dir))) + { + if ($d eq '..') + { + my $p = pop @res; + if (!defined ($p) || $p eq '..') + { + push @res, $p + if defined ($p); + push @res, $d; + } + } + else + { + push @res, $d; + } + } +return join ('/', @res) || '.'; +} + +# relativize ($CUR-DIR, $DIR1, $DIR2) +# +# Compute relative pathname $REL-DIR such that $DIR1/$REL-DIR = $DIR2. +sub relativize ($$$) +{ +my ($curdir, $dir1, $dir2) = @_; +my @dir0 = grep (!/^\.$/, split (/\//, $curdir)); +my @dir2 = grep (!/^\.$/, split (/\//, $dir2)); + +foreach my $first (grep (!/^\.$/, split (/\//, $dir1))) + { + if ($first eq '..') + { + my $d = pop @dir0 + or prog_error (moving outside of tree in relativize); + unshift @dir2, $d; + } + else + { + if (defined ($dir2[0]) $first eq $dir2[0]) + { + shift @dir2; + } + else + { + unshift @dir2, '..'; + } + push @dir0, $first; + } + } +return simplify (join ('/', @dir2) || '.'); +} + + @@ -6468,6 +6543,11 @@ sub read_am_file ($$) chomp; $_ .= \n; + s/\$\(AM_SUBDIR\)/$am_subdir/go; + s/\$\(AM_PREFIX\)/$am_prefix/go; + s/\$\(AM_CANON\)/$am_canon/go; + s/\$\(AM_REVERSE\)/$am_reverse/go; + # Don't look at MAINTAINER_MODE_TRUE here. That shouldn't be # used by users. @MAINT@ is an anachronism now. $_ =~ s/[EMAIL PROTECTED]@//g @@ -6610,35 +6690,71 @@ sub read_am_file ($$) } elsif (/$INCLUDE_PATTERN/o) { - my $path = $1
Re: [PATCH] Nicer 'make dist' output.
Hi Eric, thanks for the feedback. * Eric Blake wrote on Mon, Oct 13, 2008 at 04:18:03PM CEST: I like the shorter output. However, ... new_top_distdir=$$reldir; \ + echo (cd $$subdir $(MAKE) $(AM_MAKEFLAGS) top_distdir=$$new_top_distdir distdir=$$new_distdir \\; \ + echo am__remove_distdir=: am__skip_length_check=: distdir); \ Not portable. You can't mix echo and \, since not all echo interpret \. Well, the backslash is not to be interpreted by echo. I don't know of any echo that has a problem with a single backslash echo \\ or echo '\' for that matter, though. Backslash is only problematic if it is followed by characters that might combine to an escape sequence, not as last one in the line. Cheers, Ralf
Re: Parallel tests execution [0/4]
Hi Jim, * Jim Meyering wrote on Wed, Oct 15, 2008 at 09:13:54PM CEST: Ralf Wildenhues [EMAIL PROTECTED] wrote: 12) allow for additional output on stdout/stderr? example: test was skipped because of $reason. This would be nice. It'd would be useful also to mark as surprising or highly undesirable the results of certain tests. Better than a simple yes or no. Hmm. Maybe let another fd dup stderr? I'll give it a spin in coreutils soon. I tried it. check passes, but ditstcheck fails at some point. I haven't had time to analyze it yet, though, which is why I didn't report it yet. Thanks, Ralf
Re: Parallel tests execution [0/4]
Hi Akim, thanks for the feedback! * Akim Demaille wrote on Thu, Oct 16, 2008 at 04:05:47PM CEST: RW == Ralf Wildenhues [EMAIL PROTECTED] writes: These four patches implement parallel execution of TESTS in Automake, adapted from the check.mk file Akim Demaille posted earlier. For the records, I attached the version I'm currently using. Thanks. FWIW, it still has some of the portability issues that I mentioned. 6) lazy test completion (do not rerun already-run tests), This one must be optional, but it provides huge savings when it applies. Agreed on both accounts. It is optional in the version I have. - (5), (6), (8) are provided already by the check.mk code, except that (8) didn't work. Actually I never meant to have hard error stop the whole test suite. The point of hard-errors as they were defined in check.mk was to make them *non* ignorable. For instance our test suite raises a hard-error if the program make a segmentation fault, which we never want to tolerate. I don't understand. What is the difference to a normail FAIL then, i.e., to the process exiting with 1? - output `PASS: foo.test' not `PASS: foo.log' This was actually a feature :) We use an Emacs mode that opens the (log) file when we click on it. But it's not the log file that fails. I found this very non-intuitive. I might be talked into a compromise, though; for example like this: FAIL: sub/foo.test (see sub/foo.log) WDYT? - is everybody ok with the following authorship for patch 1/4? 2008-10-XX Akim Demaille [EMAIL PROTECTED] Jim Meyering [EMAIL PROTECTED] Benoit Sigoure [EMAIL PROTECTED] Ralf Wildenhues [EMAIL PROTECTED] (as git allows only one author, I will put the first name in --author) Thanks :) I think that some of the parts about tput were from Bob Proulx, but I'm not sure. I ripped out all the tput parts, because in my tests they were far less portable than escape sequences. If there are other things from Bob then I'll happily add him. - how should I best acknowledge The Vaucanson Group? Something like this in lib/am/check.am ok? ## This code is adapted from check.mk which came from: ## ## Vaucanson, a generic library for finite state machines. ## Copyright (C) 2006, 2007 The Vaucanson Group. Actually it would be more fair to thanks EPITA and Gostai, both worked on it, and Vaucanson was just the initial impetus to develop this. OK, I will use this: ## This code is adapted from check.mk which was originally ## written by The Vaucanson Group, further developer at ## EPITA and Gostai, then made its way from GNU coreutils ## to end up, largely rewritten, in Automake. The only reason I haven't put this in yet is that it would require a copyright disclaimer from Vaucanson. What do you think? A mere thank, or whatever you feel is most appropriate will be perfect. OK, thanks. Cheers, Ralf
Re: Parallel test execution: new option `parallel-tests': [1/4]
Hi Akim, again, thanks for your and Jim's valuable feedback! * Akim Demaille wrote on Thu, Oct 16, 2008 at 04:58:48PM CEST: The logic to create this kind of message is really complex, and in retrospect, I don't think that the message delivered is much easier to read than something more regular. So currently check.mk does as follows: Hmm. I'm still thinking about which type of summary I prefer. (Anyway your current summary would need singular/plurals fixed.) We introduced TFAIL, temporary failures: it's sort of short-term XFAIL. When a test starts to fail, it might be because someone uncovered a bug elsewhere, and that person might not be competent to address the real bug. Yet, leaving the test as is, failing, is a problem for everybody else who might waste a lot of time to discover that they have not introduced the problem, it was already there. So we make it TFAIL, which means should be processed soon. I'm not sure I understand the additional value of TFAIL. You have to mark it anyway, so why not mark it XFAIL? Put the other way round, what's the value of XFAIL if you are effectively going to ignore the expected failures anyway? Thanks, Ralf
Re: Documentation for the parallel-tests driver. [4/4]
Hi Akim, * Akim Demaille wrote on Fri, Oct 17, 2008 at 12:15:42PM CEST: Consequently, there is little point in showing users how to write such a rule. I strongly disagree here. And your position is quite founded, if but a bit hard to swallow at first. ;-) There are several aspects to this whole issue; I will try to keep them as separate as possible. First, I don't want to (have to) tell users about $(am__check_pre) and $(am__check_post). If I did, I'd call them $(check_prepare) and $(check_postprocess), but I don't in the first place, as: - this either nails down the implementation quite severely, to the point that we may not easily be able to fix bugs or inconsistencies in it, - allowing users not to use them may prevent consistent introduction of post-test cleanup macros, hard errors, and similar, - it is simply an Ugly API[tm]. (It essentially would amount to documenting $p, $tst, $dir, $f, $log, possible even how and what to write to $log; tty colors etc.) But if I understand you correctly, then that isn't the grip you have with this at all. The missing bit is: you want to be able to provide a command executing tests; moreover, different commands for different sets of tests. And that part is a Good Idea[tm]. I'd even go as far as: both the developer and the user might want to be able to have a word here. (Think valgrind, think simulator (don't think about Libtool issues just yet), ...) But I don't see the real need for users to specify the whole rule. I wrote check.mk with a clear and simple model in mind: we are compiling tests, and they can be written in several languages. This fits nicely the Make model and gives all the rest (parallelism etc.) for free. *And* it provides an opportunity to present a uniform interface a la Automake, using TESTS_SUITES = foo-suite.log bar-suite.log foo_suite_SOURCES = 1.foo 2.foo bar_suite_SOURCES = a.bar b.bar foo_COMPILER = ./foo bar_COMPILER = ../bin/bar --verbose --warnings=all Which is a nice idea. I like it. I even tried to go this way when I first started. It turned out that a number of purely practical issues needed to be addressed: - if you still want to be able to easily limit the number of tests run at 'make' run time, you have to go through hoops to ensure that *_OBJECTS is a direct dependent of *_SOURCES (resp. TESTS), - *for this language*, the mapping from sources to objects should *not* be an automake internal detail, - the current code looks not really adapted to reset known extensions and languages per Makefile.am, so this could be a bit of work (if only to check that nothing silently breaks), - then, I'm quite a fan of backward compatibility, with the aim that most users would get a working parallel testsuite by simply adding AUTOMAKE_OPTIONS = parallel-tests to their Makefile.am. Cf. testsuite addition that tests just this. - In your proposal, it would IMVHO still be necessary to specify the set of extensions that tests can have (in order to support @substed@ tests at least, and in order to avoid ambiguities and per-target rules). I decided that this was more than I could implement in the time that I had for this, and it is probably more than I will have time for in the near future. Alternatively, is there a volunteer for implementing it? I'm currently trying to gauge whether the question is: - drop my 'parallel-tests' patches now, try for or wait for something better? or - add my 'parallel-tests' bits now, and go on? Adding the patch set now would likely mean some incompatibility in the future when your proposed semantics are implemented, which would be bad. Comments appreciated. And please don't get me wrong, I'm not attached to this patch set, but I do want to provide parallel tests eventually. Thanks, Ralf
Fix DisjConditions module to be thread-safe for perl = 5.7.2.
This patch is the first of a number of steps toward parallel automake (i.e., letting Perl threads create Makefile.in files concurrently). It fixes a data structure corruption happening during thread creation. I'm not sure whether this may be considered a Perl bug/limitation (after all it is documented that blessed references act as strings when used as keys in a hash, so it's not that surprising that the strings are not adjusted to the cloned hash addresses), but now that I've understood the bug and found a relatively clean fix, I'm not that worried any more. :-) In the patch below, I've omitted the new test files; they would be boring to read. Instead, at the end is the 'diff -uw' to their originals, which shows much clearer the changes over the originals. Without the CLONE function, the new tests would fare like this: PASS: Condition-t.pl (A1) TRUE vs. TRUE Error message 'FOO was already defined in condition TRUE, which includes condition TRUE' does not match 'multiply defined' (A1) C1_TRUE vs. C1_TRUE Error message 'FOO was already defined in condition C1, which includes condition C1' does not match 'multiply defined' FAIL: DisjConditions-t.pl Applied to master. Cheers, Ralf Fix DisjConditions module to be thread-safe for perl = 5.7.2. Self-hashes of blessed references are not correctly transported through thread creation. This patch fixes that by recreating the hashes upon thread creation with a CLONE special subroutine, which is automatically invoked by new enough Perl versions. * lib/Automake/DisjConditions.pm (CLONE): New special subroutine to fix self hashes upon thread creation. * lib/Automake/tests/Condition-t.pl: New, sister test to Condition.pl, but spawns a new threads after each creation of a new condition; skip test if perl is too old or ithreads are not available. * lib/Automake/tests/DisjConditions-t.pl: Likewise. * lib/Automake/tests/Makefile.am (TESTS): Add them. Signed-off-by: Ralf Wildenhues [EMAIL PROTECTED] diff --git a/lib/Automake/DisjConditions.pm b/lib/Automake/DisjConditions.pm index 1f09c0f..ae759e2 100644 --- a/lib/Automake/DisjConditions.pm +++ b/lib/Automake/DisjConditions.pm @@ -192,6 +192,26 @@ sub new ($;@) return $self; } + +=item CCLONE + +Internal special subroutine to fix up the self hashes in +C%_disjcondition_singletons upon thread creation. CCLONE is invoked +automatically with ithreads from Perl 5.7.2 or later, so if you use this +module with earlier versions of Perl, it is not thread-safe. + +=cut + +sub CLONE +{ + foreach my $self (values %_disjcondition_singletons) +{ + my %h = map { $_ = $_ } @{$self-{'conds'}}; + $self-{'hash'} = \%h; +} +} + + =item C@conds = $set-Egtconds Return the list of CCondition objects involved in C$set. diff --git a/lib/Automake/tests/Makefile.am b/lib/Automake/tests/Makefile.am index 705f195..529a02f 100644 --- a/lib/Automake/tests/Makefile.am +++ b/lib/Automake/tests/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to create Makefile.in -## Copyright (C) 2002, 2003 Free Software Foundation, Inc. +## Copyright (C) 2002, 2003, 2008 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -18,7 +18,9 @@ TESTS_ENVIRONMENT = $(PERL) -Mstrict -I $(top_srcdir)/lib -w TESTS = \ Condition.pl \ +Condition-t.pl \ DisjConditions.pl \ +DisjConditions-t.pl \ Version.pl \ Wrap.pl --- lib/Automake/tests/Condition.pl 2008-10-18 11:12:03.0 +0200 +++ lib/Automake/tests/Condition-t.pl 2008-10-19 19:46:27.0 +0200 @@ -1,4 +1,4 @@ -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2008 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -15,6 +15,18 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/. +BEGIN { + use Config; + if (eval { require 5.007_002; } # for CLONE support + $Config{useithreads}) +{ + use threads; +} + else +{ + exit 77; +} +} use Automake::Condition qw/TRUE FALSE/; sub test_basics () @@ -32,12 +44,15 @@ for (@tests) { my $a = new Automake::Condition @{$_-[0]}; + return 1 +if threads-new(sub { return 1 if $_-[1] != $a-true; return 1 if $_-[1] != ($a == TRUE); return 1 if $_-[2] != $a-false; return 1 if $_-[2] != ($a == FALSE); return 1 if $_-[3] ne $a-string; return 1 if $_-[4] ne $a-subst_string; + })-join; } return 0; } @@ -62,19 +77,24 @@ for my $t (@tests) { my $a = new Automake::Condition @{$t-[0]}; + return 1 +if threads-new(sub { for my $u (@{$t-[1]}) { my $b = new Automake
Re: AM_DEFAULT_SOURCE_EXT
* Akim Demaille wrote on Mon, Oct 20, 2008 at 12:56:23AM CEST: Le 18 oct. 08 à 03:02, Ralf Wildenhues a écrit : * Akim Demaille wrote on Thu, Oct 16, 2008 at 04:11:22PM CEST: I wish I could define AM_DEFAULT_SOURCE_EXT = .cc or whatever, so that I wouldn't have to define all the foo_SOURCES. I agree extension is better than suffix. (Even if Automake itself is inconsistent here and uses both.) Hum, actually I meant to use extensions without the dot :( Erm, but you certainly didn't write it that way before! ;-) Trying to find a distinctive meaning to extension and suffix… Of course you should add a period before an extension to get a suffix only when the extension is non-empty :) This is a bike-shedding issue, right? Or is there a real reason? FWIW, I find it easier to search for if the dot is part of the thing; also, most uses inside automake include the dot (accept_extension et al). I am wondering whether DEFAULT_SOURCE_EXT would be preferable to AM_DEFAULT_SOURCE_EXT? I made it AM_ to avoid infringing on the user name space, but I'm fine with just any name. Yeah, not infringing is probably good. Trying to find a general rule would be even better. Hmm, Variables using an `AM_' prefix are either automake-rule-specific sister variables of the respective user API variables without that prefix (typically, those end in `FLAGS'); or they change some mode of operation of `automake' runtime. The second part is not consistent. * AM_INSTALLCHECK_STD_OPTIONS_EXEMPT is purely 'make installcheck' run time issue, * AM_COLOR_TESTS is purely a 'make check' run time issue, * OTOH, AUTOMAKE_OPTIONS is important at 'automake' run time, but doesn't have the prefix. ACLOCAL_AMFLAGS is also not so consistent. I wonder now whether we should rename AM_COLOR_TESTS to COLOR_TESTS. OTOH, as graphics program I might want to use the latter for something entirely different... +(my $default_source = $unxformed) =~ s,(\.[^./\\]*)?$, $default_source_ext,; So Automake cannot leave with using $(AM_DEFAULT_SOURCE_EXT) as a symbolic value? No. It really needs to perform the substitution statically? Yes. Otherwise all the rest comes for free (conditionals, possibility to change the extension on the command line (not that I think of a particular use here, but...)). Believe me, it won't come for free. The *SOURCES parser is quite involved just to deal with conditionals; it outright forbids symbolics. +AM_DEFAULT_SOURCE_EXT = .cpp Just my 0.02 French Francs (yeah, I know, today the currency is €, but in the context of criticism/critique, the French currency definitely seems more appropriate): .cpp reminds me too me about CPP, I prefer .cc/.cxx :) And you're quite entitled to never use .cpp in your sources. However, it is the only extension for C++ source code that is accepted without further command line option by every C++ compiler we know of. (MS cl needs a switch to come right before the name otherwise.) So that is not an issue of personal preference. Cheers, Ralf
Let stderr output end up on fd 2 in testsuite.
A trivial cleanup patch, pushed. Cheers, Ralf Let stderr output end up on fd 2 in testsuite. * tests/defs.in (AUTOMAKE_run): Output recorded stderr on file descriptor 2. * tests/getopt.test: Fix erroneous multiple redirection, uncovered by above change. diff --git a/tests/defs.in b/tests/defs.in index c0e310f..e7d9d39 100644 --- a/tests/defs.in +++ b/tests/defs.in @@ -382,7 +382,7 @@ AUTOMAKE_run () shift exitcode=0 $AUTOMAKE ${1+$@} stdout 2stderr || exitcode=$? - cat stderr + cat stderr 2 cat stdout test $exitcode = $expected_exitcode || Exit 1 } diff --git a/tests/getopt.test b/tests/getopt.test index 46fcb4e..8dc9512 100755 --- a/tests/getopt.test +++ b/tests/getopt.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2008 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ grep ':.*nonexistent' stderr Exit 1 # Similarly, this should fail ... -AUTOMAKE_fails --nonexistent 2stderr +AUTOMAKE_fails --nonexistent grep ':.*nonexistent' stderr # ... but this should not.
Re: Python 3.0 support
Hi Johan, long time ago, you submitted patches for Python 3.0 support. Copyright papers are in place now (they've been for a few weeks but apparently I hadn't been notified, and I was intelligent enough to overlook them in the list last time). So I've applied your changes to the git master branch of Automake now, and put you in THANKS. Many thanks again! Cheers, Ralf 2008-10-26 Johan Dahlin [EMAIL PROTECTED] Support for Python 3.0, drop support for pre-2.0. * lib/py-compile: Do not import string; use sys.stdout.write instead of print, files.split instead of string.split. * m4/python.m4 (AM_PATH_PYTHON): Also look for python3 and phython3.0; do not look for python1.5. Use sys.stdout.write. (AM_PYTHON_CHECK_VERSION): Do not use string; adjust to xrange removal in Python 3.0, and changed semantics of map. * doc/automake.texi (Python, Hard-Coded Install Paths): Update Python versions mentioned in the manual, using 2.5 everywhere. * NEWS, THANKS: Update. diff --git a/NEWS b/NEWS index 1a14ec6..42107a2 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,9 @@ New in 1.10a: - Files with extension .sx are also treated as preprocessed assembler. + - Python 3.0 is supported now, Python releases prior to 2.0 are no +longer supported. + * Miscellaneous changes: - Automake development is done in a git repository on Savannah now, see diff --git a/doc/automake.texi b/doc/automake.texi index c2e0be5..122b977 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -7380,11 +7380,11 @@ AM_PATH_PYTHON([2.2]) @noindent This is fine when Python is an absolute requirement for the package. -If Python = 2.2 was only @emph{optional} to the package, +If Python = 2.5 was only @emph{optional} to the package, @code{AM_PATH_PYTHON} could be called as follows. @example -AM_PATH_PYTHON([2.2],, [:]) +AM_PATH_PYTHON([2.5],, [:]) @end example @code{AM_PATH_PYTHON} creates the following output variables based on @@ -7408,7 +7408,7 @@ as follows. @item PYTHON_VERSION The Python version number, in the form @[EMAIL PROTECTED] -(e.g., @samp{1.5}). This is currently the value of +(e.g., @samp{2.5}). This is currently the value of @samp{sys.version[:3]}. @item PYTHON_PREFIX @@ -10983,7 +10983,7 @@ where to install the library, it will answer something like this: @example % @kbd{python -c 'from distutils import sysconfig; print sysconfig.get_python_lib(1,0)'} -/usr/lib/python2.3/site-packages +/usr/lib/python2.5/site-packages @end example If you indeed use this absolute path to install your shared library, @@ -10997,7 +10997,7 @@ installation prefix. @example % @kbd{python -c 'from distutils import sysconfig; print sysconfig.get_python_lib(1,0,[EMAIL PROTECTED]@})'} [EMAIL PROTECTED]@}/lib/python2.3/site-packages [EMAIL PROTECTED]@}/lib/python2.5/site-packages @end example You can also use this new path. If you do diff --git a/lib/py-compile b/lib/py-compile index 865cda8..88776bc 100755 --- a/lib/py-compile +++ b/lib/py-compile @@ -1,9 +1,10 @@ #!/bin/sh # py-compile - Compile a Python program -scriptversion=2005-05-14.22 +scriptversion=2008-10-26.11 -# Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008 Free Software +# Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -101,38 +102,38 @@ else fi $PYTHON -c -import sys, os, string, py_compile +import sys, os, py_compile files = '''$files''' -print 'Byte-compiling python modules...' -for file in string.split(files): +sys.stdout.write('Byte-compiling python modules...\n') +for file in files.split(): $pathtrans $filetrans if not os.path.exists(filepath) or not (len(filepath) = 3 and filepath[-3:] == '.py'): - continue -print file, + continue +sys.stdout.write(file) sys.stdout.flush() py_compile.compile(filepath, filepath + 'c', path) -print || exit $? +sys.stdout.write('\n') || exit $? # this will fail for python 1.5, but that doesn't matter ... $PYTHON -O -c -import sys, os, string, py_compile +import sys, os, py_compile files = '''$files''' -print 'Byte-compiling python modules (optimized versions) ...' -for file in string.split(files): +sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n') +for file in files.split(): $pathtrans $filetrans if not os.path.exists(filepath) or not (len(filepath) = 3 and filepath[-3:] == '.py'): - continue -print file, + continue +sys.stdout.write(file) sys.stdout.flush() py_compile.compile(filepath, filepath + 'o', path) -print 2/dev/null || : +sys.stdout.write('\n') 2/dev/null || : #
Minor file checking optimization: set_dir_cache_file.
This patch has a bit nonobvious consequences. The dir_has_case_matching_file function in FileUtils.pm maintains a directory entry cache, and when we install an aux file, automake simply forgets the cache for that directory. This optimization simply updates the cache with the knowledge we have: new file, no other changes. The change can help to uncover code paths where files are changed behind automake's back (for example from another thread), which I consider a Good Thing. FWIW, this is really a minor optimization with no visible speed benefits. Pushed to master. Cheers, Ralf Minor file checking optimization: set_dir_cache_file. * lib/Automake/FileUtils.pm (set_dir_cache_file): New function. * automake.in (require_file_internal): Instead of resetting the cache when a file has been installed, simply correct the cache using set_dir_cache_file. diff --git a/automake.in b/automake.in index fea0906..fabeb48 100755 --- a/automake.in +++ b/automake.in @@ -7387,7 +7387,7 @@ sub require_file_internal ($$$@) $suppress = 0; $trailer = \nerror while copying; } - reset_dir_cache ($dir); + set_dir_cache_file ($dir, $file); } if (! maybe_push_required_file (dirname ($fullfile), diff --git a/lib/Automake/FileUtils.pm b/lib/Automake/FileUtils.pm index 2200be0..facde3f 100644 --- a/lib/Automake/FileUtils.pm +++ b/lib/Automake/FileUtils.pm @@ -47,7 +47,9 @@ use vars qw (@ISA @EXPORT); @EXPORT = qw (open_quote contents find_file mtime update_file up_to_date_p - xsystem xsystem_hint xqx dir_has_case_matching_file reset_dir_cache); + xsystem xsystem_hint xqx + dir_has_case_matching_file reset_dir_cache + set_dir_cache_file); =item Copen_quote ($file_name) @@ -416,6 +418,19 @@ sub reset_dir_cache ($) delete $_directory_cache{$_[0]}; } +=item Cset_dir_cache_file ($dirname, $file_name) + +State that C$dirname contains C$file_name now. + +=cut + +sub set_dir_cache_file ($$) +{ + my ($dirname, $file_name) = @_; + $_directory_cache{$dirname}{$file_name} = 1 +if exists $_directory_cache{$dirname}; +} + 1; # for require ### Setup GNU style for perl-mode and cperl-mode.
Parallel automake execution: AUTOMAKE_JOBS. [1/4]
This patch provides the basic functionality. It aims to provide unchanged code paths for the non-threaded case. Notable hack in Channels.pm: before exiting due to an internal error, it is necessary to flush stderr. Otherwise, if a worker thread exits here, its output may not appear. Strictly speaking, it is bad style anyway to exit the program from a non-master thread, but since it happens only in situations where we are borked anyway, I'm not so worried. Might be fixed later. I've put Joakim in THANKS. Cheers, Ralf Parallel automake execution: AUTOMAKE_JOBS. * lib/Automake/Config.in (perl_threads): New global. * automake.in: Use it. If the perl supports interpreter-based threading, then use `threads' and `Thread::Queue'. (handle_makefile, handle_makefiles_serial): New functions, factored out from main. (get_number_of_threads): New function, compute number of threads to use, based on environment variable `AUTOMAKE_JOBS' and number of independent makefiles. (handle_makefiles_threaded): New function. Spawn threads, use thread queue to distribute handling the different makefiles. Collect $exit_code values from threads. (main): Use new functions. * aclocal.in: No threads here. * configure.ac: Substitute PERL_THREADS; enabled with perl = 5.7.2 and when ithreads are available. * bootstrap (dosubst): Likewise. * Makefile.am (do_subst): Likewise. * lib/Automake/Makefile.am (do_subst): Likewise. * lib/Automake/ChannelDefs.pm: Use `Automake::Config' and `threads'. (verb): Prepend thread ID (tid) to verbose messages. * lib/Automake/Channels.pm (msg): Before exiting, flush stderr, needed for worker threads. * lib/Automake/tests/Makefile.am (TESTS_ENVIRONMENT): Also include the build tree path, so Config.pm is found. * tests/parallel-am.test: New test. * tests/Makefile.am: Update. * doc/automake.texi (Invoking Automake): Document AUTOMAKE_JOBS. * NEWS, THANKS: Update. Report about long execution times by Joakim Tjernlund and others. diff --git a/Makefile.am b/Makefile.am index 3924daa..8b83cad 100644 --- a/Makefile.am +++ b/Makefile.am @@ -70,6 +70,7 @@ do_subst = sed \ -e 's,[EMAIL PROTECTED]@],$(PACKAGE),g' \ -e 's,[EMAIL PROTECTED]@],$(PATH_SEPARATOR),g' \ -e 's,[EMAIL PROTECTED]@],$(PERL),g' \ + -e 's,[EMAIL PROTECTED]@],$(PERL_THREADS),g' \ -e 's,[EMAIL PROTECTED]@],$(SHELL),g' \ -e 's,[EMAIL PROTECTED]@],$(VERSION),g' \ -e 's,[EMAIL PROTECTED]@],Generated from [EMAIL PROTECTED]; do not edit by hand.,g' \ diff --git a/NEWS b/NEWS index dce4bbd..9d123f1 100644 --- a/NEWS +++ b/NEWS @@ -10,7 +10,15 @@ New in 1.10a: (and new in Automake 1.10) is degraded to a warning. This helps in the common case where the Autoconf versions used are compatible. -* Change to Libtool support: +* Changes to automake: + + - The automake program can run multiple threads for creating most +Makefile.in files concurrently, if at least Perl 5.7.2 is available +with interpreter-based threads enabled. Set the environment variable +AUTOMAKE_JOBS to the maximum number of threads to use, in order to +enable this experimental feature. + +* Changes to Libtool support: - Libtool generic flags are now passed to the install and uninstall modes as well. diff --git a/aclocal.in b/aclocal.in index 44d3d1e..3cfe1c0 100644 --- a/aclocal.in +++ b/aclocal.in @@ -47,6 +47,9 @@ use Cwd; # Some globals. +# We do not operate in threaded mode. +$perl_threads = 0; + # Include paths for searching macros. We search macros in this order: # user-supplied directories first, then the directory containing the # automake macros, and finally the system-wide directories for diff --git a/automake.in b/automake.in index fabeb48..c9b1c63 100755 --- a/automake.in +++ b/automake.in @@ -128,6 +128,11 @@ package Automake; use strict; use Automake::Config; +if ($perl_threads) + { +use threads; +use Thread::Queue; + } use Automake::General; use Automake::XFile; use Automake::Channels; @@ -7984,6 +7989,123 @@ sub parse_arguments () if $errspec ! @input_files; } + +# handle_makefile ($MAKEFILE_IN) +# -- +# Deal with $MAKEFILE_IN. +sub handle_makefile ($) +{ + my ($file) = @_; + ($am_file = $file) =~ s/\.in$//; + if (! -f ($am_file . '.am')) +{ + error `$am_file.am' does not exist; +} + else +{ + # Any warning setting now local to this Makefile.am. + dup_channel_setup; + + generate_makefile ($am_file . '.am', $file); + + # Back out any warning setting. + drop_channel_setup; +} +} + +# handle_makefiles_serial () +# -- +# Deal with all makefiles, without threads. +sub handle_makefiles_serial () +{ + foreach my $file (@input_files) +
Parallel automake --add-missing: serialized file installs. [4/4]
The final piece. A bit ugly because the changes in require_conf_file depend on nonlocal semantics in require_file_internal and in maybe_push_required_file. Oh well. Cheers, Ralf Parallel automake --add-missing: serialized file installs. * automake.in (QUEUE_CONF_FILE, QUEUE_LOCATION, QUEUE_STRING): New serialization keys. ($required_conf_file_queue): New file global. (queue_required_conf_file, require_queued_conf_file): New functions, to queue and dequeue requirements for aux dir files. (require_conf_file): Enqueue if needed. (get_number_of_threads): Can do threads with --add-missing now. (handle_makefiles_threaded): Let worker threads enqueue, let master attend to queued requirements at the right time. * tests/parallel-am.test: Explain the purpose of the include chain used here. * tests/parallel-am2.test: Also cope with --add-missing. * tests/parallel-am3.test: New test, test absence of races with concurrent same-file installs stemming from --add-missing. * tests/Makefile.am: Adjust. diff --git a/automake.in b/automake.in index d7db627..0815773 100755 --- a/automake.in +++ b/automake.in @@ -280,6 +280,9 @@ use constant INTERNAL = new Automake::Location; # Serialization keys for message queues. use constant { QUEUE_MESSAGE = msg, + QUEUE_CONF_FILE = conf file, + QUEUE_LOCATION = location, + QUEUE_STRING= string }; @@ -7475,13 +7478,80 @@ sub require_libsource_with_macro ($$$@) } } +# Queue to push require_conf_file requirements to. +my $required_conf_file_queue; + +# queue_required_conf_file ($QUEUE, $KEY, $DIR, $WHERE, $MYSTRICT, @FILES) +# - +sub queue_required_conf_file (@) +{ +my ($queue, $key, $dir, $where, $mystrict, @files) = @_; +my @serial_loc; +if (ref $where) + { +@serial_loc = (QUEUE_LOCATION, $where-serialize ()); + } +else + { +@serial_loc = (QUEUE_STRING, $where); + } +$queue-enqueue ($key, $dir, @serial_loc, $mystrict, 0 + @files, @files); +} + +# require_queued_conf_file ($QUEUE) +# -- +sub require_queued_conf_file ($) +{ +my ($queue) = @_; +my $where; +my $dir = $queue-dequeue (); +my $loc_key = $queue-dequeue (); +if ($loc_key eq QUEUE_LOCATION) + { + $where = Automake::Location::deserialize ($queue); + } +elsif ($loc_key eq QUEUE_STRING) + { + $where = $queue-dequeue (); + } +else + { + prog_error unexpected key $loc_key; + } +my $mystrict = $queue-dequeue (); +my $nfiles = $queue-dequeue (); +my @files; +push @files, $queue-dequeue () + foreach (1 .. $nfiles); + +# Dequeuing happens outside of per-makefile context, so we have to +# set the variables used by require_file_internal and the functions +# it calls. Gross! +$relative_dir = $dir; +require_file_internal ($where, $mystrict, $config_aux_dir, @files); +} + # require_conf_file ($WHERE, $MYSTRICT, @FILES) # -- -# Looks in configuration path, as specified by AC_CONFIG_AUX_DIR. +# Looks in configuration path, as specified by AC_CONFIG_AUX_DIR; +# worker threads may queue up the action to be serialized by the master. +# +# FIXME: this seriously relies on the semantics of require_file_internal +# and maybe_push_required_file, in that we exploit the fact that only the +# contents of the last handled output file may be impacted (which in turn +# is dealt with by the master thread). sub require_conf_file ($$@) { my ($where, $mystrict, @files) = @_; -require_file_internal ($where, $mystrict, $config_aux_dir, @files); +if (defined $required_conf_file_queue) + { + queue_required_conf_file ($required_conf_file_queue, QUEUE_CONF_FILE, + $relative_dir, $where, $mystrict, @files); + } +else + { + require_file_internal ($where, $mystrict, $config_aux_dir, @files); + } } @@ -8051,11 +8121,6 @@ sub get_number_of_threads { $nthreads = $max_threads; } - - # We cannot deal with --add-missing (yet). - $nthreads = 0 -if ($add_missing); - return $nthreads; } @@ -8066,6 +8131,7 @@ sub get_number_of_threads # worker threads push back everything that needs serialization: # * warning and (normal) error messages, for stable stderr output # order and content (avoiding duplicates, for example), +# * races when installing aux files (and respective messages), # * races when collecting aux files for distribution. # # The latter requires that the makefile that deals with the aux dir @@ -8101,9 +8167,11 @@ sub handle_makefiles_threaded ($) verb handling $file; my $queue = $msg_queues{$file}; setup_channel_queue ($queue,
Fix maintainer-check failure.
Applied to evade the test in toplevel Makefile.am. Cheers, Ralf Fix maintainer-check failure. * tests/parallel-am.test: Rename variable to not match pattern used in maintainer-check. diff --git a/tests/parallel-am.test b/tests/parallel-am.test index de86271..8bd5585 100755 --- a/tests/parallel-am.test +++ b/tests/parallel-am.test @@ -84,8 +84,8 @@ $ACLOCAL unset AUTOMAKE_JOBS AUTOMAKE_run 0 --add-missing mv stderr expected -makefile_ins=`find . -name Makefile.in` -for file in $makefile_ins; do +Makefile_ins=`find . -name Makefile.in` +for file in $Makefile_ins; do mv $file $file.exp done @@ -96,7 +96,7 @@ for run in 1 2 3 4 5 6 7; do rm -f build-aux/* sub*/Makefile.in AUTOMAKE_run 0 --add-missing diff stderr expected - for file in $makefile_ins; do + for file in $Makefile_ins; do diff $file $file.exp done done
Re: AM_DEFAULT_SOURCE_EXT
Hi Akim, hope I'm not going on your nerves yet .. ;-) * Ralf Wildenhues wrote on Tue, Oct 21, 2008 at 05:00:34AM CEST: * Akim Demaille wrote on Mon, Oct 20, 2008 at 12:56:23AM CEST: Le 18 oct. 08 à 03:02, Ralf Wildenhues a écrit : * Akim Demaille wrote on Thu, Oct 16, 2008 at 04:11:22PM CEST: AM_DEFAULT_SOURCE_EXT = .cc Hum, actually I meant to use extensions without the dot :( Erm, but you certainly didn't write it that way before! ;-) Trying to find a distinctive meaning to extension and suffix… Of course you should add a period before an extension to get a suffix only when the extension is non-empty :) This is a bike-shedding issue, right? Or is there a real reason? FWIW, I find it easier to search for if the dot is part of the thing; also, most uses inside automake include the dot (accept_extension et al). OK, so I thought long enough about this issue to find an actual argument to support my case, and failed to find a good one for your case in the next couple of seconds after that. :-) Here it goes: the user could arguably want to use file names that do not contain a dot _at all_. So, the setup could be AM_DEFAULT_SOURCE_EXT = -bla bin_PROGRAMS = foo foo.c: foo-bla generate $@ from foo-bla CLEANFILES = foo.c and automake would happily generate bla_SOURCES = foo-bla The only thing that is missing from portable make is that an inference rule SUFFIXES = -bla .c -bla.c: generate foo.c from foo-bla is not Posix-conforming (but in practice supported by several make implementations). I am wondering whether DEFAULT_SOURCE_EXT would be preferable to AM_DEFAULT_SOURCE_EXT? I made it AM_ to avoid infringing on the user name space, but I'm fine with just any name. Good enough; I stuck with AM_DEFAULT_SOURCE_EXT for now. Here's what I pushed. Cheers, Ralf Choose default source extension: AM_DEFAULT_SOURCE_EXT. * automake.in (handle_source_transform): Accept unconditional literal extension in AM_DEFAULT_SOURCE_EXT as override for the default source extension `.c'. If set, ignore the old default source rule for libtool libraries. * doc/automake.texi (Default _SOURCES): Document this. * NEWS: Update. * tests/specflg10.test: New test. * tests/Makefile.am: Update. Suggestion by Akim Demaille. diff --git a/NEWS b/NEWS index 98f6b53..5c7d295 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,9 @@ New in 1.10a: - Python 3.0 is supported now, Python releases prior to 2.0 are no longer supported. + - The default source file extension (.c) can be overridden with +AM_DEFAULT_SOURCE_EXT now. + * Miscellaneous changes: - Automake development is done in a git repository on Savannah now, see diff --git a/automake.in b/automake.in index 0815773..4b54457 100755 --- a/automake.in +++ b/automake.in @@ -2058,10 +2058,16 @@ sub handle_source_transform (%) if (scalar @keys == 0) { # The default source for libfoo.la is libfoo.c, but for - # backward compatibility we first look at libfoo_la.c + # backward compatibility we first look at libfoo_la.c, + # if no default source suffix is given. my $old_default_source = $one_file.c; - (my $default_source = $unxformed) =~ s,(\.[^./\\]*)?$,.c,; + my $ext_var = var ('AM_DEFAULT_SOURCE_EXT'); + my $default_source_ext = $ext_var ? variable_value ($ext_var) : '.c'; + msg_var ('unsupported', $ext_var, $ext_var-name . can assume at most one value) + if $default_source_ext =~ /[\t ]/; + (my $default_source = $unxformed) =~ s,(\.[^./\\]*)?$,$default_source_ext,; if ($old_default_source ne $default_source +!$default_source_ext (rule $old_default_source || rule '$(srcdir)/' . $old_default_source || rule '${srcdir}/' . $old_default_source diff --git a/doc/automake.texi b/doc/automake.texi index cd2f920..86f1312 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -5605,6 +5605,7 @@ and we recommend avoiding it until you find it is required. @vindex SOURCES @cindex @code{_SOURCES}, default @cindex default @code{_SOURCES} [EMAIL PROTECTED] AM_DEFAULT_SOURCE_EXT @code{_SOURCES} variables are used to specify source files of programs (@pxref{A Program}), libraries (@pxref{A Library}), and Libtool @@ -5613,8 +5614,7 @@ libraries (@pxref{A Shared Library}). When no such variable is specified for a target, Automake will define one itself. The default is to compile a single C file whose base name is the name of the target itself, with any extension replaced by [EMAIL PROTECTED] (Defaulting to C is terrible but we are stuck with it for -historical reasons.) [EMAIL PROTECTED], which defaults to @file{.c}. For example if you have the following somewhere in your @file{Makefile.am} with no corresponding @code{libfoo_a_SOURCES}: @@ -5631,7 +5631,7 @@ would be built from @file{sub_libc___a.c}, i.e
New maintainer target release-stats.
This patch is purely an aid for keeping the manual up to date. It is a bit system-dependent: you need pstops for it. And the output should be inspected for sanity, as some of the commands are pretty heuristic. Applied master and branch-1-10. Cheers, Ralf New maintainer target release-stats. * Makefile.am (release-stats): New target, to help computing the entries in the statistics table in automake.texi. * doc/automake.texi (Releases): Reformat a bit. Add number of generated files. Add entry for 1.10.1. diff --git a/HACKING b/HACKING index 5e7191f..5df650e 100644 --- a/HACKING +++ b/HACKING @@ -143,6 +143,9 @@ * Run ./bootstrap, ./configure, make. +* Run `make release-stats' if release statistics in doc/automake.texi + have not been updated yet. + * NOTE: the next step has not been tested yet with git, so be careful. * Run `make git-release'. diff --git a/Makefile.am b/Makefile.am index 8b83cad..55e1a66 100644 --- a/Makefile.am +++ b/Makefile.am @@ -435,3 +435,32 @@ fetch: test $$stat = 0 || \ echo See Fetchdir/update.patch for a log of the changes.; \ exit $$stat + +## Generate release statistics, for the table in automake.texi. +## This has to be run in an up to date build tree, but there must +## be no temp files nor unused other files lying around! +release-stats: ps + @am=`wc -l automake` \ + acl=`wc -l aclocal` \ + pmfiles=lib/Automake/*.pm \ + if test . != '$(srcdir)'; then pmfiles=$$pmfiles $(srcdir)/lib/Automake/*.pm; \ + else :; fi \ + pm=`cat $$pmfiles | wc -l` \ + dot_am_files=`ls -1 $(srcdir)/lib/am/*.am | grep -v Makefile.am` \ + amf=`echo $$dot_am_files | wc -l` \ + aml=`cat $$dot_am_files | wc -l` \ + m4f=`ls -1 $(srcdir)/m4/*.m4 | wc -l` \ + m4l=`cat $(srcdir)/m4/*.m4 | wc -l` \ + doc_text=`cd doc LC_ALL=C pstops 0 automake.ps unused.ps 21` \ + rm -f doc/unused.ps \ + doc=`echo $$doc_text | sed -n 's/.*Wrote \([1-9][0-9]*\) pages.*/\1/p'` \ + tests=tests/*.test; \ + if test . != '$(srcdir)'; then tests=$$tests $(srcdir)/tests/*.test; \ + else :; fi \ + t=`ls -1 $$tests | wc -l` \ + tgen=`ls -1 $$tests | grep '.-p\.test' | wc -l` \ + today=`date +%Y-%m-%d` \ + echo add this to the table in doc/automake.texi after verification: \ + printf '@item %s @tab %-6s @tab %4d @tab %4d @tab %4d @tab %4d %-4s @tab %4d %-4s @tab %3d @tab %d %-4s\n' \ + $$today $(VERSION) $$am$$acl$$pm $$aml ($$amf) $$m4l ($$m4f) $$doc $$t ($$tgen) +.PHONY: release-stats diff --git a/doc/automake.texi b/doc/automake.texi index 86f1312..acb97cd 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -12104,18 +12104,19 @@ The number of lines of the @command{aclocal} script. @item pm The number of lines of the @command{Perl} supporting modules. @item @file{*.am} -The number of lines of the @file{Makefile} fragments. The number in parenthesis -is the number of files. +The number of lines of the @file{Makefile} fragments. The number in +parentheses is the number of files. @item m4 The number of lines (and files) of Autoconf macros. @item doc The number of pages of the documentation (the Postscript version). @item t -The number of test cases in the test suite. +The number of test cases in the test suite. Of those, the number in +parentheses is the number of generated test cases. @end table [EMAIL PROTECTED] {-88-88} {8.8-p8} {} {} {} { (88)} { (88)} {888} {888} [EMAIL PROTECTED] Date @tab Rel @tab am @tab acl @tab pm @tab @file{*.am} @tab m4 @tab doc @tab t [EMAIL PROTECTED] {-88-88} {8.8-p8} {} {} {} { (88)} { (88)} {888} {888 (88)} [EMAIL PROTECTED] Date @tab Rel@tab am @tab acl @tab pm @tab @file{*.am} @tab m4 @tab doc @tab t @item 1994-09-19 @tab CVS@tab 141 @tab @tab @tab 299 (24) @tab @tab @tab @item 1994-11-05 @tab CVS@tab 208 @tab @tab @tab 332 (28) @tab @tab @tab @item 1995-11-23 @tab 0.20 @tab 533 @tab @tab @tab 458 (35) @tab @tab 9 @tab @@ -12171,6 +12172,7 @@ The number of test cases in the test suite. @item 2005-02-13 @tab 1.9.5 @tab 7523 @tab 719 @tab 7859 @tab 3373 (40) @tab 1453 (32) @tab 142 @tab 562 @item 2005-07-10 @tab 1.9.6 @tab 7539 @tab 699 @tab 7867 @tab 3400 (40) @tab 1453 (32) @tab 144 @tab 570 @item 2006-10-15 @tab 1.10 @tab 7859 @tab 1072 @tab 8024 @tab 3512 (40) @tab 1496 (34) @tab 172 @tab 604 [EMAIL PROTECTED] 2008-01-19 @tab 1.10.1 @tab 7870 @tab 1089 @tab 8025 @tab 3520 (40) @tab 1499 (34) @tab 173 @tab 617 @end multitable
Multiple 'make uninstall' should not fail even for TEXINFOS.
Hello help-texinfo readers, I'm considering putting this into Automake. It would let the uninstall rules generated by automake be idempotent, which seems sensible to me. Any reasons against doing so? Thanks! Ralf Multiple 'make uninstall' should not fail even for TEXINFOS. * lib/am/texinfos.am (uninstall-info-am): Do not fail due to install-info if the installed file does not exist (any more). * tests/txinfo26.test: Issue multiple `make uninstall'. * tests/instmany-mans.test: Likewise. * tests/instmany-python.test: Likewise. * tests/instmany.test: Likewise. * tests/txinfo26.test: Likewise. * NEWS: Update. diff --git a/NEWS b/NEWS index cc7c41f..48f8b71 100644 --- a/NEWS +++ b/NEWS @@ -75,7 +75,8 @@ New in 1.10a: installation directory now, when no build-local scripts are used. For built-in rules, `make install' now fails reliably if installation -of a file failed. +of a file failed. Conversely, `make uninstall' even succeeds when +issued multiple times. These changes may need some adjustments from users: For example, some `install' programs refuse to install multiple copies of the diff --git a/lib/am/texinfos.am b/lib/am/texinfos.am index 9cfc645..382a7c8 100644 --- a/lib/am/texinfos.am +++ b/lib/am/texinfos.am @@ -306,8 +306,11 @@ uninstall-info-am: relfile=`echo $$file | sed 's|^.*/||'`; \ ## install-info needs the actual info file. We use the installed one, ## rather than relying on one still being in srcdir or builddir. +## However, `make uninstall make uninstall' should not fail, +## so we ignore failure if the file did not exist. echo install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'; \ - install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile; \ + if install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile; \ + then :; else test ! -f $(DESTDIR)$(infodir)/$$relfile || exit 1; fi; \ done; \ else :; fi @$(NORMAL_UNINSTALL) diff --git a/tests/instmany-mans.test b/tests/instmany-mans.test index 3f331a6..773fa76 100755 --- a/tests/instmany-mans.test +++ b/tests/instmany-mans.test @@ -117,6 +117,8 @@ cd build $MAKE # Try whether native install (or install-sh) works. $MAKE install +# Multiple uninstall should work, too. +$MAKE uninstall $MAKE uninstall test `find $instdir -type f -print | wc -l` = 0 diff --git a/tests/instmany-python.test b/tests/instmany-python.test index beace0c..9f65237 100755 --- a/tests/instmany-python.test +++ b/tests/instmany-python.test @@ -106,6 +106,8 @@ cd build $MAKE # Try whether native install (or install-sh) works. $MAKE install +# Multiple uninstall should work, too. +$MAKE uninstall $MAKE uninstall test `find $instdir -type f -print | wc -l` = 0 diff --git a/tests/instmany.test b/tests/instmany.test index f67e6fa..31176d7 100755 --- a/tests/instmany.test +++ b/tests/instmany.test @@ -132,6 +132,8 @@ cd build $MAKE # Try whether native install (or install-sh) works. $MAKE install +# Multiple uninstall should work, too. +$MAKE uninstall $MAKE uninstall test `find $instdir -type f -print | wc -l` = 0 diff --git a/tests/txinfo26.test b/tests/txinfo26.test index 52a7f78..87b4ba6 100755 --- a/tests/txinfo26.test +++ b/tests/txinfo26.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003, 2007 Free Software Foundation, Inc. +# Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -64,3 +64,6 @@ test -f _inst/info/main.info $MAKE uninstall test ! -f _inst/info/main.info test -f ../main.info + +# multiple uninstall should not fail. +$MAKE uninstall
Re: AM_DEFAULT_SOURCE_EXT
* Ralf Wildenhues wrote on Sun, Nov 02, 2008 at 10:58:08PM CET: Choose default source extension: AM_DEFAULT_SOURCE_EXT. * automake.in (handle_source_transform): Accept unconditional literal extension in AM_DEFAULT_SOURCE_EXT as override for the default source extension `.c'. If set, ignore the old default source rule for libtool libraries. * doc/automake.texi (Default _SOURCES): Document this. * NEWS: Update. * tests/specflg10.test: New test. * tests/Makefile.am: Update. Suggestion by Akim Demaille. This caused a small regression, because I didn't rename variables consistently. Fixed thusly. Cheers, Ralf Fix regression introduced by AM_DEFAULT_SOURCE_EXT. * automake.in (handle_source_transform): Use the right variable when determining whether to apply the old rule for the libtool library default source name. Testsuite failure exposed by Bob Proulx' build daemon. diff --git a/automake.in b/automake.in index 9665e0b..9f50c8c 100755 --- a/automake.in +++ b/automake.in @@ -2085,7 +2085,7 @@ sub handle_source_transform (%) if $default_source_ext =~ /[\t ]/; (my $default_source = $unxformed) =~ s,(\.[^./\\]*)?$,$default_source_ext,; if ($old_default_source ne $default_source -!$default_source_ext +!$ext_var (rule $old_default_source || rule '$(srcdir)/' . $old_default_source || rule '${srcdir}/' . $old_default_source
Testsuite fixes for ksh.
Pushed a couple of trivial fixes. Cheers, Ralf Testsuite fixes for ksh. * tests/check10.test: Add ':' as last command in subshell, for zero exit status of the subshell. * tests/parallel-am.test: Do not let failing 'unset' of nonexistent variable exit the test. * tests/parallel-am2.test: Likewise. * tests/parallel-am3.test: Likewise. diff --git a/tests/check10.test b/tests/check10.test index c817dcb..138331c 100755 --- a/tests/check10.test +++ b/tests/check10.test @@ -72,6 +72,7 @@ unset TESTS || : env TESTS=xpass xpass2 $MAKE -e check env TESTS='pass skip xfail' $MAKE -e check $MAKE check + : ) stdout cat stdout diff --git a/tests/parallel-am.test b/tests/parallel-am.test index 8bd5585..e2101e5 100755 --- a/tests/parallel-am.test +++ b/tests/parallel-am.test @@ -81,7 +81,7 @@ $ACLOCAL # Further, automake output should be stable. # Generate expected output using the non-threaded code. -unset AUTOMAKE_JOBS +unset AUTOMAKE_JOBS || : AUTOMAKE_run 0 --add-missing mv stderr expected Makefile_ins=`find . -name Makefile.in` diff --git a/tests/parallel-am2.test b/tests/parallel-am2.test index b92b79e..9e002ba 100755 --- a/tests/parallel-am2.test +++ b/tests/parallel-am2.test @@ -61,7 +61,7 @@ $ACLOCAL # Thus we install the auxiliary files in a prior step. # Generate expected output using non-threaded code. -unset AUTOMAKE_JOBS +unset AUTOMAKE_JOBS || : rm -f install-sh missing depcomp AUTOMAKE_fails --add-missing mv stderr expected diff --git a/tests/parallel-am3.test b/tests/parallel-am3.test index b3b0aac..11e4706 100755 --- a/tests/parallel-am3.test +++ b/tests/parallel-am3.test @@ -57,7 +57,7 @@ mkdir build-aux $ACLOCAL # Generate expected output using the non-threaded code. -unset AUTOMAKE_JOBS +unset AUTOMAKE_JOBS || : AUTOMAKE_run 0 --add-missing mv stderr expected mv Makefile.in Makefile.in.exp
Re: gnupload and delete
Hi Karl, * Karl Berry wrote on Wed, Nov 12, 2008 at 08:12:10PM CET: It is not exactly simple to figure out how to delete (archive) files from ftp.gnu.org and alpha.gnu.org with the ftp directives, and anyway constructing the directive files and uploading them by hand is always a pain. This patch adds a --delete option so gnupload can do it. It worked ok in my tests, FWIW. Thanks for the patch, and the testing. I've applied it to master and branch-1-10, and updated $scriptversion, with one little change: + directive=filename: `basename -- \$file\` For portability, this should be directive=filename: `basename -- $file` I see that I have one other gnupload issue from you pending. Will reply soon. Cheers, Ralf
Re: AM_DEFAULT_SOURCE_EXT
Hi Akim, * Akim Demaille wrote on Mon, Nov 17, 2008 at 09:47:31AM CET: RW == Ralf Wildenhues [EMAIL PROTECTED] writes: hope I'm not going on your nerves yet .. ;-) Well, I'm the one who should plead guilty :( I apologize to be so not responsive. Don't worry. The only thing that is missing from portable make is that an inference rule SUFFIXES = -bla .c -bla.c: generate foo.c from foo-bla is not Posix-conforming (but in practice supported by several make implementations). I did not know it was not. Why not? I thought that SUFFICES suffixes to describe all the possible situations. Well, SUFFIXES suffices for automake. It turns into .SUFFIXES which suffices for most make implementations out there. However, SUSv3 describes: | Inference rules are formatted as follows: | | target: | tabcommand | [tabcommand]... | line that does not begin with tab or # | | The application shall ensure that the target portion is a valid | target name (see Target Rules ) of the form .s2 or .s1.s2 (where .s1 and | .s2 are suffixes that have been given as prerequisites of the .SUFFIXES | special target and s1 and s2 do not contain any slashes or periods.) If | there is only one period in the target, it is a single-suffix inference | rule. Targets with two periods are double-suffix inference rules. | Inference rules can have only one target before the colon. so with anything other than exactly one leading dot in the suffix, we leave the Posix realm here. My point about dropping the dot was really just to make it easier to describe a _tool_ connected to an extension, rather that a _rule_. But it's really a weak issue, maybe we can find an alternative syntax if there is really a need. I think we can. Cheers, Ralf
Re: [PATCH] more typo/grammar fixes in documentation
Hello William, thanks for the patches. I merged them and applied them, with one change, to master and branch-1-10: * William Pursell wrote on Thu, Nov 20, 2008 at 06:27:33AM CET: @@ -11504,7 +11504,7 @@ announcement that @command{automake} and @command{autoconf} had joined @command{sourceware} was made on 1998-10-26. They were among the first projects to be hosted there. -The heedful reader will have noticed Automake was exactly 4-year-old +The heedful reader will have noticed Automake was exactly 4-years-old on 1998-09-19. I made this 4 years old instead. FWIW, with ChangeLog entries, your patches would be even less work for me to apply. Likewise if you stated if and how you tested them (e.g.: ran 'make info ps pdf' with no errors and no new over-/underfull hboxes). :-) Cheers, Ralf
Re: Question about automatic generation of GPLv3 COPYING file
http://lists.gnu.org/archive/html/bug-automake/2008-09/msg7.html Hello, and apologies for the long delay. I am installing this patch to the git master and branch-1-10 version of Automake. It adds an unconditional note to the output of automake --add-missing that GPLv3 is being installed, and recommends the user to put the file in VCS. All of this happens only if the package uses 'gnu' strictness. You can avoid it by setting 'foreign' strictness. You can further avoid the note by simply having a COPYING file. This is not a warning and not an error (not even with -Werr), since the action not erroneous: the action is well-documented in the Automake manual, and use of the GPLv3 COPYING file is the normal (and recommended) thing to do for packages that desire 'gnu' strictness. Packages that do not desire this can set a different strictness in the input files or keep a COPYING file around. I considered letting automake ask the user for feedback. This however is not appropriate IMVHO: automake is often used non-interactively. We would be breaking many currently working setups. For more information, please see the relevant sections in the manual. http://www.gnu.org/software/automake/manual/html_node/Strictness.html http://www.gnu.org/software/automake/manual/html_node/Gnits.html http://www.gnu.org/software/automake/manual/html_node/Options.html http://www.gnu.org/software/automake/manual/html_node/Invoking-Automake.html Please note that the patch amends the sections 'Gnits' and 'Invoking Automake' to be clearer about this issue. I intend to do a point release 1.10.2 with this change very soon, hopefully this weekend. I've added Brian to THANKS. Cheers, Ralf When installing COPYING, recommend adding the file to VCS. * automake.in (require_file_internal): If installing `COPYING', mention that we install the GPLv3 file and recommend adding the file to version control. * doc/automake.texi (Invoking Automake): Point to `Gnits' node for `--add-missing'. (Gnits): Clarify semantics: that for strictness gnu or higher, INSTALL is installed, and that COPYING is installed as GPLv3 if no COPYING file exists. * tests/license2.test: New test. * tests/Makefile.am: Update. * NEWS, THANKS: Update. Report by Brian Cameron. Signed-off-by: Ralf Wildenhues [EMAIL PROTECTED] diff --git a/NEWS b/NEWS index f258983..9da3a93 100644 --- a/NEWS +++ b/NEWS @@ -60,8 +60,9 @@ New in 1.10a: - Automake is licensed under GPLv3+. `automake --add-missing' will by default install the GPLv3 file as COPYING if it is missing. -Note that Automake will never overwrite an existing COPYING file, -even when the `--force-missing' option is used. +It will also warn that the license file should be added to source +control. Note that Automake will never overwrite an existing COPYING +file, even when the `--force-missing' option is used. - The manual is now distributed under the terms of the GNU FDL 1.3. diff --git a/automake.in b/automake.in index cdb7dd5..691bad3 100755 --- a/automake.in +++ b/automake.in @@ -7591,6 +7591,7 @@ sub require_file_internal ($$$@) } my $trailer = ''; + my $trailer2 = ''; my $suppress = 0; # Only install missing files according to our desired @@ -7606,6 +7607,17 @@ sub require_file_internal ($$$@) # can, copy if we must. Note: delete the file # first, in case it is a dangling symlink. $message = installing `$fullfile'; + + # The license file should not be volatile. + if ($file eq COPYING) + { + $message .= using GNU General Public License v3 file; + $trailer2 = \nConsider adding the COPYING file + . to the version control system + . \nfor your code, to avoid questions + . about which license your project uses.; + } + # Windows Perl will hang if we try to delete a # file that doesn't exist. unlink ($fullfile) if -f $fullfile; @@ -7658,7 +7670,7 @@ sub require_file_internal ($$$@) next if !$suppress rule $file; - msg ($suppress ? 'note' : 'error', $where, $message$trailer); + msg ($suppress ? 'note' : 'error', $where, $message$trailer$trailer2); } } } diff --git a/doc/automake.texi b/doc/automake.texi index a164d03..af1e930 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -2439,6 +2439,9 @@ Therefore, @code{AC_CONFIG_AUX_DIR}'s setting affects whether a file is considered missing, and where the missing file is added (@pxref{Optional}). +In some strictness modes
Re: [PATCH] Add xz compression support.
Hi Jim, * Jim Meyering wrote on Thu, Nov 20, 2008 at 10:09:03AM CET: Just to let you know that the latest changes in the upstream LZMA-utils repository (git://ctrl.tukaani.org/lzma-utils.git) make it so that the primary tool name is now xz rather than lzma. The commit log for e114502b2bc371e4a45449832cb69be036360722 includes this: Updated to the latest, probably final file format version Thanks, and sorry for the delay. Between the autotools packages, I keep pushing a backlog of about two dozen patches, for months already. :-/ At some point I need to get rid of some old ones first, to avoid them being stalled forever. Anyway, thanks for the patch. Committed to master with only minor modifications. It would be nice if you could test the new test to ensure that it passes with 'xz' installed (I haven't done that on my system yet, let's see if Debian uploads a package for it soon). Thanks. Cheers, Ralf
Re: [PATCH] Add xz compression support.
* Jim Meyering wrote on Sat, Nov 22, 2008 at 02:17:55PM CET: Ralf Wildenhues [EMAIL PROTECTED] wrote: ... Anyway, thanks for the patch. Committed to master with only minor modifications. It would be nice if you could test the new test to ensure that it passes with 'xz' installed (I haven't done that on my system yet, let's see if Debian uploads a package for it soon). Thanks. Thanks, Ralf! It does pass, once I fix the following typo: Blush. Fixed as below. Thanks, Ralf commit 3b5acbefe6307a0b04046ed56e902ae374b200b8 Author: Jim Meyering [EMAIL PROTECTED] Date: Sat Nov 22 14:19:35 2008 +0100 Fix typo introduced by Committer in last patch. * tests/xz.test: Fix typo introduced by Ralf in last patch. Signed-off-by: Ralf Wildenhues [EMAIL PROTECTED] diff --git a/ChangeLog b/ChangeLog index e1b8548..42e8664 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2008-11-22 Jim Meyering [EMAIL PROTECTED] + * tests/xz.test: Fix typo introduced by Ralf in last patch. + Add xz compression support. * NEWS: Mention xz as well as lzma (xz will displace lzma). * automake.in (handle_dist): Recognize dist-xz. diff --git a/tests/xz.test b/tests/xz.test index 93f4630..299ce1f 100755 --- a/tests/xz.test +++ b/tests/xz.test @@ -30,7 +30,7 @@ END cat Makefile.am 'END' test: distcheck - test $(DIST_ARCHIVES) = foo-1.0.tar.xz + test $(DIST_ARCHIVES) = xz-1.0.tar.xz test -f $(DIST_ARCHIVES) END
Re: [PATCH 1/3] quotes in configure.ac
Hi William, thanks for the patches. A couple of comments. * William Pursell wrote on Sat, Nov 22, 2008 at 02:20:56PM CET: --- a/configure.ac +++ b/configure.ac @@ -38,7 +38,7 @@ AM_INIT_AUTOMAKE([1.10a dist-bzip2 filename-length-max=99 color-tests]) # * Prereleases on the trunk are all incompatible -- 1.5b and 1.5c # aren't the same. APIVERSION=`echo $VERSION | sed -e 's/^\([[0-9]]*\.[[0-9]]*[[a-z]]*\).*$/\1/'` -AC_SUBST(APIVERSION) +AC_SUBST([APIVERSION]) This is not strictly necessary, but sure, why not be consistent here. Second patch: --- a/doc/automake.texi +++ b/doc/automake.texi @@ -2310,6 +2310,9 @@ implicitly assume that there is a source file named @file{true.c}, and define rules to compile @file{true.o} and link @file{true}. The @samp{true.o: true.c} rule supplied by the above @file{Makefile.am}, will override the Automake generated rule to build @file{true.o}. [EMAIL PROTECTED] Perhaps an explicit reference to AM_DEFAULT_SOURCE_EXT [EMAIL PROTECTED] is appropriate here. +(@pxref{Default _SOURCES}) Good idea. I'll add (@pxref{Default _SOURCES}) right after Automake will implicitly assume that there is a source file named @file{true.c}. @@ -2886,8 +2889,9 @@ If a Lex source file is seen, then this macro must be used. Autoconf Manual}. @item AC_REQUIRE_AUX_FILE [EMAIL PROTECTED] will ensure each file for which this macro is -called exists in the aux directory, and will complain otherwise. It [EMAIL PROTECTED] will look in the aux directory +for each file on which this macro is invoked and will complain if +the file does not exist. It How about this instead: For each @code{AC_REQUIRE_AUX_FILE([EMAIL PROTECTED]@var{file}}])}, @command{automake} will ensure that @[EMAIL PROTECTED] exists in the aux directory, and will complain otherwise. will also automatically distribute the file. This macro should be used by third-party Autoconf macros that requires some supporting files in the aux directory specified with @code{AC_CONFIG_AUX_DIR} @@ -2900,8 +2904,10 @@ generated @file{Makefile.in}, unless @code{AM_SUBST_NOTMAKE} is also used for this variable. @xref{Setting Output Variables, , Setting Output Variables, autoconf, The Autoconf Manual}. +Several macros invoke @code{AC_SUBST} and cause certain +variables to be defined in each generated Makefile.in. Hmm, I'm not too fond of this sentence. I don't really see what value it adds over the following sentence. Can you describe what information you find lacking in the original text, maybe we can find a better way then? If the Autoconf manual says that a macro calls @code{AC_SUBST} for [EMAIL PROTECTED], or defines the output variable @var{var} then @var{var} will [EMAIL PROTECTED] or defines the output variable @var{var}, then @var{var} will be defined in each @file{Makefile.in} generated by Automake. E.g.@: @code{AC_PATH_XTRA} defines @code{X_CFLAGS} and @code{X_LIBS}, so you can use these variables in any @file{Makefile.am} if The third patch looks ok, except for one question: diff --git a/doc/automake.texi b/doc/automake.texi index 55c417c..e8462e0 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -2948,7 +2948,7 @@ generated @file{Makefile.in}s, unless @var{default-mode} is conditional, which you can use in your own @file{Makefile.am}. @xref{maintainer-mode}. [EMAIL PROTECTED] AM_SUBST_NOTMAKE(@var{var}) [EMAIL PROTECTED] AM_SUBST_NOTMAKE(@ovar{var}) Why this change? AM_SUBST_NOTMAKE currently supports having no arguments, or an empty argument, but I don't see any value in allowing users to use that. What would be the gain? Prevent Automake from defining a variable @var{var}, even if it is substituted by @command{config.status}. Normally, Automake defines a @command{make} variable for each @command{configure} substitution, Cheers, and thanks, Ralf
Re: [PATCH 1/3] quotes in configure.ac
* William Pursell wrote on Sat, Nov 22, 2008 at 05:19:20PM CET: Ralf Wildenhues wrote: How about this instead: For each @code{AC_REQUIRE_AUX_FILE([EMAIL PROTECTED]@var{file}}])}, @command{automake} will ensure that @[EMAIL PROTECTED] exists in the aux directory, and will complain otherwise. That reads well. OK. I went with that, except for removing the first @file{} (adding @file inside @code is superfluous, and leads to wrong markup, unlike the @var). +Several macros invoke @code{AC_SUBST} and cause certain +variables to be defined in each generated Makefile.in. Hmm, I'm not too fond of this sentence. I don't really see what value it adds over the following sentence. Can you describe what information you find lacking in the original text, maybe we can find a better way then? When I was reading through the page, it just felt like something was missing there. At first, I thought If the Autoconf manual... was a typo that should have read In the Auto..., and it took me a while to realize what the paragraph is talking about. It seems like there needs to be something introducing the idea that it's talking about other macros invoking AC_SUBST. OK. I rewrote the paragraph like this and squashed that into your patch: @@ -2905,12 +2905,13 @@ generated @file{Makefile.in}, unless @code{AM_SUBST_NOTMAKE} is also used for this variable. @xref{Setting Output Variables, , Setting Output Variables, autoconf, The Autoconf Manual}. -If the Autoconf manual says that a macro calls @code{AC_SUBST} for [EMAIL PROTECTED] or defines the output variable @var{var}, then @var{var} will -be defined in each @file{Makefile.in} generated by Automake. -E.g.@: @code{AC_PATH_XTRA} defines @code{X_CFLAGS} and @code{X_LIBS}, so -you can use these variables in any @file{Makefile.am} if [EMAIL PROTECTED] is called. +For every substituted variable @var{var}, @command{automake} will add +a line @[EMAIL PROTECTED] = @var{value}} to each @file{Makefile.in} file. +Many Autoconf macros invoke @code{AC_SUBST} to set output variables +this way, e.g., @code{AC_PATH_XTRA} defines @code{X_CFLAGS} and [EMAIL PROTECTED] Thus, you can access these variables as [EMAIL PROTECTED](X_CFLAGS)} and @code{$(X_LIBS)} in any @file{Makefile.am} +if @code{AC_PATH_XTRA} is called. @item AM_C_PROTOTYPES This is required when using the obsolete de-ANSI-fication feature; see The third patch looks ok, except for one question: [EMAIL PROTECTED] AM_SUBST_NOTMAKE(@var{var}) [EMAIL PROTECTED] AM_SUBST_NOTMAKE(@ovar{var}) Why this change? AM_SUBST_NOTMAKE currently supports having no arguments, or an empty argument, but I don't see any value in allowing users to use that. What would be the gain? That's my mistake I've gotten overly zealous about quoting in m4 macros and mistook the brackets, not realizing they were indicating optional arguments. Yeah, texinfo optional argument markup and M4 quotation don't mix all that well. One can see the differences in the latex output only, and even there, it can easily be overlooked at a glance. Anyway, I've put the doc changes all in one patch, and pushed both patches, to master and branch-1-10. Cheers, Ralf
Re: maude_ vs LIBRARY_
Hello William, * William Pursell wrote on Sun, Nov 23, 2008 at 10:05:06AM CET: In the documentation, generic items appear as maude_PRIMARY and LIBRARY_PRIMARY. This strikes me as inconsistent. I suggest changing, eg, LIBRARY_LIBTOOLFLAGS to libmaude_LIBTOOLFLAGS. Well, one point of using 'maude' everywhere is to let these items appear grouped in the Index. 'libmaude' would prevent that. OTOH, index entries and examples used in the flow text of the manual need not be identical. Also, there are a few @var{prog}_FLAGS entries in the manual as well. Unless we can come up with a definite improvement in consistency, I wouldn't want to change things. Thanks, Ralf
Re: maude_ vs LIBRARY_
* William Pursell wrote on Sun, Nov 23, 2008 at 03:04:36PM CET: Ralf Wildenhues wrote: * William Pursell wrote on Sun, Nov 23, 2008 at 10:05:06AM CET: I suggest changing, eg, LIBRARY_LIBTOOLFLAGS to libmaude_LIBTOOLFLAGS. Unless we can come up with a definite improvement in consistency, I wouldn't want to change things. What about changing LIBRARY_PRIMARY to libfoo_PRIMARY? Well, libmaude would be better than libfoo, for consistency reasons alone. To me, it seems that writing it as LIBRARY_ makes it appear to be a special name like EXTRA_. Ah, good point; at least the info documentation is quite misleading due to its rendering of @var{}. However, this point applies equally well to the instances of @var{prog}. Can you fix them as well? Thanks, Ralf
Re: [PATCH] documentation errors
Hello William, * William Pursell wrote on Sun, Nov 23, 2008 at 06:18:47PM CET: here's another set of corrections to the documentation. Thanks. There was a question I had that I notated by adding comments to the .texi file which appears in the patch below re: AM_PROG_CC_C_O. The documentation claims that one must invoke AM_PROG_CC_C_O in order to use program_CFLAGS, but I have succesfully used program_CFLAGS and have never used AM_PROG_CC_C_O, so I believe this is out of date. Do you use 'automake -Wall'? The warning about AM_PROG_CC_C_O has been demoted a while ago IIRC. BTW, your patches are good, but you can make my life even easier by not mixing two independent things (corrections, and annotations) in one patch. These things are orthogonal, so should be in separate changes; of course, such an annotation should not be in the tree at all unless we cannot fix it. Also, but this is really rather nitpicky and not required at all, I prefer receiving patches with the ChangeLog entry being part of the git commit log message, and the patch not touching the ChangeLog file at all. That way, the patch can easily be committed even if it was written against an older tree. --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ + +2008-11-23 William Pursell [EMAIL PROTECTED] + + * doc/automake.texi (Macro search path, Extending aclocal) + (Local Macros, Serials, Public macros, Directories) + (Conditional Subdirectories, Nesting Packages) + (Building a program, Libtool Modules) + (Program and Library Variables, Default _SOURCES, LIBOBJS): + Mostly correcting verb/object tense agreement (ie: + Here is a case that illustrate s/illustrate/illustrates/), + some word swaps (need just becomes just need), and + general trivial cleanup. Your attention to detail seems much more focused in the manual than when writing the ChangeLog. :-) I deleted the first line, and rewrote the text as below, and pushed to master and branch-1-10. Cheers, Ralf 2008-11-23 William Pursell [EMAIL PROTECTED] * doc/automake.texi (Macro search path, Extending aclocal) (Local Macros, Serials, Public macros, Directories) (Conditional Subdirectories, Nesting Packages) (Building a program, Libtool Modules) (Program and Library Variables, Default _SOURCES, LIBOBJS): Correct verb/object tense agreement, swap some words, and general trivial cleanup.
Re: [PATCH] documentation: page break
Hi William, * William Pursell wrote on Mon, Nov 24, 2008 at 08:49:22AM CET: You mentioned that I should not edit the ChangeLog--are you generating it automatically? Well, more or less. I have macros to covert from ChangeLog entry to git commit log entry and vice versa. And a script to generate a stub ChangeLog entry. The latter is vc-chlog from the vc-dwim package: http://www.gnu.org/software/vc-dwim/ Paolo posted a script a little while ago, I think on autoconf-patches. Really, the question is, do you want me to put * doc/automake.texi: in my git log message? Yes, if that's no problem for you. 2nd question, how important is the subject line of the email to you? ie, would it help if I gave some specificity regarding the sections modified, or perhaps started a counter and put it in the subject? I suspect I'll be done with the manual in fairly short time (although I don't get much time to look at it during the week) so this is probably not a big deal. Well, the absolute easiest is if you format your mail message with 'git format-patch'. If you've never seen this, look at the git mailing list how they send patches there (with additional comments put between the '---' line and the diffstat lines). This format allows me to pipe your mail into 'git am' which automatically generates a commit from it then. Almost no work. :-) If you decide to do this, you can also keep the ChangeLog entries in the patch. Gnulib has a git merge driver called git-merge-changelog which helps merging ChangeLog entries should they not fit perfectly any more. I am disappointed with myself for taking so long to get to reading the manual straight through. I'm not sure if I can do anything to address this. :-) I recall trying to read it back when I first started looking at automake, and remember it being mostly incomprehensible. It now reads very well, though, and I can't think of any way to improve its readability for the novice without making it 3 times as long. (Nor am I sure that making it into an introductory text is a good idea.) Me neither. Removing superflous page break in automake.texi (Mixing Fortran 77 With C and C++): Removed a page break that serves no purpose but to break the flow of the narrative. This looks good, but why stop here and leave the next @page in? Also, if you are interested in cleaning up the structure of the manual, Karl has an interesting comment that I haven't got around to addressing yet: http://thread.gmane.org/gmane.comp.sysutils.automake.bugs/4205. I never found the time to go through the patch and think of a nice consistent markup that looks good both in info and pdf. (This patch would not be for branch-1-10, I don't want to change HTML file names arbitrarily there.) Cheers, Ralf
Automake and whitespace in pwd (was: [PATCH] gnulib-tool: do not use $(top_srcdir) unquoted; may be tainted)
Hello Jim, * Jim Meyering wrote on Tue, Nov 25, 2008 at 10:59:36AM CET: I think it's a fine idea to disallow bogus (and potentially dangerous) absolute names in automake's sanity.m4, but the existing code is not sufficient. Agreed. To demonstrate (as non-root), create a directory named 'a;$(halt);' cd into it, unpack an automake/autoconf-using tarball, then run $PWD/configure. OK, let's improve the situation here. I agree that whitespace in $srcdir does not work, same with some other special characters. However, I dislike forbidding whitespace in `pwd`, I don't want to needlessly make Automake less useful for some legitimate uses. Also, I prefer to go with what tests/instspc.test lists as broken rather than explicitly forbidding everything. Let's give users with whitespace in `pwd` some slack and make things harder for package authors instead. ;- What do you think of this patch? Combined with some trivial fixes to texi2dvi, the only test failures I get with source tree in `/tmp/dir with spaces/automake' and build tree in `/tmp/dir with spaces/build' and a $srcdir of ../automake are those that stem from dejagnu (runtest) failures. All tests involving gettext or libtool are skipped, however, AFAIK at least libtool does not cope with white space in `pwd`. BTW, choosing to use single-quoting for $install_sh but double-quoting for $MISSING is ugly, but not arbitrary: `install-strip' already has a reason to use double quoting for $(INSTALL_STRIP_PROGRAM) which may contain $install_sh. And $MISSING uses double-quoting so that does not interfere with the single-quoting used by texi2dvi. Ugly, yes. And not quoting when no whitespace is present is of course done to prevent breaking all those applications that are not prepared for this. Many packages will certainly not work with whitespace in $PWD, and it would make little sense to require them to adjust their rules for changed quoting in $MISSING. And yes, there are more warts: A compiler without -c -o won't work. Several tests skip because things won't work in a directory name with white space. Cheers, Ralf 2008-11-26 Ralf Wildenhues [EMAIL PROTECTED] Jim Meyering [EMAIL PROTECTED] Cope with whitespace in $MISSING and $install_sh. * configure.ac (am_AUTOHEADER): New substitution, save the value of $AUTOHEADER before AM_INIT_AUTOMAKE may add $MISSING. * tests/defs.in: Use am_AUTOHEADER. * lib/am/install.am: Fix typo. * m4/install-sh.m4 (AM_PROG_INSTALL_SH): Add suitable single-quote quoting to install_sh, but only if needed. * m4/missing.m4 (AM_MISSING_HAS_RUN): Add suitable double-quote quoting to MISSING, but only if needed. * m4/sanity.m4 (AM_SANITY_CHECK): Abort configure if `pwd` or $srcdir contain shell meta-characters that cannot be handled; space and tab are allowed in the former only. * tests/sanity.test: New test. * tests/Makefile.am: Adjust. * NEWS: Update. Reports by Jim Meyering and others. diff --git a/NEWS b/NEWS index 27f8368..2721e69 100644 --- a/NEWS +++ b/NEWS @@ -138,6 +138,13 @@ New in 1.10a: - The `missing' script works better with versioned tool names. + - The Automake macros and rules cope better with whitespace in the +current directory name, as long as the relative path to `configure' +does not contain whitespace. To this end, the values of `$(MISSING)' +and `$(install_sh)' may contain suitable quoting, and their expansion +might need `eval'uation if used outside of a makefile. These +undocumented variables may be used in several documented macros. + Bugs fixed in 1.10a: * Long standing bugs: diff --git a/configure.ac b/configure.ac index f049533..592da2e 100644 --- a/configure.ac +++ b/configure.ac @@ -25,8 +25,9 @@ AC_CANONICAL_BUILD # Save the AUTOCONF setting before AM_INIT_AUTOMAKE overrides it; this # way we can run Autoconf tests from configure (or from the test -# suite) without being bothered by `missing'. +# suite) without being bothered by `missing'. Likewise for autoheader. AC_SUBST([am_AUTOCONF], [${AUTOCONF-autoconf}]) +AC_SUBST([am_AUTOHEADER], [${AUTOHEADER-autoheader}]) AM_INIT_AUTOMAKE([1.10a dist-bzip2 filename-length-max=99 color-tests parallel-tests]) diff --git a/lib/am/install.am b/lib/am/install.am index 885ad0b..c114fa5 100644 --- a/lib/am/install.am +++ b/lib/am/install.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. +## Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -78,7 +78,7 @@ install-am: all-am ## directory. .MAKE .PHONY: install-strip install-strip: -## Beware that they are two variables used to install
Re: Automake and whitespace in pwd
Hi Jim, * Jim Meyering wrote on Thu, Nov 27, 2008 at 10:55:38AM CET: On one hand, I like the idea of accommodating the rare srcdir `pwd` that contains white space. As Ralf alreay noted, it is not that rare with w32 users. On the other hand, since so many Makefile.am files are unprepared for the resulting names, I wonder if it's better to protect the users, and give Makefile.am writers a way to guarantee that bad `pwd` won't leak into places like $(top_srcdir). But one point of my patch is exactly that it ensures that $(top_srcdir) is safe to use *without* any quoting. It has to be: it is not possible (portably) to quote file names that can appear as part of prerequisites or targets in makefiles. This started with my auditing some Makefile.am files, adding quotes to protect against uses of potentially-tainted variables like $(top_srcdir). I found that many uses needed additional quoting. In addition, while single quoting was usually enough to protect them, sometimes I had to use double quotes, or a mix, to accommodate $$() and $$i-style shell constructs. Relying on that sort of correctness is fragile, in that there's nothing to actively prevent regressions, unless you write build tests that exercise each and every Makefile rule in the offending scenario. You should not add any quoting to those variables which can reasonably be relative. In this category are: $(srcdir), $(top_srcdir), $(builddir), $(top_builddir) My patch ensures these variables don't contain whitespace. Of course the *_srcdir variables can still be absolute if the user specifies an absolute path to `configure', but the sanity check will then abort if those absolute names contain whitespace. What do you think of adding an automake option that would let the package maintainer specify that s/he does not want to expose package users to the risk of malfunction due to a tainted srcdir name? Once more, my patch will ensure that srcdir is not tainted. These names, however, can still contain whitespace: $(abs_srcdir), $(abs_builddir), $(abs_top_srcdir), $(abs_top_builddir) However, many package do not ever need to use these variables, and Autoconf and Automake don't either (mostly), by default. So I'm a bit reluctant to make it the default of forbidding whitespace in them. The most likely cause of problems will be when packages use some variable that itself uses $MISSING, *and* does so outside of a makefile. Why? Because in a shell script, the extra 'eval' step needed for interpreting the quotation I added is missing. Good example is texi2dvi (which already does the right thing by eval'ing $makeinfo). Things are different for Libtool. We might want to add a check to Libtool-using packages to forbid whitespace in the absolute build directory path. This feels like a package-level policy question, after all. Maintaining correctly-quoted Makefiles is hard enough without having to worry about such embedded white space. Sure, any package maintainer can add a few lines to configure.ac to make start-up code examine $srcdir and fail upon irregularity, but if automake were to make this easy, I'd be much more likely to use it than if it means copying around a custom .m4 file or repeating a short snippet of code in each package's configure.ac. Again, $srcdir may not contain white space. That said, this patch looks fine. make check passed and it did the right thing in a couple of manual test scenarios. Good, thanks for testing. I have applied it after incorporating your NEWS suggestion, and after fixing a small portability wart, as in the incremental patch below. (The 'case' issue is listed in the Autoconf manual; sigh, I think it was me who added it ...) P.S. Would you please re-post your latest parallelizing-tests patches? I missed that functionality when running automake's lengthy, single-threaded make check on a quad-core system. Hope to get to reposting them soonish. I've found some more issues with them, and wanted to incorporate as many of Akim's good suggestions as possible. Thanks, Ralf diff --git a/NEWS b/NEWS index 2721e69..8b43c69 100644 --- a/NEWS +++ b/NEWS @@ -138,12 +138,16 @@ New in 1.10a: - The `missing' script works better with versioned tool names. + - Automake's early configure-time sanity check now diagnoses an +unsafe absolute source directory name and makes configure fail. + - The Automake macros and rules cope better with whitespace in the current directory name, as long as the relative path to `configure' does not contain whitespace. To this end, the values of `$(MISSING)' and `$(install_sh)' may contain suitable quoting, and their expansion might need `eval'uation if used outside of a makefile. These -undocumented variables may be used in several documented macros. +undocumented variables may be used in several documented macros such +as $(AUTOCONF) or $(MAKEINFO). Bugs fixed in 1.10a: diff --git a/m4/sanity.m4
Re: automake manual: distclean
Hello Jan, Andreas, thanks for the bug report. * Andreas Schwab wrote on Wed, Nov 26, 2008 at 07:48:32PM CET: Jan Engelhardt [EMAIL PROTECTED] writes: This is not quite portable -- unless GNU find, which implies a path of . if nothing else is specified, Solaris's explicitly requires a path to find. It should therefor read distcleancheck_listfiles = \ find . -type f -exec sh -c 'test -f $(srcdir)/{} || echo {}' ';' This isn't quite portable either. POSIX only requires that find -exec substitutes in arguments consisting of exactly {}. Good points. The above fails with native 'find' on Solaris 10, HP-UX 11.23, AIX 5.3, Tru64/OSF5.1, IRIX 6.5. The Posix-conforming find . -type f -exec sh -c ' for arg do test -f $(srcdir)/$$arg || echo $$arg done' sh '{}' + doesn't work with OpenBSD 4.0, HP-UX 10.20, AIX 4.3.3, Tru64/OSF5.1, IRIX 6.5, so we have to use the (less efficient but more portable) code as below. I've pushed that and added Jan to THANKS, master and branch-1-10. Thanks, Ralf Fix portability issues in distcleancheck_listfiles doc example. * doc/automake.texi (Dist): In the `distcleancheck_listfiles' code example, add `.' path, for Solaris `find', also rewrite so `{}' appears only once and as separate argument, for Posix. * THANKS: Update. * tests/distcleancheck.test: New test. * tests/Makefile.am: Update. Report by Jan Engelhardt and Andreas Schwab. diff --git a/doc/automake.texi b/doc/automake.texi index 065e6fa..1190f2e 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -8207,7 +8207,8 @@ following definition instead: @example distcleancheck_listfiles = \ - find -type f -exec sh -c 'test -f $(srcdir)/@[EMAIL PROTECTED] || echo @[EMAIL PROTECTED]' ';' + find . -type f -exec sh -c 'test -f $(srcdir)/$$1 || echo $$1' \ + sh '@[EMAIL PROTECTED]' ';' @end example The above definition is not the default because it's usually an error if diff --git a/tests/Makefile.am b/tests/Makefile.am index 2a8e847..cac16a1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -228,6 +228,7 @@ dirforbid.test \ dirlist.test \ dirlist2.test \ discover.test \ +distcleancheck.test \ distcom2.test \ distcom3.test \ distcom4.test \ diff --git a/tests/distcleancheck.test b/tests/distcleancheck.test new file mode 100755 index 000..5f66a12 --- /dev/null +++ b/tests/distcleancheck.test @@ -0,0 +1,66 @@ +#! /bin/sh +# Copyright (C) 2008 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. + +# Make sure the suggested `distcleancheck_listfiles' in the manual works. +# The example Makefile.am we use is from the FAQ entry `distcleancheck'. + +. ./defs || Exit 1 + +set -e + +cat configure.in 'END' +AC_PROG_CC +AC_OUTPUT +END + +cat Makefile.am 'END' +# This Makefile.am is bogus. See @node{distcleancheck} in the manual +# for how to fix it properly. +bin_PROGRAMS = foo +foo_SOURCES = foo.c +dist_man_MANS = foo.1 + +foo.1: foo$(EXEEXT) + echo man page for foo$(EXEEXT) foo.1 + +## Ignore warnings about overridden variables +AUTOMAKE_OPTIONS = -Wno-override +distcleancheck_listfiles = \ + find . -type f -exec sh -c 'test -f $(srcdir)/$$1 || echo $$1' \ + sh '{}' ';' +END + +cat foo.c 'END' +int main () { return 0; } +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE + +./configure +$MAKE +$MAKE distcheck + +# Now ensure that we really needed the override. +sed '/distcleancheck_listfiles/,$d' Makefile.am t +mv -f t Makefile.am +$AUTOMAKE +./configure +$MAKE +$MAKE -e distcheck Exit 1 + +:
Fixup release rules.
I'm pushing this patch to fix up the release rules, master and branch-1-10. Cheers, Ralf Fixup release rules. * Makefile.am (cvs-diff): Remove. (git-dist): Do not use clcommit any more. Use new-style tag name. Pass $(AM_MAKEFLAGS) to $(MAKE). (git-diff): Adjust. (git-release): Do not upload to sources.redhat.com. diff --git a/HACKING b/HACKING index 5df650e..307e36a 100644 --- a/HACKING +++ b/HACKING @@ -146,8 +146,6 @@ * Run `make release-stats' if release statistics in doc/automake.texi have not been updated yet. -* NOTE: the next step has not been tested yet with git, so be careful. - * Run `make git-release'. This will run distcheck to create the tarballs, commit the last NEWS/configure.ac/ChangeLog changes, tag the repository, sign @@ -158,13 +156,37 @@ * Update version number in configure.ac to next alpha number. Re-run ./bootstrap and commit. +* Don't forget to `git push' your changes so they appear in the public + git tree. + +* Update the web pages at sources.redhat.com: + - bump version in index.rst, + - add entry to news.rst, + - run `make' to update .html files, + - create manuals: + cd doc + make pdf + make html MAKEINFOFLAGS=--no-split + - copy automake.html and automake.pdf to web cvs, + - add ChangeLog entry and commit. + +* Update the manuals at www.gnu.org: + - Generate manuals: +cd doc +wget http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/texinfo/texinfo/util/gendocs.sh; +wget http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/texinfo/texinfo/util/gendocs_template; +sh ./gendocs.sh automake GNU Automake + - copy manuals recursively to web cvs, + - commit. + * Send announcement at least to [EMAIL PROTECTED], and [EMAIL PROTECTED] If not an alpha, announcement must also go to - [EMAIL PROTECTED] + [EMAIL PROTECTED] Copy this announcement into the NEWS feed at + https://savannah.gnu.org/projects/automake. - -Copyright (C) 2003, 2007 Free Software Foundation, Inc. +Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/Makefile.am b/Makefile.am index 55e1a66..d637e10 100644 --- a/Makefile.am +++ b/Makefile.am @@ -336,23 +336,18 @@ maintainer-check: automake aclocal git-dist: maintainer-check -## Make sure clcommit exists (we use it at the end of git-dist). - @if (clcommit --version)/dev/null 2/dev/null; then :; else \ - echo Get clcommit from module cvs-utils on Savannah.; \ - exit 1; \ - fi ## Make sure the NEWS file is up-to-date. @if sed 1q $(srcdir)/NEWS | grep -e $(VERSION) /dev/null; then :; else \ echo NEWS not updated; not releasing 12; \ exit 1; \ fi ## Build the distribution - $(MAKE) distcheck + $(MAKE) $(AM_MAKEFLAGS) distcheck ## Finally, if anything was successful, commit the last changes and tag ## the release in the repository. We don't use RCS keywords so it's OK ## to distribute the files before they were committed. - cd $(srcdir) clcommit \ - git tag -s `echo Release-$(VERSION) | sed 's/\./-/g'` + cd $(srcdir) git commit -a -s \ + git tag -s v$(VERSION) -m Release $(VERSION) git-release: git-dist case $(VERSION) in \ @@ -360,25 +355,15 @@ git-release: git-dist *) dest=ftp;; \ esac; \ $(srcdir)/lib/gnupload $(GNUPLOADFLAGS) \ - --to sources.redhat.com:~ftp/pub/automake \ --to $$dest.gnu.org:automake $(DIST_ARCHIVES) -cvs-diff: - thisver=`echo Release-$(VERSION) | sed 's/\./-/g'`; \ - if test -z $$OLDVERSION; then \ - prevno=`echo $(VERSION) - 0.01 | bc | sed 's/^\./0./'`; \ - else prevno=$$OLDVERSION; fi; \ - prevver=Release-`echo $$prevno | sed 's/\./-/g'`; \ - cvs -f rdiff -c -r $$prevver -r $$thisver $(PACKAGE) \ -$(PACKAGE)-$$prevno-$(VERSION).diff - git-diff: - thisver=`echo Release-$(VERSION) | sed 's/\./-/g'`; \ + thisver=v$(VERSION); \ if test -z $$OLDVERSION; then \ prevno=`echo $(VERSION) - 0.01 | bc | sed 's/^\./0./'`; \ else prevno=$$OLDVERSION; fi; \ - prevver=Release-`echo $$prevno | sed 's/\./-/g'`; \ - git diff $$prevver $$thisver $(PACKAGE) \ + prevver=v$$prevno; \ + git diff $$prevver..$$thisver $(PACKAGE) \ $(PACKAGE)-$$prevno-$(VERSION).diff ## Check our path lengths.
Re: magic variables for included fragments
Hi Akim, * Akim Demaille wrote on Wed, Dec 03, 2008 at 02:58:22PM CET: * Ralf Wildenhues wrote on Sun, Oct 12, 2008 at 10:46:06PM CEST: RW == Ralf Wildenhues [EMAIL PROTECTED] writes: Sorry I did not answer before. No problem of course. In the meantime I did come up with some patch for fixed include fragment.mk that does sane recursive inclusion, but with backward compatibility warnings, but said patch still has a bug. I hope to be able to fix it soon. In other projects I'm involved in we store in candidates/ branches that contain patches under discussion. That makes it easier to try, experiment etc. Could you please push this somewhere? Thanks! Yes, of course. I will try to clean all this up and push it, hopefully sometime this weekend. @@ -9151,6 +9169,70 @@ condition applies to the entire contents of that fragment. Makefile fragments included this way are always distributed because they are needed to rebuild @file{Makefile.in}. [EMAIL PROTECTED] $(AM_SUBDIR) [EMAIL PROTECTED] $(AM_PREFIX) [EMAIL PROTECTED] $(AM_CANON) [EMAIL PROTECTED] $(AM_REVERSE) This is really excellent news, it will vastly simplify some Makefiles. It will also solve a problem I have found several times: if you share some directories in different projects (typically using svn externals or git sub modules), then it is basically impossible to put them at different places in the packages: they should always be at a fixed path from the top of the package. Indeed. Otherwise too many things go wrong (especially the creation of .deps btw: automake does garbage if you include a local.mk which defines foo_SOURCES = $(prefix)/foo.cc: it creates '$(prefix)/.deps', and I really mean single quotes: the very string '$(prefix)' not interpolated (which it can't, of course)). Yep. :-/ A while ago (I'm sure it's been more than a couple of years now), ventured at changing depout.m4 to lift this limitation. I did have something working back then, but it required invoking `make' at config.status time. I dropped this idea as being unsuitable in the presence of bugs (e.g., if `make' reinvokes configure, then there can be an endless loop). Maybe I should go back and look again, for example writing out a separate makefile could help... I confess that I like that facets of a single thing keep a common root in the names: AM_SUB_REL, AM_SUB_PREFIX, AM_SUB_CANON, AM_SUB_REV or something. But of course concision does matter. I agree with you on both accounts. I am torn between these choices as well. If somebody has better ideas, they are welcome! Cheers, Ralf
Re: [PATCH 2/3] Replace 'configure' with '@command{configure}' as appropriate.
Hi William, * William Pursell wrote on Mon, Dec 01, 2008 at 10:06:18PM CET: There are several occurences of the phrase 'at configure time' where it may be appropriate to make this change as well, but it is not clear to me that doing so is correct and I'm applying the principal of minimal change. (aka laziness). This is good, I pushed it. Thanks! Ralf
Re: [PATCH 3/3] Simple typographical and grammar errors in automake.texi.
Hi William, * William Pursell wrote on Mon, Dec 01, 2008 at 10:06:32PM CET: Fix object/article consistency (eg an flag becomes a flag), correct minor punctuation errors, etc. Thanks! Pushed with a couple of minor changes, as below. @@ -7839,7 +7839,7 @@ suppress the base name step. For example: nobase_include_HEADERS = stdio.h sys/types.h @end example -Will install @file{stdio.h} in @samp{$(includedir)} and @file{types.h} +will install @file{stdio.h} in @samp{$(includedir)} and @file{types.h} in @samp{$(includedir)/sys}. I added a @noindent here. More generally, there are probably several @example's in the manual where the following text belongs right to it, but there is no @noindent keeping them together, which looks a bit ugly in the info output. -Note that Automake does not make any difference between rules with +Note that Automake does not make any distinction between rules with commands and rules that only specify dependencies. No distinction without a difference! :-) (good phrase to memorize the difference between the two words) FWIW, I squashed in this change to avoid an underfull hbox: @@ -8927,7 +8927,7 @@ suffixes in the @code{SUFFIXES} variable @strong{before} y implicit rule. For instance, the following definition prevents Automake from misinterpreting [EMAIL PROTECTED]:} as an attempt to transform @file{.idlC} files into +the @samp{.idlC.cpp:} rule as an attempt to transform @file{.idlC} files into @file{.cpp} files. @example @@ -9923,15 +9923,15 @@ happen. CVS's timestamp handling can also let you think an out-of-date file is up-to-date. For instance, suppose a developer has modified @file{Makefile.am} and -has rebuilt @file{Makefile.in}. He then decide to do a last-minute +has rebuilt @file{Makefile.in}. He then decides to do a last-minute change to @file{Makefile.am} right before checking in both files (without rebuilding @file{Makefile.in} to account for the change). -This last change to @file{Makefile.am} make the copy of +This last change to @file{Makefile.am} makes the copy of @file{Makefile.in} out-of-date. Since CVS processes files -alphabetically, when another developer @samp{cvs update} his or her +alphabetically, when another developer @samp{cvs update}s his or her I happen to dislike quoted text with unquoted postfixes a bit; maybe this should be reformulated as when another developer uses @samp{cvs update} to update his or her tree Hmm. Or maybe not; dunno. tree, @file{Makefile.in} will happen to be newer than [EMAIL PROTECTED] This other developer will not see [EMAIL PROTECTED] This other developer will not see that @file{Makefile.in} is out-of-date. @@ -10013,13 +10013,13 @@ the build continue is one of the arguments of the @cindex @code{AM_MAINTAINER_MODE}, purpose @acindex AM_MAINTAINER_MODE [EMAIL PROTECTED] allows to choose whether the so called [EMAIL PROTECTED] allows you to choose whether the so called rebuild rules should be enabled or disabled. With @code{AM_MAINTAINER_MODE([enable])}, they are enabled by default, otherwise they are disabled by default. In the latter case, if you have @code{AM_MAINTAINER_MODE} in @file{configure.ac}, and run @samp{./configure make}, then @command{make} will *never* attempt to -rebuilt @file{configure}, @file{Makefile.in}s, Lex or Yacc outputs, etc. +rebuild @file{configure}, @file{Makefile.in}s, Lex or Yacc outputs, etc. This could be: @file{Makefile.in} files I.e., this disables build rules for files that are usually distributed and that users should normally not have to update. @@ -11067,7 +11067,7 @@ The @code{AM_PATH_PYTHON} macro uses similar commands to define Of course not all tools are as advanced as Python regarding that substitution of @var{prefix}. So another strategy is to figure the -part of the of the installation directory that must be preserved. For +part of the installation directory that must be preserved. For Oh! Vim is good at detecting doubled words like `the the', but it doesn't detect doubled pairs yet. That should be fixed. Cheers, Ralf
Re: [PATCH 1/3] Replace 'automake' with @command{automake} where appropriate in automake.texi
Hi William, * William Pursell wrote on Mon, Dec 01, 2008 at 10:06:10PM CET: The bare 'automake' occurs often in automake.texi where it should be @command{automake}. There is some inconsistency, however, in that often 'Automake' is used, and I am unsure if it is appropriate to change such instances to @command{automake}, so am leaving them untouched. I think this can be improved a bit further. The manual is intended to use Automake when referring to the package, and @command{automake} when referring to the program that can be executed. When in doubt, I think Automake should be preferred. For example: @@ -3159,9 +3159,9 @@ directories, in this order: @table @code @item @var{acdir-APIVERSION} -This is where the @file{.m4} macros distributed with automake itself -are stored. @var{APIVERSION} depends on the automake release used; -for automake 1.6.x, @var{APIVERSION} = @code{1.6}. +This is where the @file{.m4} macros distributed with @command{automake} itself This should be `Automake'. +are stored. @var{APIVERSION} depends on the @command{automake} release used; Likewise. +for @command{automake} 1.6.x, @var{APIVERSION} = @code{1.6}. @item @var{acdir} This directory is intended for third party @file{.m4} files, and is @@ -3195,7 +3195,7 @@ drops the @var{APIVERSION} directory. For example, if one specifies @end enumerate This option, @option{--acdir}, is intended for use by the internal -automake test suite only; it is not ordinarily needed by end-users. [EMAIL PROTECTED] test suite only; it is not ordinarily needed by end-users. Likewise. @@ -3250,7 +3250,7 @@ If the @[EMAIL PROTECTED] option is used, then @command{aclocal} will search for the @file{dirlist} file in @var{dir}. In the @samp{--acdir=/opt/private/} example above, @command{aclocal} would look for @file{/opt/private/dirlist}. Again, however, the @option{--acdir} -option is intended for use by the internal automake test suite only; +option is intended for use by the internal @command{automake} test suite only; Likewise. @@ -3812,7 +3812,7 @@ choose the assembler for you (by default the C compiler) and set @acindex AM_PROG_CC_C_O @acindex AC_PROG_CC_C_O This is like @code{AC_PROG_CC_C_O}, but it generates its results in -the manner required by automake. You must use this instead of +the manner required by @command{automake}. You must use this instead of Not sure about this one either. @code{AC_PROG_CC_C_O} when you need this functionality, that is, when using per-target flags or subdir-objects with C sources. @@ -3957,7 +3957,7 @@ skip this section! @itemx AM_DEP_TRACK @itemx AM_OUTPUT_DEPENDENCY_COMMANDS These macros are used to implement Automake's automatic dependency -tracking scheme. They are called automatically by automake when +tracking scheme. They are called automatically by @command{automake} when Technically, it's not the program that calls them, but some of the m4 macros cause them to be invoked. Not sure here. required, and there should be no need to invoke them manually. @@ -11677,7 +11677,7 @@ A major and long-awaited release, that comes more than two years after @item The new dependency tracking scheme that uses @command{depcomp}. Aside from the improvement on the dependency tracking itself (@pxref{Dependency Tracking Evolution}), this also streamlines the use -of automake generated @file{Makefile.in}s as the @file{Makefile.in}s +of @command{automake} generated @file{Makefile.in}s as the @file{Makefile.in}s I have a question here: shouldn't this be [EMAIL PROTECTED]' here? With hyphenation, in German I tend to have a good feeling about when it's needed and when not, but I'm not quite sure whether those rules (which I probably can't even formulate precisely) carry over to English writing. used during development are now the same as those used in distributions. Before that the @file{Makefile.in}s generated for maintainers required GNU @command{make} and GCC, they were different @@ -12039,7 +12039,7 @@ Java.) This problem is easy to fix, by modifying dependency generators to record every probe, instead of every successful open. @item -Since automake generates dependencies as a side effect of compilation, +Since @command{automake} generates dependencies as a side effect of compilation, I think I'd prefer Automake here. there is a bootstrapping problem when header files are generated by running a program. The problem is that, the first time the build is done, there is no way by default to know that the headers are Cheers, Ralf
Re: magic variables for included fragments
* Akim Demaille wrote on Thu, Dec 04, 2008 at 09:30:45AM CET: Le 3 déc. 08 à 20:58, Ralf Wildenhues a écrit : A while ago (I'm sure it's been more than a couple of years now), ventured at changing depout.m4 to lift this limitation. I did have something working back then, but it required invoking `make' at config.status time. I dropped this idea as being unsuitable in the presence of bugs (e.g., if `make' reinvokes configure, then there can be an endless loop). Maybe I should go back and look again, for example writing out a separate makefile could help... I have a silly question, but... is it really known for a fact that some Make out there do not support include if it exists? This question is not relevant to the problem. Automake requires some 'make'-provided inclusion mechanism to work, otherwise dependency tracking will not work. What is the question is: do we need to use an inclusion mechanism that fails if the file to be included does not exist yet? In general, the answer is yes, because there are make implementations that provide no other. And even with those that do, like GNU make, one would not want to hide problems where the included snippets have buggily not been included as needed. The true problem is that this is handled by config.status instead of Make itself. Well, yes, but 'make' does not portably provide the means to fix this situation. While at it, I have another portability question: are there (alive) shells known not to support () for case patterns? case $host in (*win*) abort;; (*) dance;; esac Yes, Solaris /bin/sh for example. Cheers, Ralf
Re: magic variables for included fragments
Hi Akim, * Akim Demaille wrote on Wed, Dec 10, 2008 at 10:21:50AM CET: Le 4 déc. 08 à 09:38, Ralf Wildenhues a écrit : I have a silly question, but... is it really known for a fact that some Make out there do not support include if it exists? This question is not relevant to the problem. Erm. Thank you for noticing that I misunderstood your question, and replied nonsense here ... Automake requires some 'make'-provided inclusion mechanism to work, otherwise dependency tracking will not work. What is the question is: do we need to use an inclusion mechanism that fails if the file to be included does not exist yet? In general, the answer is yes, because there are make implementations that provide no other. ... but tried to address the actual issue here. Ok. And these makes can be fooled to implement the feature by computing the file name at make-time instead of passing a litteral? Not quite sure I follow here yet. Yes, I think it is possible to use macro names in @am__include@ statements (we already use $(DEPDIR)). But what would it buy us? 'make' typically requires all unconditionally included files to be present, before it thinks of taking any further action. Thanks for enlightening me. And even with those that do, like GNU make, one would not want to hide problems where the included snippets have buggily not been included as needed. You have a point, but at some point, it becomes more a burden than a feature :( I am regularly bitten by the schizophrenic implementation of this feature, static parts at config.status time, and the rest at runtime. Fully agreed. Cheers, Ralf
Fix nonportable sed script in 'missing'.
Yeah, I actually had to stumble over this recently introduced buglet; Tru64 sed interprets everything between the first 't' and newline/end of script as a label, then complains about the label being longer than 6 characters. :-/ (Of course this is all duly documented in the Autoconf manual section on shell portability). Pushed both branches. Cheers, Ralf Fix nonportable sed script in 'missing'. * lib/missing: In sed script, do not use ';' after 't' commands. diff --git a/lib/missing b/lib/missing index 4758c82..32e23d2 100755 --- a/lib/missing +++ b/lib/missing @@ -1,7 +1,7 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2008-11-24.07 +scriptversion=2008-12-13.14 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008 Free Software Foundation, Inc. @@ -108,7 +108,10 @@ Send bug reports to bug-autom...@gnu.org. esac # normalize program name to check for. -program=`echo $1 | sed 's/^gnu-//; t; s/^gnu//; t; s/^g//; t'` +program=`echo $1 | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect
Re: Bigger picture of automake variables
* LCID Fire wrote on Sun, Dec 21, 2008 at 07:40:00PM CET: Ralf Wildenhues wrote: So basically variables are not ever transported between Makefiles. Correct. Is this written down somewhere on the docs? Not really. Well, what really happens is that, with AC_SUBST([VARIABLE]) in configure.ac, and VARIABLE = my value from Makefile.am in Makefile.am, the Makefile.in will contain VARIABLE = @VARIABLE@ ... VARIABLE = my value from Makefile.am and thus the latter wins. I think this is a candidate for the docs. This is documented in the description of AC_SUBST in @node Optional. Good documentation patches are always welcome. :-) Make the docs a wiki and I'll be eager to update the docs :) There are too many bad autotools docs out there to make that seem appealing. The FSF wants Texinfo as primary documentation, and I don't really have the time to deal with another extra sort of manual. -Finally you should not think either that the existence of a per-target -variable implies that of an @code{AM_} variable or that of a user +Finally you should not think that the existence of a per-target +variable implies the existance of an @code{AM_} variable or of a user variable. For instance, the @code{mumble_LDADD} per-target variable -overrides the global @code{LDADD} variable (which is not a user +overrides the makefile-wide @code{LDADD} variable (which is not a user variable), and @code{mumble_LIBADD} exists only as a per-target variable. @xref{Program and Library Variables}. Thanks. Pushed with that change, put you in THANKS, both branches. Cheers, Ralf
Re: automake less verbose (iter 3)
% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% `if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi` \ -?GENERIC??!SUBDIROBJ?%COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% `$(CYGPATH_W) '%SOURCE%'` \ -?GENERIC??SUBDIROBJ? depbase=`echo %OBJ% | sed 's|[^/]*$$|$(DEPDIR)/|;s|\.obj$$||'`;\ +?!GENERIC? %VERBOSE%%COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% `if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi` \ +?GENERIC??!SUBDIROBJ?%VERBOSE%%COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% `$(CYGPATH_W) '%SOURCE%'` \ +?GENERIC??SUBDIROBJ? %VERBOSE%depbase=`echo %OBJ% | sed 's|[^/]*$$|$(DEPDIR)/|;s|\.obj$$||'`;\ ?GENERIC??SUBDIROBJ? %COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o %OBJOBJ% `$(CYGPATH_W) '%SOURCE%'` \ mv -f %DEPBASE%.Tpo %DEPBASE%.Po --- /dev/null +++ automake-1.10.1/m4/silent.m4 @@ -0,0 +1,7 @@ + +dnl If the developer does not specify AM_VERBOSITY at all, +dnl automake will proceed as if AUTOMAKE_VERBOSITY=. New files need a copyright header, as in all the other files. +AC_DEFUN([AM_VERBOSITY], [ + AC_SUBST([AUTOMAKE_VERBOSITY], [$1]) +]) This whole thing is still lacking all testing, documentation. It still has the wrong default (needs to be opt-in, not opt-out), and still causes a couple of test failures (I've tried to fix them in the patch below). There is the question how users can adjust their own rules to fit (and we should have public macros/variables for that, not am__* ones). Probably in order to be real thorough about testing, the whole suite should be run once with V=1 and once without. :-/ There are a couple of sore points: I had to ease up the check within Variable::define. I would like to fix this before committing. Also, I had to use the AM_BACKSLASH workaround; another global variable that should be unneeded. :-/ Good thing about this approach is that in the packages I tested, it increased Makefile.in size by 1% up to 7% only. Feedback welcome. It'll be some more days before I can get back to this. Cheers, Ralf 2008-12-22 Jan Engelhardt jeng...@medozas.de Ralf Wildenhues ralf.wildenh...@gmx.de Implement silenced build rules. * automake.in (Automake::Struct): New tag 'ccer'. (verbose_var, verbose_flag, silent_flag) (define_verbose_tagvar, define_verbose_libtool): New functions. (handle_languages): Use them, for %VERBOSE% and %SILENT%. (handle_programs, handle_libraries, handle_ltlibraries) (handle_configure, define_compiler_variable) (define_linker_variable, define_per_target_linker_variable): Likewise, deal with verbose and silent flags. Define the respective expansion variables. * lib/Automake/Variable.pm (Automake::Variable): Do not warn about `$' in variable names. * lib/am/depend2.am: Use %VERBOSE% and %SILENT% for Linux kernel-like output when `V' is not set. * lib/am/lex.am: Likewise. * lib/am/library.am: Likewise. * lib/am/ltlibrary.am: Likewise. * lib/am/program.am: Likewise. * lib/am/yacc.am: Likewise. * m4/init.m4 (AM_INIT_AUTOMAKE) [AM_BACKSLASH]: New substitution, not a make variable. * m4/silent.m4 (AM_VERBOSITY): New file, new macro. * m4/Makefile.am: Adjust. * tests/pr300-ltlib.test: Adjust test. diff --git a/automake.in b/automake.in index 6abc1a5..7926da7 100755 --- a/automake.in +++ b/automake.in @@ -87,6 +87,9 @@ struct (# Short name of the language (c, f77...). # Content of the linking variable. 'link' = \$, + # Name of the compiler variable (CC). + 'ccer' = \$, + # Name of the linker variable (LD). 'lder' = \$, # Content of the linker variable ($(CC)). @@ -725,6 +728,7 @@ register_language ('name' = 'c', 'ansi' = 1, 'autodep' = '', 'flags' = ['CFLAGS', 'CPPFLAGS'], + 'ccer' = 'CC', 'compiler' = 'COMPILE', 'compile' = '$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)', 'lder' = 'CCLD', @@ -745,6 +749,7 @@ register_language ('name' = 'cxx', 'autodep' = 'CXX', 'flags' = ['CXXFLAGS', 'CPPFLAGS'], 'compile' = '$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)', + 'ccer' = 'CXX', 'compiler' = 'CXXCOMPILE', 'compile_flag' = '-c', 'output_flag' = '-o', @@ -763,6 +768,7 @@ register_language ('name' = 'objc', 'autodep' = 'OBJC', 'flags' = ['OBJCFLAGS', 'CPPFLAGS'], 'compile
Re: automake less verbose (iter 3.1)
Hello, Let's move this to automake-patches, too. * William Pursell wrote on Mon, Dec 15, 2008 at 09:19:38PM CET: Thanks for this Jan, it is really nice functionality. I don't know if this is a portability issue, but I think it would be nice to change $ to $? in this section: Yes, $ is a portability problem; while $? should be portable, it is probably too verbose, as Jan already mentioned. + 'am__1verbose_CCLD_1 = @echo CCLD $@ - $;', + 'am__1verbose_CXX_1= @echo CXX $@ - $;', + 'am__1verbose_CXXLD_1 = @echo CXXLD$@ - $;', In the case with lots of dependencies, that might lead to excess verbage, but that's what V=0 is for, right? I guess. Another problem is that, in the case of lots of dependencies, this might actually lead to overlong command lines. Esp. on command line length-challenged systems like w32, IRIX, Tru64 this can be a real problem. I noticed that your patch modifies m4/Makefile.in. Is that correct behavior? I'm still unclear on the merits of putting Makefile.in in the repository at all, but I would think that its content in the repository should be automatically generated rather than patched. Well, in general I think most projects have moved away from committing generated files. `info Automake CVS' has some discussion about the issue. For the Automake package itself, the policy so far has been to commit the generated files (along with the commits that create the changes) for a special reason: it forces you to look at the changes that the patch causes on them. This has helped find issues early before. More generally, the tree should always be able to bootstrap itself, otherwise a patch should not be applied; the committed generated files easily show that bootstrapping works. You don't need to post the changes to generated files in patches; I will usually regenerate them before pushing a patch. Cheers, Ralf
[PATCH] Bump copyright years.
Committed to master and branch-1-10. Cheers, Ralf --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-01-20 Ralf Wildenhues ralf.wildenh...@gmx.de + + Bump copyright years. + * aclocal.in (write_aclocal, version): Bump copyright years. + * automake.in (gen_copyright, version): Likewise. + * doc/automake.texi: Likewise. + 2008-12-29 Chris Pickett chris.pick...@mail.mcgill.ca (tiny change) * doc/automake.texi (LIBOBJS): Clarify overriding of @@ -3764,7 +3771,7 @@ - -Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted provided the copyright notice and this notice are preserved. diff --git a/aclocal.in b/aclocal.in index 3cfe1c0..cc52528 100644 --- a/aclocal.in +++ b/aclocal.in @@ -8,7 +8,7 @@ eval 'case $# in 0) exec @PERL@ -S $0;; *) exec @PERL@ -S $0 $@;; esac' # aclocal - create aclocal.m4 by scanning configure.ac # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -818,7 +818,7 @@ $output; $output = # generated automatically by aclocal $VERSION -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -907,7 +907,7 @@ sub version() { print EOF; aclocal (GNU $PACKAGE) $VERSION -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. diff --git a/automake.in b/automake.in index 5523d75..2ea317b 100755 --- a/automake.in +++ b/automake.in @@ -7,7 +7,8 @@ eval 'case $# in 0) exec @PERL@ -S $0;; *) exec @PERL@ -S $0 $@;; esac' # automake - create Makefile.in from Makefile.am # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -254,7 +255,8 @@ my %standard_prefix = # Copyright on generated Makefile.ins. my $gen_copyright = \ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -7955,7 +7957,7 @@ sub version () { print EOF; automake (GNU $PACKAGE) $VERSION -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. diff --git a/doc/automake.texi b/doc/automake.texi index ce4cbcc..43cbbb5 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -22,7 +22,7 @@ This manual is for @acronym{GNU} Automake (version @value{VERSION}, Makefiles from template files. Copyright @copyright{} 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document
Re: expand-before-require bug
Hi Eric, * Eric Blake wrote on Tue, Jan 20, 2009 at 10:30:05PM CET: So now the question becomes, is it okay to apply this patch for cosmetic reasons, and with a changed summary line? If you prefer so, then sure, why not (both branches). Thanks for fixing up the various projects. Cheers, Ralf Subject: [PATCH] Avoid expand-before-require warning from newer autoconf. * m4/init.m4 (AM_INIT_AUTOMAKE): Require, rather than directly expand, AM_PROG_INSTALL_SH and AM_PROG_INSTALL_STRIP.
Re: Make depmode=cpp work with Microsoft Visual C++ on MSYS.
Hi Peter, * Peter Rosin wrote on Tue, Jan 27, 2009 at 02:32:01AM CET: When using MSVC on MSYS, there is nothing that prevents depmode=cpp from being used. It works fine. depmode=msvisualcpp doesn't work as it assumes that cygpath can be used. Thanks for the report and patch. What if the user uses any of these flags (treated specially in msvisualcpp mode)? -Gm|/Gm|-Gi|/Gi|-ZI|/ZI If they are passed in $CC or $CFLAGS at configure time, I guess then _AM_DEPENDENCIES will detect cpp depmode as non-working and try out msvisualcpp depmode. If however these flags are only used later in the build process, then the cpp depmode could fall on its head, no? More generally, I fear that the quirks worked around by msvisualcpp depmode may show up in other corner cases, too. Since you're really only trying to avoid the cygpath issue, how about a different approach: let's make two depmodes, one for MSVC on Cygwin, one for MSVC with MinGW. The only real difference between them should be the path translation used inside depcomp, and the _AM_DEPENDENCIES test could be enhanced to find out the right one at configure time. This means one more depmode to test at configure time, but essentially no additional slowdown at build time. (See at the beginning of depcomp, Some modes work just like other modes, for how this could be done without duplicating too much code there.) It would be great to see how the Automake test suite fares with this compiler (see tests/README for how to enable verbose output), esp. the depcomp*.test tests. Thanks, Ralf +2009-01-27 Peter Rosin p...@lysator.liu.se (tiny change) + + Make depmode=cpp work with Microsoft Visual C++ on MSYS. + * m4/depend.m4 (_AM_DEPENDENCIES): depmode=cpp outputs paths + with double backslashes (instead of single slashes) on MSYS. + Adjust greps to recognize this. --- a/m4/depend.m4 +++ b/m4/depend.m4 @@ -100,9 +100,9 @@ AC_CACHE_CHECK([dependency style of $depcc], depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ /dev/null 2conftest.err - grep sub/conftst1.h sub/conftest.Po /dev/null 21 - grep sub/conftst6.h sub/conftest.Po /dev/null 21 - grep sub/conftest.${OBJEXT-o} sub/conftest.Po /dev/null 21 + grep sub[/\\][\\]*conftst1.h sub/conftest.Po /dev/null 21 + grep sub[/\\][\\]*conftst6.h sub/conftest.Po /dev/null 21 + grep sub[/\\][\\]*conftest.${OBJEXT-o} sub/conftest.Po /dev/null 21 You introduce unquoted grep patterns. These will be subject to shell globbing, which is undesirable. Please double-quote such instances if they should still be necessary. ${MAKE-make} -s -f confmf /dev/null 21; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message
Re: Make depmode=cpp work with Microsoft Visual C++ on MSYS.
* Peter Rosin wrote on Wed, Jan 28, 2009 at 12:57:43PM CET: Considering all of the above, how about the attached patch instead? (I consider it tiny. Even if it touches a few more lines the changes are trivial, much of it is copy-paste...) Let's not worry about the copyright implications of it yet. Den 2009-01-28 09:12, skrev Ralf Wildenhues: It would be great to see how the Automake test suite fares with this compiler (see tests/README for how to enable verbose output), esp. the depcomp*.test tests. Sorry, but I get this configure: error: Autoconf 2.61a-341 or better is required. and I have plain old 2.61. I'm not too keen on building autoconf and possibly muddy up my install... You can install Autoconf below a different --prefix. Which gets me to the next question: if you haven't run the Automake test suite, how have you tested this patch? Does it rightly set depmode to msvisualcpp on Cygwin, and to msvcmsys when using MSYS? Does it produce correct dependencies? In the end, I think it'd really be the easiest if you showed testsuite results, including verbose output for failures. You need not take up work to fix all the failures you'll probably encounter. (At least not yet ;- ) But if you are looking for bugs to squash, one obvious problem is that the standard AC_PROG_CC AM_PROG_CC_C_O puts the dependency check before the -c -o check, which forces losers like me to configure CC=.../path/to/compile cl for the dependency checker to work (as it compiles in subdirs with -c -o). Can some m4 magic be applied so that the dependency check is moved down or the -c -o check moved up, that would be much appreciated! Can probably be done in principle, but would be hacky. Not sure if that is the /first/ bug I'd be trying to fix. It may mean that you have to export CC=.../path/to/compile cl for some of the testsuite tests though. Bummer. Anyway, thank you for your work on this! Cheers, Ralf +2009-01-28 Peter Rosin p...@lysator.liu.se + + Add depmode=msvcmsys for Microsoft Visual C++ on MSYS. + * lib/depcomp: Add depmode=msvcmsys as a derivative of + depmode=msvisualcpp. msvcmsys uses echo instead of cygpath -u + to prevent any path translation. + Also transform any backslashes into forward slashes to make the + grep in depend.m4 match. @@ -85,6 +85,13 @@ if test $depmode = dashXmstdout; then depmode=dashmstdout fi +cygpath_u=cygpath -u +if test $depmode = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + cygpath_u=echo Why not something involving 'CMD //C'? + depmode=msvisualcpp +fi + case $depmode in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -556,15 +563,22 @@ msvisualcpp) esac done $@ -E | - sed -n '/^#line [0-9][0-9]* \([^]*\)/ s::echo `cygpath -u \\\1\\`:p' | sort | uniq $tmpdepfile + sed -n '/^#line [0-9][0-9]* \([^]*\)/ s::echo `$cygpath_u \\\1\\`:p' | sort | uniq $tmpdepfile sort -u? rm -f $depfile echo $object : \\ $depfile - . $tmpdepfile | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' $depfile + . $tmpdepfile | sed -e 's%\\%/%g' -e 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1 \\:p' $depfile You can combine the two sed scripts. echo$depfile - . $tmpdepfile | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' $depfile + . $tmpdepfile | sed -e 's%\\%/%g' -e 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' $depfile Likewise. rm -f $tmpdepfile ;;
Re: Make depmode=cpp work with Microsoft Visual C++ on MSYS.
* Peter Rosin wrote on Thu, Jan 29, 2009 at 04:39:16PM CET: Den 2009-01-28 13:41, skrev Ralf Wildenhues: You can install Autoconf below a different --prefix. Yes, but MSYS is MSYS is MSYS is a bitch. I fail to get automake to build even with autoconf-2.63 (in a new prefix, first in $PATH). I get this when I type make (after ./configure CC=bla bla bla) cd .. perllibdir=/home/peda/automake/git/automake/lib:./lib /home/peda/automake/git/automake/automake --libdir=lib --gnu /bin/sh: /home/peda/automake/git/automake/automake: No such file or directory make: *** [Makefile.in] Error 1 When building git Automake, start with ./bootstrap. That way, you avoid time stamp issues (which are likely to appear due to checked-out generated files). Sorry for the inconvenience. Which gets me to the next question: if you haven't run the Automake test suite, how have you tested this patch? Does it rightly set depmode to msvisualcpp on Cygwin, and to msvcmsys when using MSYS? Does it produce correct dependencies? In the end, I think it'd really be the easiest if you showed testsuite results, including verbose output for failures. You need not take up work to fix all the failures you'll probably encounter. (At least not yet ;- ) Since the patch is now limited to the depcomp program, I simple copied that file into libtool and played with configure. If I configure libtool like this, on MSYS ../configure --enable-dependency-tracking CC=.../path/to/compile cl CFLAGS=-MD -Zi I get this output: [...] checking dependency style of .../path/to/compile cl... msvcmsys checking whether .../path/to/compile cl and cc understand -c and -o together... yes On Cygwin, with the same configure options: [...] checking dependency style of .../path/to/compile cl... msvisualcpp checking whether .../path/to/compile cl and cc understand -c and -o together... yes *snip* But I didn't test enough of course. Blast, it worked with depmode=cpp so I just assumed depmode=msvisualcpp was good enough too. Not so. ;-/ depmode=msvisualcpp, when used with libtool clobbers the output file in the second invocation (with -E). So, I need to copy-paste some code from the depmode=cpp to filter out libtool (and -o $object) from that second invocation. Yeah; I'm assuming that msvisualcpp depmode was written with an MSVC version much older than the one you're testing with. Can probably be done in principle, but would be hacky. Not sure if that is the /first/ bug I'd be trying to fix. It may mean that you have to export CC=.../path/to/compile cl for some of the testsuite tests though. Bummer. Bummer. Exactly, being forced to feed various options to configure should be avoided. I't bad enough as it is... Doesn't mean we shouldn't fix it. But please, let's work on one thing at a time. +cygpath_u=cygpath -u +if test $depmode = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + cygpath_u=echo Why not something involving 'CMD //C'? Because MSVC spits out Win32 paths, no need to involve MSYS with those. Ah, thanks. + sed -n '/^#line [0-9][0-9]* \([^]*\)/ s::echo `$cygpath_u \\\1\\`:p' | sort | uniq $tmpdepfile sort -u? One fork less for each dep, thank you very much. BTW, probably not: likely, sort just forks off uniq by itself. But if it's forks we're chasing, the echo in the echoed `subshell` isn't really defendable when some form of simple echo would do... Do you have a better way with less forks? Ok, third iteration, taking care of all of the above except the echo `echo file` thing. But comparing the resulting depmode=msvisualcpp with depmode=cpp, maybe msvcmsys fit better as a tweeked cpp? That would get rid of a whole bunch of forks for each dep. (msvisualcpp is noticeably slower than cpp) Well, sure, faster is better, but only if functionality is equivalent. I have an old MSVC installation here to test, but that will take a couple of days ... until then, any test results help. Thanks, Ralf 2009-01-29 Peter Rosin p...@lysator.liu.se Add depmode=msvcmsys for Microsoft Visual C++ on MSYS. * lib/depcomp: Add depmode=msvcmsys as a derivative of depmode=msvisualcpp. msvcmsys uses echo instead of cygpath -u to prevent any path translation. Also transform any backslashes into forward slashes to make the grep in depend.m4 match. Fork fewer processes for depmode=msvisualcpp. Filter out libtool in the preprocessor invocation (as is done in depmode=cpp) for depmode=msvisualcpp.
Re: gnupload self-url?
Hi Karl, * Karl Berry wrote on Thu, Jan 29, 2009 at 11:53:15PM CET: I was thinking it might be useful for gnupload --help to tell users (i.e., maintainers) how to get the latest version of the script. Wdyt? Pushed, both branches. I still need to finish reviewing Sergey's largish changes to gnupload. Thanks, Ralf --- /u/karl/gnu/src/automake/lib/ORIG/gnupload2008-11-13 08:10:36.0 -0800 +++ /u/karl/gnu/src/automake/lib/gnupload 2009-01-29 14:52:00.0 -0800 @@ -64,2 +64,5 @@ +You can get the latest version of this script from savannah: +http://git.savannah.gnu.org/cgit/automake.git/plain/lib/gnupload + Report bugs to bug-autom...@gnu.org.
Re: gnupload self-url?
* Karl Berry wrote on Thu, Jan 29, 2009 at 11:53:15PM CET: +You can get the latest version of this script from savannah: +http://git.savannah.gnu.org/cgit/automake.git/plain/lib/gnupload + Report bugs to bug-autom...@gnu.org. BTW, I did enclose the URL in ... angles, consistent with the rest of --help output.
Re: gmake check told me to Please report to ...
* Chris Hoogendyk wrote on Fri, Jan 30, 2009 at 01:57:27PM CET: Ralf Wildenhues wrote: * Chris Hoogendyk wrote on Thu, Jan 29, 2009 at 10:14:08PM CET: This was run on a Sun T5220 using gccfss with gmake under Solaris 10. Is there anything else I can do for you? Yes: please post the output of cd tests gmake check VERBOSE=yes TESTS=check10.test mmodely.test spy.test pasted below. Thanks. The check10.test failure was a bug in the test suite, since fixed (after the 1.10.2 release). The spy.test failure is weird (but harmless): /usr/local/src/gnu-automake/automake-1.10.2/tests:/usr/local/gcc/bin:/opt/coolstack/bin:/usr/local/sbin:/usr/local/bin:/usr/sfw/sbin:/usr/sfw/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/ucb === Running test ./spy.test + pwd /usr/local/src/gnu-automake/automake-1.10.2/tests/testSubDir + set -e + cat + touch b c + sleep 2 + : + gmake gmake: `a' is up to date. + cat a + test = + sleep 2 + touch b + gmake echo rule1 a + cat a + test rule1 = rule1 + : + sleep 2 + touch c + gmake gmake: `a' is up to date. + cat a + test = rule2 FAIL: spy.test Which gmake version do you have, and is your build tree on some networked file system or other that has slow updates? The remaining failure is mmodely.test: /usr/local/src/gnu-automake/automake-1.10.2/tests:/usr/local/gcc/bin:/opt/coolstack/bin:/usr/local/sbin:/usr/local/bin:/usr/sfw/sbin:/usr/sfw/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/ucb mmodely: running gcc --version sparc-sun-solaris2.10-gcc (GCC) 4.2.0 (gccfss) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. === Running test ./mmodely.test + pwd /usr/local/src/gnu-automake/automake-1.10.2/tests/testSubDir + set -e + cat + cat + cat int joe (int arg) { return arg * 2; } + cat int joe (int arg); int main (int argc, char **argv) { exit (joe (argc)); } + sleep 2 + : + : + aclocal-1.10 -Werror + autoconf + automake-1.10 --foreign -Werror -Wall -a configure.in: installing `./ylwrap' + ./configure checking for a BSD-compatible install... ./install-sh -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... ./install-sh -c -d checking for gawk... no checking for mawk... no checking for nawk... nawk checking whether gmake sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for style of include used by gmake... GNU checking dependency style of gcc... gcc3 checking for flex... flex checking lex output file root... lex.yy checking lex library... -lfl checking whether yytext is a pointer... yes checking for bison... bison -y configure: creating ./config.status config.status: creating Makefile config.status: executing depfiles commands + gmake test -f zardoz.c || /bin/bash ./ylwrap zardoz.y y.tab.c zardoz.c y.tab.h zardoz.h y.output zardoz.output -- false gcc -DPACKAGE_NAME=\mmodely\ -DPACKAGE_TARNAME=\mmodely\ -DPACKAGE_VERSION=\1.0\ -DPACKAGE_STRING=\mmodely\ 1.0\ -DPACKAGE_BUGREPORT=\\ -DPACKAGE=\mmodely\ -DVERSION=\1.0\ -DYYTEXT_POINTER=1 -I. -I/usr/local/gcc/include -I/opt/coolstack/include -I/usr/local/include -I/usr/sfw/include -I/usr/include -g -fast -xtarget=ultraT2 -L/opt/coolstack/lib -R/opt/coolstack/lib -L/usr/local/gcc/lib -R/usr/local/gcc/lib -L/usr/local/lib -R/usr/local/lib -L/usr/sfw/lib -R/usr/sfw/lib -L/usr/lib -R/usr/lib -L /usr/ccs/lib -R/usr/ccs/lib -L/usr/ucblib -R/usr/ucblib -MT zardoz.o -MD -MP -MF .deps/zardoz.Tpo -c -o zardoz.o zardoz.c zardoz.c: In function 'main': zardoz.c:4: warning: incompatible implicit declaration of built-in function 'exit' mv -f .deps/zardoz.Tpo .deps/zardoz.Po test -f joe.c || /bin/bash ./ylwrap joe.l lex.yy.c joe.c -- false gcc -DPACKAGE_NAME=\mmodely\ -DPACKAGE_TARNAME=\mmodely\ -DPACKAGE_VERSION=\1.0\ -DPACKAGE_STRING=\mmodely\ 1.0\ -DPACKAGE_BUGREPORT=\\ -DPACKAGE=\mmodely\ -DVERSION=\1.0\ -DYYTEXT_POINTER=1 -I. -I/usr/local/gcc/include -I/opt/coolstack/include -I/usr/local/include -I/usr/sfw/include -I/usr/include -g -fast -xtarget=ultraT2 -L/opt/coolstack/lib -R/opt/coolstack/lib -L/usr/local/gcc/lib -R/usr/local/gcc/lib -L/usr/local/lib -R/usr/local/lib -L/usr/sfw/lib -R/usr/sfw/lib -L/usr/lib -R/usr/lib -L /usr/ccs/lib -R/usr/ccs/lib -L/usr/ucblib -R/usr/ucblib -MT joe.o -MD -MP -MF .deps/joe.Tpo -c -o joe.o joe.c mv -f .deps/joe.Tpo .deps/joe.Po gcc -g -fast
Re: CFLAGS is for the user in GNU
Hi Karl, * Karl Berry wrote on Wed, Feb 04, 2009 at 01:16:20AM CET: The automake manual already mentions this, I actually looked in the automake manual first. And the reference I got to first (don't know why) Probably because that node has @vindex entries for those variables. is the one in the `Program variables' node, which says Some variables are inherited from Autoconf. So I went to the Autoconf manual instead of looking further in automake. Perhaps an @xref{User Variables}? Perhaps not. What do you think about this, for the Automake manual? The Ordering node seems to fit better with the context (the variables which are listed are not all user variables), and it links to the `User Variables' node, and is mostly discusses the quirks. Thanks, Ralf 2009-02-16 Ralf Wildenhues ralf.wildenh...@gmx.de * doc/automake.texi (Program variables): Add cross reference to `Flag Variables Ordering' node. Report by Karl Berry. diff --git a/doc/automake.texi b/doc/automake.texi index 67e20ac..b5e1f6f 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -5850,8 +5850,9 @@ autoconf, The Autoconf Manual}. @section Variables used when building a program Occasionally it is useful to know which @file{Makefile} variables -Automake uses for compilations; for instance, you might need to do your -own compilation in some special cases. +Automake uses for compilations, and in which order (@pxref{Flag +Variables Ordering}); for instance, you might need to do your own +compilation in some special cases. Some variables are inherited from Autoconf; these are @code{CC}, @code{CFLAGS}, @code{CPPFLAGS}, @code{DEFS}, @code{LDFLAGS}, and
Re: CFLAGS is for the user in GNU
* Karl Berry wrote on Tue, Feb 17, 2009 at 02:42:53AM CET: -Automake uses for compilations; for instance, you might need to do your -own compilation in some special cases. +Automake uses for compilations, and in which order (@pxref{Flag +Variables Ordering}); for instance, you might need to do your own +compilation in some special cases. Looks good to me. Seems like it can only help. OK. Pushed.
Backport Exit function from master, for easier cherry-picking.
I noticed that I messed up backporting tests from master to branch-1-10 several times already, due to the Exit function. So let's just avoid this hassle altogether. Pushed to branch-1-10. Cheers, Ralf Backport Exit function from master, for easier cherry-picking. * tests/defs.in (Exit): New function, backported from master, to allow easier backporting of tests from master. diff --git a/tests/defs.in b/tests/defs.in index a1ddd2a..85e95e5 100644 --- a/tests/defs.in +++ b/tests/defs.in @@ -2,7 +2,7 @@ # @configure_input@ # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -241,6 +241,15 @@ case $srcdir in ;; esac +# Automake 1.10a uses a trap for cleanup and an exit wrapper function. +# We add this here, too, in order to facilitate backporting tests. +Exit () +{ + set +e + (exit $1) + exit $1 +} + chmod -R a+rwx testSubDir /dev/null 21 rm -rf testSubDir /dev/null 21 mkdir testSubDir
Fix recursive html and install-* doc rules for BSD make.
Unlike GNU make, BSD make implementations do not assume that a target marked phony which does not have a corresponding rule, is just a happy thing all by itself. Specifically, the second line of this is necessary in order to successfully run 'pmake html': html: html-am html-am: .PHONY: html-am This patch hacks such support into Automake. Yes, it has the unfortunate property of adding several lines to many Makefile.in files :-/ but cleaning up should be done for all %required_targets I guess. Pushed to both branches. Cheers, Ralf Fix recursive html and install-* doc rules for BSD make. * automake.in (%required_targets): Add html-am, install-html-am, install-dvi-am, install-pdf-am, install-ps-am, install-info-am. * tests/txinfo32.test: New test. * tests/Makefile.am: Update. diff --git a/automake.in b/automake.in index 2ea317b..156dfba 100755 --- a/automake.in +++ b/automake.in @@ -458,12 +458,18 @@ my %required_targets = # FIXME: Not required, temporary hacks. # Well, actually they are sort of required: the -recursive # targets will run them anyway... + 'html-am' = 1, 'dvi-am' = 1, 'pdf-am' = 1, 'ps-am' = 1, 'info-am' = 1, 'install-data-am' = 1, 'install-exec-am' = 1, + 'install-html-am' = 1, + 'install-dvi-am' = 1, + 'install-pdf-am' = 1, + 'install-ps-am' = 1, + 'install-info-am' = 1, 'installcheck-am' = 1, 'uninstall-am' = 1, diff --git a/tests/Makefile.am b/tests/Makefile.am index 1ed0fd3..3a55de0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -634,6 +634,7 @@ txinfo28.test \ txinfo29.test \ txinfo30.test \ txinfo31.test \ +txinfo32.test \ transform.test \ transform2.test \ unused.test \ diff --git a/tests/txinfo32.test b/tests/txinfo32.test new file mode 100755 index 000..267c0e9 --- /dev/null +++ b/tests/txinfo32.test @@ -0,0 +1,42 @@ +#! /bin/sh +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. + +# Make sure the documentation targets work as required with BSD make, +# even in the presence of subdirs (requires presence of default *-am rules). + +. ./defs || Exit 1 + +set -e + +mkdir sub +cat configure.in 'END' +AC_CONFIG_FILES([sub/Makefile]) +AC_OUTPUT +END +cat Makefile.am 'END' +SUBDIRS = sub +END +: sub/Makefile.am + +$ACLOCAL +$AUTOCONF +$AUTOMAKE +./configure --prefix=`pwd`/inst +$MAKE html dvi ps pdf info \ + install-html install-dvi install-ps install-pdf install-info \ + install-man install-data install-exec install uninstall + +Exit 0
Re: Make depmode=cpp work with Microsoft Visual C++ on MSYS.
Hi Peter, * Peter Rosin wrote on Fri, Jan 30, 2009 at 11:20:13AM CET: +2009-01-30 Peter Rosin p...@lysator.liu.se + + Add depmode=msvcmsys for Microsoft Visual C++ on MSYS. + * lib/depcomp [msvisualcpp]: Fork fewer processes. Filter out + libtool in the preprocessor invocation (as is done in + depmode=cpp). Silence compiler stderr. + [msvcmsys]: New depmode as a derivative of depmode=msvisualcpp. + msvcmsys transforms any backslashes into forward slashes to + make the grep in depend.m4 match, instead of the cygpath -u + that is used in msvisualcpp. I've applied this change, both branches, but ... --- a/lib/depcomp +++ b/lib/depcomp @@ -85,6 +85,15 @@ if test $depmode = dashXmstdout; then depmode=dashmstdout fi +cygpath_u=cygpath -u -f - +if test $depmode = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u=sed s::/:g ... changed this line to be cygpath_u=sed s,,/,g for good measure; not sure if the MinGW machinery would start mangling your nice sed script on systems with an S: drive mounted. + depmode=msvisualcpp +fi + @@ -555,16 +578,23 @@ msvisualcpp) ;; esac done - $@ -E | - sed -n '/^#line [0-9][0-9]* \([^]*\)/ s::echo `cygpath -u \\\1\\`:p' | sort | uniq $tmpdepfile + $@ -E 2/dev/null | + sed -n '/^#line [0-9][0-9]* \([^]*\)/ s::\1:p' | $cygpath_u | sort -u $tmpdepfile BTW, why was that 2/dev/null necessary again? Thanks again, and sorry for the long delay. Cheers, Ralf
Re: gnupload improvements
Hello Sergey, again, apologies for the delay. * Sergey Poznyakoff wrote on Tue, Feb 17, 2009 at 09:56:09AM CET: Ralf Wildenhues ralf.wildenh...@gmx.de ha escrit: --symlink a b c d will create two symbolic links: a - b and c - d. This API looks rather unusual. Well, I make it this way for two reasons: first, it is consistent with another options (--rmsymlink, --delete) Hmm, then I guess I don't like those options either; but also I don't like backward incompatibilities. Sigh. and secondly it allows to spare some typing when several links need be created. However, if you think it is too error-prone, I can easily switch it back to a two argument form. Also, why is --rmsymlink not --delete? (This is me wondering about the file format, not a question about your patch.) They are two different commands. The --delete option causes removal of a regular file (actually, archivation of it, but the result is the same), whereas --rmsymlink removes a symbolic link. Yes I understand that. I don't think it would have needed two different options for that, though. gnupload --to alpha.gnu.org:tar \ --delete tar-1.20.90.tar.gz tar-1.20.90.tar.bz2 \ --rmsymlink tar-latest.tar.gz tar-latest.tar.gz2 \ -- tar-1.20.91.tar.gz (double-dash in this case is needed to separate files to upload from --rmsymlink arguments). Do we want to make guarantees about the ordering in which actions are taken? The directives are created in the order of their appearance in the command line. The description of the upload directive file in maintain.info says that if you use more than one directive, the directives are executed in the sequence they are specified in. So, it is guaranteed, that the actions are executed in the order they are listed in the command line. OK. I should have been more precise in my comment: if we want to guarantee the ordering of actions (which is important when .gnupload comes into play), then the --help output should explicitly say that ordering is guaranteed. I have added that in the patch below. Bike shedding question: .gnupload or .gnuploadrc? + echo $0: Reading configuration file .gnupload + eval set -- `sed 's/#.*$//;/^$/d' .gnupload | tr '\n' ' '` $* A couple of portability nits: - 'set x ...; shift' Hmm, not quite sure where it can be used in the above statement? Like this: eval set x `sed 's/#.*$//;/^$/d' .gnupload | tr '\012\015' ' '` \\...@\ shift - \$...@\ instead of $* $@ maybe, but \$...@\ will coalesce the actual command line arguments into one, Sorry, I forgot to escape the $, too. As far as I can tell, directive file format does not allow file names containing white space, so the distinction between $@ and $* is probably of little concern here. Maybe; but I dislike unnecessary quoting bugs in code that may be reused elsewhere later. And these two lines are otherwise perfectly reusable. If you agree with my comments, and answer the implied questions, I can make those changes; if you want to resubmit the patch, even better. :-) Sure, find attached a modified version :^) Thanks. I do with we had some testsuite exposure for gnupload though, this has grown so complicated that bugs are likely. Is there test upload space on some of these hosts? I plan to implement this on gnu.org.ua. I'll let you know when it is operational. Thanks. That'd be interesting to hear. In your other mail, you write: Just in case, attached is a modified patch, that removes the leftover uses of ${parameter%%word} and ${parameter##word} expansions. Yes, but that updated patch you sent is less reliable in the sense that the expr expressions return empty strings when there is no separator. I am thus committing your second-newest iteration of the patch (the one from the message this one replies to) and adding you to THANKS, and on top of that, committing the patch below, and then another whitespace-only patch to reindent the argument parsing loop. With the patch below, --dry-run also does not invoke gpg but only echoes the gpg commands that would be called. It would be nice if you could try the resulting script. Thanks. Committing to both branches. Cheers, and sorry for the delay again, Ralf 2009-03-04 Sergey Poznyakoff g...@gnu.org Various gnupload improvements. Add support for uploading to download.gnu.org.ua. Add support for a .gnupload configuration file. Support creating and removing symlinks. Allow for several operations in a single invocation. Add debugging features. * lib/gnupload: New options --delete, --symlink, --rmsymlink, --symlink-regex, --dry-run; support `--' to separate options and commands from files. New target download.gnu.org.ua. Expand `.gnupload' file contents before command line arguments. (usage): Expand. (dprint
lib/depcomp: Various portability and quoting nits.
Pushing this trivial cleanup to both branches. Cheers, Ralf * lib/depcomp: Various portability and quoting nits. diff --git a/lib/depcomp b/lib/depcomp index 47cf50a..0fb633e 100755 --- a/lib/depcomp +++ b/lib/depcomp @@ -1,7 +1,7 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2009-03-03.11 +scriptversion=2009-03-04.20 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free # Software Foundation, Inc. @@ -199,14 +199,14 @@ sgi) ' $tmpdepfile \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' -' ' ' $depfile -echo $depfile +' ' ' $depfile +echo $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' $tmpdepfile \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ -$depfile +$depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile @@ -335,7 +335,12 @@ hp2) if test -f $tmpdepfile; then sed -e s,^.*\.[a-z]*:,$object:, $tmpdepfile $depfile # Add `dependent.h:' lines. -sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' $tmpdepfile $depfile +sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p +}' $tmpdepfile $depfile else echo #dummy $depfile fi @@ -411,7 +416,7 @@ dashmstdout) # Remove the call to Libtool. if test $libtool = yes; then -while test $1 != '--mode=compile'; do +while test X$1 != 'X--mode=compile'; do shift done shift @@ -462,7 +467,7 @@ makedepend) $@ || exit $? # Remove any Libtool call if test $libtool = yes; then -while test $1 != '--mode=compile'; do +while test X$1 != 'X--mode=compile'; do shift done shift @@ -470,7 +475,8 @@ makedepend) # X makedepend shift cleared=no - for arg in $@; do + for arg + do case $cleared in no) set ; shift @@ -487,7 +493,7 @@ makedepend) set fnord $@ $arg; shift ;; esac done - obj_suffix=`echo $object | sed 's/^.*\././'` + obj_suffix=`echo $object | sed 's/^.*\././'` touch $tmpdepfile ${MAKEDEPEND-makedepend} -o$obj_suffix -f$tmpdepfile $@ rm -f $depfile @@ -507,7 +513,7 @@ cpp) # Remove the call to Libtool. if test $libtool = yes; then -while test $1 != '--mode=compile'; do +while test X$1 != 'X--mode=compile'; do shift done shift @@ -550,7 +556,7 @@ msvisualcpp) # Remove the call to Libtool. if test $libtool = yes; then -while test $1 != '--mode=compile'; do +while test X$1 != 'X--mode=compile'; do shift done shift
Re: [PATCH 1/3] Replace 'automake' with @command{automake} where appropriate in automake.texi
Hello William, working my way through my patch backlog ... sorry for the long delay. * William Pursell wrote on Thu, Dec 04, 2008 at 10:03:56AM CET: Ralf Wildenhues wrote: * William Pursell wrote on Mon, Dec 01, 2008 at 10:06:10PM CET: @@ -11677,7 +11677,7 @@ A major and long-awaited release, that comes more than two years after @item The new dependency tracking scheme that uses @command{depcomp}. Aside from the improvement on the dependency tracking itself (@pxref{Dependency Tracking Evolution}), this also streamlines the use -of automake generated @file{Makefile.in}s as the @file{Makefile.in}s +of @command{automake} generated @file{Makefile.in}s as the @file{Makefile.in}s I have a question here: shouldn't this be `...@command{automake}-generated' here? With hyphenation, in German I tend to have a good feeling about when it's needed and when not, but I'm not quite sure whether those rules (which I probably can't even formulate precisely) carry over to English writing. As a native English speaker, I have absolutely no idea. I'm not even sure that English has rules. :) Believe me, it does. But as with standards, there are various sets of rules to choose from, and they tend to change over time, e.g., when they are just ignored sufficiently often. :-) My intuition says that either form is grammatically correct, that including the hyphen is probably slightly more correct, and that leaving it out is slightly more natural. I don't think the distinction is enough that anyone would notice either way. Opinions may vary, of course, and it is entirely likely that I am completely wrong. After reading http://en.wikipedia.org/wiki/Hyphen and considering again a subscription of the Chicago Manual of Style, I am pretty sure that hyphenation is the correct thing to do in this situation. I have thusly pushed your patch with this change, as well as with the comments from my previous review addressed, which was here: http://thread.gmane.org/gmane.comp.sysutils.automake.patches/3326/focus=3331 Cheers, and thanks again, Ralf 2009-03-04 William Pursell bill.purs...@gmail.com Replace 'automake' with @command{automake} or Automake in automake.texi * doc/automake.texi: Avoid bare `automake' in the manual, replacing occurrences with `...@command{automake}' when the command is meant, and `Automake' when speaking about the software package in general. diff --git a/doc/automake.texi b/doc/automake.texi index 930b91a..450d55c 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -1867,7 +1867,7 @@ At @command{make} time, certain variables are used to determine which objects are to be built. The variable names are made of several pieces that are concatenated together. -The piece that tells automake what is being built is commonly called +The piece that tells @command{automake} what is being built is commonly called the @dfn{primary}. For instance, the primary @code{PROGRAMS} holds a list of programs that are to be compiled and linked. @vindex PROGRAMS @@ -3157,9 +3157,9 @@ directories, in this order: @table @code @item @var{acdir-APIVERSION} -This is where the @file{.m4} macros distributed with automake itself -are stored. @var{APIVERSION} depends on the automake release used; -for automake 1.6.x, @var{APIVERSION} = @code{1.6}. +This is where the @file{.m4} macros distributed with Automake itself +are stored. @var{APIVERSION} depends on the Automake release used; +for Automake 1.6.x, @var{APIVERSION} = @code{1.6}. @item @var{acdir} This directory is intended for third party @file{.m4} files, and is @@ -3193,7 +3193,7 @@ drops the @var{APIVERSION} directory. For example, if one specifies @end enumerate This option, @option{--acdir}, is intended for use by the internal -automake test suite only; it is not ordinarily needed by end-users. +Automake test suite only; it is not ordinarily needed by end-users. @subsubsection Modifying the macro search path: @samp{-I @var{dir}} @@ -3248,7 +3248,7 @@ If the @option{--acd...@var{dir}} option is used, then @command{aclocal} will search for the @file{dirlist} file in @var{dir}. In the @samp{--acdir=/opt/private/} example above, @command{aclocal} would look for @file{/opt/private/dirlist}. Again, however, the @option{--acdir} -option is intended for use by the internal automake test suite only; +option is intended for use by the internal Automake test suite only; @option{--acdir} is not ordinarily needed by end-users. @file{dirlist} is useful in the following situation: suppose that @@ -3810,7 +3810,7 @@ choose the assembler for you (by default the C compiler) and set @acindex AM_PROG_CC_C_O @acindex AC_PROG_CC_C_O This is like @code{AC_PROG_CC_C_O}, but it generates its results in -the manner required by automake. You must use this instead of +the manner required by Automake. You must use this instead of @code{AC_PROG_CC_C_O} when you need this functionality
Re: gnupload improvements
Hi Karl, Sergey, thanks for the feedback! * Karl Berry wrote on Wed, Mar 04, 2009 at 11:55:20PM CET: Hmm, then I guess I don't like those options either; but also I don't like backward incompatibilities. Sigh. Since gnupload is only used by GNU maintainers, I do not consider backward compatibility as critical as with normal programs. I don't feel strongly about --symlink arg parsing. I've never created a symlink yet on ftp.gnu.org, let alone wanted to create more than one at a time. Yes I understand that. I don't think it would have needed two different options for that, though. It needs to be two options because the FSF sysadmins implemented two different directives. There's no feasible way to know whether something is a symlink or a file on the machine running gnupload. Hmm, OK. Bike shedding question: .gnupload or .gnuploadrc? I vote for ...rc. * Sergey Poznyakoff wrote on Thu, Mar 05, 2009 at 10:19:09AM CET: Well, I'd be OK with either of them. I have a slight preference for the 'rc' suffix, too, so I've pushed this change. Thanks, Ralf * lib/gnupload: Change conffile name to `.gnuploadrc'. diff --git a/lib/gnupload b/lib/gnupload index a1add23..7c34784 100755 --- a/lib/gnupload +++ b/lib/gnupload @@ -1,7 +1,7 @@ #!/bin/sh # Sign files and upload them. -scriptversion=2009-03-04.21 +scriptversion=2009-03-05.20 # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation # @@ -23,7 +23,7 @@ scriptversion=2009-03-04.21 set -e GPG='gpg --batch --no-tty' -conffile=.gnupload +conffile=.gnuploadrc to= dry_run=false symlink_files=
testsuite: SKIP compile tests if configure found no compiler.
configure nicely exits 77 if the first compiler test failed; so let's use that to skip those tests that otherwise fail due to this. Pushed both branches. Cheers, Ralf testsuite: SKIP compile tests if configure found no compiler. * tests/depend6.test: configure will exit 77 if AC_PROG_CC found no working compiler. Allow the test to be SKIPped in that case. * tests/postproc.test: Likewise. * tests/pr243.test: Likewise. * tests/pr266.test: Likewise. diff --git a/tests/depend6.test b/tests/depend6.test index 6a1595c..7a1f722 100755 --- a/tests/depend6.test +++ b/tests/depend6.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2008 Free Software Foundation, Inc. +# Copyright (C) 2008, 2009 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -39,7 +39,9 @@ END $ACLOCAL $AUTOMAKE $AUTOCONF -./configure --disable-dependency-tracking 2stderr || { cat stderr 2; Exit 1; } +./configure --disable-dependency-tracking 2stderr || { + stat=$?; cat stderr 2; Exit $stat; +} cat stderr 2 grep shift stderr Exit 1 : diff --git a/tests/postproc.test b/tests/postproc.test index 254c936..dff60fc 100755 --- a/tests/postproc.test +++ b/tests/postproc.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002, 2004 Free Software Foundation, Inc. +# Copyright (C) 2002, 2004, 2009 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -40,7 +40,7 @@ mv myMakefile.in myMakefile.old echo '# Post-processed by post-processor 3.14.' myMakefile.in cat myMakefile.old myMakefile.in -./configure || Exit 1 +./configure || Exit $? test -f .deps/fred.Po || test -f _deps/fred.Po || Exit 1 diff --git a/tests/pr243.test b/tests/pr243.test index 1a66e8e..516665e 100755 --- a/tests/pr243.test +++ b/tests/pr243.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2009 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -40,6 +40,6 @@ END $ACLOCAL || Exit 1 $AUTOMAKE || Exit 1 $AUTOCONF || Exit 1 -./configure || Exit 1 +./configure || Exit $? test -f .deps/fx64.Po diff --git a/tests/pr266.test b/tests/pr266.test index e3fd582..2b4ca1f 100755 --- a/tests/pr266.test +++ b/tests/pr266.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2009 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -38,6 +38,6 @@ END $ACLOCAL || Exit 1 $AUTOMAKE || Exit 1 $AUTOCONF || Exit 1 -./configure || Exit 1 +./configure || Exit $? test -f .deps/fx64.Po
Improve `make -n dist' and `make -n distcheck' for GNU make.
I noticed that `make -n dist' touches the build tree, in that it creates directories $(distdir) and below. Also, `make -n distcheck' bails out with some error due to missing directories. (BTW, I'm unsure whether this has been reported before; if yes, speak up and I'll thank ya!) This happens because, even in the presence of `-n', GNU (and Solaris) make executes rule commands that contain the string `$(MAKE)'. This is all Good[tm] in general, but it means that we should separate commands that change files from those that only recurse, and where not possible (distcheck), ensure to bail out early and cleanly. This patch fixes these issues. The second test is mostly identical to the first one, except that it ensures that GNU make produces sufficient output. One more patch to improve things for some BSD make versions coming up. I'm not sure whether rule commands prefixed by `+' are portable enough or desirable in Automake-provided rules; they have never been used so far. So I might want to avoid using it for now. Pushed to master; I thought about branch-1-10, too, as the patch does not seem all that intrusive, but master has seen other necessary fixes, most notably 4a6593e3b (Fix the distdir target to cope with spaces in absolute file names). Cheers, Ralf Improve `make -n dist' and `make -n distcheck' for GNU make. Ensure that `make -n dist' and `make -n distcheck' do not change files, due to GNU make executing rules containing `$(MAKE)'. * lib/am/distdir.am (distdir): Separate the creation of `$(distdir)/$$subdir' for `$(DIST_SUBDIRS)' and the recursion into the `$(DIST_SUBDIRS)' in two separate rule commands. (distcheck): Exit recursive rule early when run with `make -n', as detected by a witness file. * tests/maken.test, tests/maken2.test: New tests. * tests/Makefile.am: Update. * NEWS: Update. diff --git a/NEWS b/NEWS index 6fcc1a5..d4b59e9 100644 --- a/NEWS +++ b/NEWS @@ -170,6 +170,9 @@ Bugs fixed in 1.10a: containing the error message, but exit successfully. However, `make dist' will ensure that no such bogus man pages are packaged into a tarball. + - Targets provided by automake behave better with `make -n', in that they +take care not to create files. + * Bugs introduced by 1.10: - Fix output of dummy dependency files in presence of post-processed diff --git a/lib/am/distdir.am b/lib/am/distdir.am index 5acfa49..ad5e771 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -220,12 +220,18 @@ endif %?TOPDIR_P% ## directory, then we use `distdir' instead of `top_distdir'; this lets ## us work correctly with an enclosing package. ## +## Split the loop for the directory creation and the one for recursion, +## so that with GNU make -n, only the latter is executed. if %?SUBDIRS% @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test $$subdir = .; then :; else \ test -d $(distdir)/$$subdir \ || $(MKDIR_P) $(distdir)/$$subdir \ || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test $$subdir = .; then :; else \ dir1=$$subdir; dir2=$(distdir)/$$subdir; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -418,6 +424,12 @@ distcheck: dist mkdir $(distdir)/_inst ## Undo the write access. chmod a-w $(distdir) +## With GNU make, the following command will be executed even with `make -n', +## due to the presence of `$(MAKE)'. That is normally all well (and `$(MAKE)' +## is necessary for things like parallel distcheck), but here we don't want +## execution. To avoid MAKEFLAGS parsing hassles, use a witness file that a +## non-`-n' run would have just created. + test -d $(distdir)/_build || exit 0; \ ## Compute the absolute path of `_inst'. Strip any leading DOS drive ## to allow DESTDIR installations. Otherwise $(DESTDIR)$(prefix) would ## expand to c:/temp/am-dc-5668/c:/src/package/package-1.0/_inst. diff --git a/tests/Makefile.am b/tests/Makefile.am index d4687f4..15e8e61 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -393,6 +393,8 @@ lzma.test \ maintclean.test \ make.test \ makej.test \ +maken.test \ +maken2.test \ makevars.test \ man.test \ man2.test \ diff --git a/tests/maken.test b/tests/maken.test new file mode 100755 index 000..8219ec6 --- /dev/null +++ b/tests/maken.test @@ -0,0 +1,61 @@ +#! /bin/sh +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public
Re: automake less verbose (iter 3)
Hi Jan, while reviewing the threads about this topic, I found this: * Jan Engelhardt wrote on Wed, Dec 24, 2008 at 11:47:36PM CET: On Monday 2008-12-22 22:28, Ralf Wildenhues wrote: [ from http://thread.gmane.org/gmane.comp.sysutils.automake.general/9995 ] I haven't found another way yet. If we can't find one, then your choice of $(var1$(var2)) is certainly better than nothing, in combination with (1). (which is what is in the current branch) I seem to remember that configure produces non-portable Makefiles anyway, so (1) should be ok; specifically, running `configure` on Linux and then issuing `make` on NetBSD, or vice versa, got me into shell syntax issues or something in that direction. Well, no. You cannot run configure on one system and expect the produced makefiles and headers to work on another system. That is one fundamental aspect of autotools: the tarball is portable, then you go and create a system-specific configuration by running configure. That's one reason why VPATH builds are so helpful: you can use several build trees, one per system, off a single source tree. Another minor issue I don't quite like yet: before this change, the code was quite carefully laid out to be performant in the generic fastdep case: GNU make can avoid spawning a shell for a command, when the command line to be executed can be shown to be free of shell special variables. Including ||, ``, \ and all those meta characters? Yes. (For precise heuristics see the GNU make sources.) Breaking this means one more shell fork per source file. Well the question is whether this does happen, because %VERBOSE% just adds @echo CC $@; and this can entirely be handled by make alone, if its heuristics are good. Current GNU make will invoke the shell for this for two reasons: the semicolon, and the built-in 'echo'. And if make is going to invoke the shell anyway for the echo, then it is not much more expensive to pass it the whole line. [ extra newline in V=1 output with some compile2.am rules ] Not nice; however, I don't see a good way around this either, at least not in the silent case, and without introducing new newlines in the output in the non-silent case. Well newlines can easily be avoided by getting rid of all the continuation lines within an if block and writing the full command lines out on every line. Yes, redundancy, but it's what it takes. Yes but that has the downside of enlarging some Makefile.in files by quite a bit. This is important, when some files end up being in the MB range. Cheers, Ralf
[PATCH 1/4] New channel `portability-recursive'.
[ moving from automake@ ] * Ralf Wildenhues wrote on Sat, Mar 07, 2009 at 04:16:33PM CET: git clone git://git.savannah.gnu.org/automake.git git branch je-silent origin/je-silent (thanks Jan for the typo fix!) Detailed patch descriptions will follow on automake-patches, This first patch in the series adds a new warning channel for warnings about recursive variable expansions. This warning channel is currently turned on by -Wall, but it should also be turned on by -Wportability, I guess; or get its own switch. As noted in some of the earlier discussions, recursive $(var1$(var2)) variable expansions are in practice found to be rather portable (when the inner variable uses ${..} or $(..), not plain $..). As another FIXME note, a warning message would currently output a slightly bogus string `$(var2', which should be fixed in the scan_variable_expansions function. I refrained from that for now, this is quite a hot code path and I wanted to do some measuring before adding more non-regular expression matching. Cheers, Ralf New channel `portability-recursive'. Add new channel for portability warnings about recursive make variable expansions `$(var1$(var2))'. Enable it alongside `-Wportability'. * lib/Automake/ChannelDefs.pm (Automake::ChannelDefs): Register channel `portability-recursive'. * lib/Automake/Variable.pm (_VARIABLE_CHARACTERS) (_VARIABLE_RECURSIVE_PATTERN): New variables. (check_variable_expansions): Diagnose recursive variable expansions through the new channel. diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm index 15362b5..60520b7 100644 --- a/lib/Automake/ChannelDefs.pm +++ b/lib/Automake/ChannelDefs.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2002, 2003, 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2006, 2008, 2009 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -154,6 +154,7 @@ register_channel 'gnu', type = 'warning'; register_channel 'obsolete', type = 'warning', silent = 1; register_channel 'override', type = 'warning', silent = 1; register_channel 'portability', type = 'warning', silent = 1; +register_channel 'portability-recursive', type = 'warning', silent = 1; register_channel 'syntax', type = 'warning'; register_channel 'unsupported', type = 'warning'; diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm index 79bb42c..f826586 100644 --- a/lib/Automake/Variable.pm +++ b/lib/Automake/Variable.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -128,7 +128,10 @@ non-object). =cut -my $_VARIABLE_PATTERN = '^[.a-za-z0...@]+' . \$; +my $_VARIABLE_CHARACTERS = '[.a-za-z0...@]+'; +my $_VARIABLE_PATTERN = '^' . $_VARIABLE_CHARACTERS . \$; +my $_VARIABLE_RECURSIVE_PATTERN = +'^([.a-za-z0...@]|\$[({]' . $_VARIABLE_CHARACTERS . '[})]?)+' . \$; # The order in which variables should be output. (May contain # duplicates -- only the first occurrence matters.) @@ -771,8 +774,17 @@ sub check_variable_expansions ($$) # Mention this in the diagnostic. my $gnuext = ; $gnuext = \n(probably a GNU make extension) if $var =~ / /; - msg ('portability', $where, - $var: non-POSIX variable name$gnuext); + # Accept recursive variable expansions if so desired + # (we hope they are rather portable in practice). + if ($var =~ /$_VARIABLE_RECURSIVE_PATTERN/o) + { + msg ('portability-recursive', $where, + $var: non-POSIX recursive variable expansion$gnuext); + } + else + { + msg ('portability', $where, $var: non-POSIX variable name$gnuext); + } } } }
[PATCH 2/4] Implement `silent' build rules.
This is the meat of the change. Changes over previous iterations of the patch: I went back to Jan's original idea of recursive variable expansion, but without adding variables to Makefile.in for languages that are not used. Factorized the code a bit more. One thing that bothers me with this patch is the AM_BACKSLASH hack. We should find a way to at least avoid the need for a configure substitution, if we cannot avoid the extra empty line in the verbose output. Also, Jan rightly noted the need for user variable for extending rules. Cheers, Ralf 2009-03-07 Jan Engelhardt jeng...@medozas.de Ralf Wildenhues ralf.wildenh...@gmx.de Implement `silent' build rules. * automake.in (ccer): New field in the language structure. Initialize it for all registered languages. (verbose_var, verbose_flag, verbose_dispatch) (silent_flag, define_verbose_var, define_verbose_tagvar) (define_verbose_libtool): New functions. (handle_languages, handle_programs, handle_libraries) (handle_ltlibraries, handle_configure) (define_compiler_variable, define_linker_variable) (define_per_target_linker_variable): Use them where appropriate to define variables to implement the silent output machinery. * lib/Automake/Options.pm (_process_option_list): Accept `silent', turning off `portability-recursive'. * lib/am/depend2.am: Add %VERBOSE% and %SILENT% prefixes where appropriate. * lib/am/lex.am: Likewise. * lib/am/library.am: Likewise. * lib/am/ltlibrary.am: Likewise. * lib/am/program.am: Likewise. * lib/am/yacc.am: Likewise. * m4/init.m4 (AM_INIT_AUTOMAKE): Substitute, but do not define, AM_BACKSLASH. * tests/defs.in: Unset `V', to avoid influencing inner tests. diff --git a/automake.in b/automake.in index 9367a08..94454c2 100755 --- a/automake.in +++ b/automake.in @@ -88,6 +88,9 @@ struct (# Short name of the language (c, f77...). # Content of the linking variable. 'link' = \$, + # Name of the compiler variable (CC). + 'ccer' = \$, + # Name of the linker variable (LD). 'lder' = \$, # Content of the linker variable ($(CC)). @@ -729,6 +732,7 @@ register_language ('name' = 'c', 'ansi' = 1, 'autodep' = '', 'flags' = ['CFLAGS', 'CPPFLAGS'], + 'ccer' = 'CC', 'compiler' = 'COMPILE', 'compile' = '$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)', 'lder' = 'CCLD', @@ -749,6 +753,7 @@ register_language ('name' = 'cxx', 'autodep' = 'CXX', 'flags' = ['CXXFLAGS', 'CPPFLAGS'], 'compile' = '$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)', + 'ccer' = 'CXX', 'compiler' = 'CXXCOMPILE', 'compile_flag' = '-c', 'output_flag' = '-o', @@ -767,6 +772,7 @@ register_language ('name' = 'objc', 'autodep' = 'OBJC', 'flags' = ['OBJCFLAGS', 'CPPFLAGS'], 'compile' = '$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)', + 'ccer' = 'OBJC', 'compiler' = 'OBJCCOMPILE', 'compile_flag' = '-c', 'output_flag' = '-o', @@ -784,6 +790,7 @@ register_language ('name' = 'upc', 'autodep' = 'UPC', 'flags' = ['UPCFLAGS', 'CPPFLAGS'], 'compile' = '$(UPC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_UPCFLAGS) $(UPCFLAGS)', + 'ccer' = 'UPC', 'compiler' = 'UPCCOMPILE', 'compile_flag' = '-c', 'output_flag' = '-o', @@ -808,6 +815,7 @@ register_language ('name' = 'yacc', 'config_vars' = ['YACC'], 'flags' = ['YFLAGS'], 'compile' = '$(YACC) $(YFLAGS) $(AM_YFLAGS)', + 'ccer' = 'YACC', 'compiler' = 'YACCCOMPILE', 'extensions' = ['.y'], 'output_extensions' = sub { (my $ext = $_[0]) =~ tr/y/c/; @@ -821,6 +829,7 @@ register_language ('name' = 'yaccxx', 'config_vars' = ['YACC'], 'rule_file' = 'yacc', 'flags' = ['YFLAGS'], + 'ccer' = 'YACC', 'compiler' = 'YACCCOMPILE', 'compile' = '$(YACC) $(YFLAGS) $(AM_YFLAGS)', 'extensions' = ['.y++', '.yy', '.yxx', '.ypp'], @@ -837,6 +846,7 @@ register_language ('name' = 'lex', 'rule_file' = 'lex', 'flags' = ['LFLAGS
[PATCH 4/4] New automake command line option `--silent-rules'.
For this patch, I'm unsure if we should even add it at all. It adds an automake option to enable silent build rules. Here's why I wrote it in the first place: if you are a distribution and want to change all your packages to build silently, you may not want to change each package's configure.ac file. So instead you could change $AUTOMAKE to contain this flag. Do you think this is worthwhile to even have? If not, I will probably want to leave it out for 1.11. The current patch still has a couple of warts in that --silent-rules should turn off portability-recursive warnings independently of the command line argument order. This is another reason I don't like this addition much: it needs more special-casing and complex semantics in order to work seamlessly for users. The silent6.test should be retained, though, I guess, or redone with extensions for users documented. Cheers, Ralf New automake command line option `--silent-rules'. * automake.in (parse_arguments): Accept `--silent-rules; let it override command line warning settings. (usage): Document it. * doc/automake.texi (Invoking Automake): Document it. * NEWS: Update. * tests/dollarvar.test: Also test `--silent-rules'. * tests/pr300-ltlib.test: Use `$MAKE V=1' to enable verbose output, which is matched later in the test. * tests/silent6.test: New test. * tests/Makefile.am: Update. diff --git a/NEWS b/NEWS index 78ce7ab..6975751 100644 --- a/NEWS +++ b/NEWS @@ -113,6 +113,8 @@ New in 1.10a: This option requires the widely supported but non-POSIX `make' feature of recursive variable expansion, so do not use it if your package needs to build with `make' implementations that do not support it. +Besides the normal option setting methods, it can also be enabled +globally by the new automake option `--silent-rules'. - New prefix `notrans_' for manpages which should not be transformed by --program-transform. diff --git a/automake.in b/automake.in index 94454c2..675a1fe 100755 --- a/automake.in +++ b/automake.in @@ -8039,6 +8039,7 @@ Flavors: --foreign set strictness to foreign --gnitsset strictness to gnits --gnu set strictness to gnu + --silent-rules enable silent build rules Library files: -a, --add-missing add missing standard files to package @@ -8144,7 +8145,8 @@ sub parse_arguments () 'f|force-missing' = \$force_missing, 'o|output-dir=s' = \$output_directory, 'a|add-missing' = \$add_missing, - 'c|copy' = \$copy_missing, + 'c|copy' = \$copy_missing, + 'silent-rules'= sub { set_global_option ('silent', $cli_where); }, 'v|verbose' = sub { setup_channel 'verb', silent = 0; }, 'W|warnings=s' = \parse_warnings, # These long options (--Werror and --Wno-error) for backward @@ -8189,6 +8191,10 @@ sub parse_arguments () $output_directory = '.'; } + # Override portability-recursive warning. + process_global_option_list ($cli_where, 'silent') +if global_option 'silent'; + return unless @ARGV; if ($ARGV[0] =~ /^-./) diff --git a/doc/automake.texi b/doc/automake.texi index 0d104cc..da6e779 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -2515,6 +2515,10 @@ Ordinarily each @file{Makefile.in} is created in the directory of the corresponding @file{Makefile.am}. This option is deprecated and will be removed in a future release. +...@item --silent-rules +...@opindex --silent-rules +Enable the @option{silent} option globally (@pxref{Options}). + @item -v @itemx --verbose @opindex -v diff --git a/tests/Makefile.am b/tests/Makefile.am index 5ff30e4..9b66bff 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -540,6 +540,7 @@ silent2.test \ silent3.test \ silent4.test \ silent5.test \ +silent6.test \ sinclude.test \ srcsub.test \ srcsub2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index dfc01de..42a149f 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -695,6 +695,7 @@ silent2.test \ silent3.test \ silent4.test \ silent5.test \ +silent6.test \ sinclude.test \ srcsub.test \ srcsub2.test \ diff --git a/tests/dollarvar.test b/tests/dollarvar.test index 3c43a61..5b79eb0 100755 --- a/tests/dollarvar.test +++ b/tests/dollarvar.test @@ -48,6 +48,15 @@ grep 'Makefile.am:7' stderr # On the other hand, if we allow `silent' mode, then we need to allow # recursive variable expansion, too. +# This should work with the `--silent-rules' command line switch. +AUTOMAKE_fails -Wportability --silent-rules +grep 'Makefile.am:2' stderr +grep 'Makefile.am:3' stderr +grep 'Makefile.am:4' stderr +grep 'Makefile.am:5' stderr +grep 'Makefile.am:6' stderr Exit 1 +grep 'Makefile.am:7' stderr Exit 1 + # This should work with AUTOMAKE_OPTIONS. echo 'AUTOMAKE_OPTIONS = silent' Makefile.am diff --git a/tests/pr300-ltlib.test b/tests/pr300-ltlib.test index
Re: Make compile wrapper eat win32 paths
* Peter Rosin wrote on Mon, Mar 09, 2009 at 04:53:11PM CET: Here's a tiny fix for a typo in the new compile2.test. With this fix I get exitcode 77 between the two subtests. Thanks, applied. Cheers, Ralf commit 3f63a77c0647199d4121c54ea29d28d509539369 Author: Peter Rosin p...@lysator.liu.se Date: Mon Mar 9 16:48:56 2009 +0100 * tests/compile2.test: Fix typo.
Re: [PATCH 4/4] New automake command line option `--silent-rules'.
* Ralf Corsepius wrote on Mon, Mar 09, 2009 at 03:57:58PM CET: Jan Engelhardt wrote: On Monday 2009-03-09 15:44, Ralf Corsepius wrote: Ralf Wildenhues wrote: For this patch, I'm unsure if we should even add it at all. FWIW: I am opposed to it. I suppose you are opposed to the whole topic, rather than only to patch number 4? All this silencing stuff does is to add further potential sources of errors. Certainly. All new code does this, to some degree. The patches in the branch should not modify automake's output much if the `silent' option is not used. Of course there can still be regressions due to necesarily changed code inside automake (see patch 1 for a minor known example that I'll fix before merging the branch). My particular question above was meant as: I am unsure whether the fourth patch in the series is worth applying. I do consider the series worth applying, and I will use patches 1-3 plus fixes unless we find a very serious issue with it. My current take on patch 4 is this: It has the chance of making silent rebuilds easy for distributors, but OTOH is has the potential downside of taking the decision away from the package maintainer. I definitely want the package maintainer to be able to say: I do not want to see bug reports that lack compile command lines; thus I do not enable the `silent' feature. Aside, patch 4 also has rebuild issues ATM (the --silent-rules arg is not stored in the rebuild rule). So, I'm considering reverting patch 4. Cheers, Ralf, wishing people would spend as much time writing tests as they would discussing
Re: [PATCH 1/4] New channel `portability-recursive'.
* Ralf Wildenhues wrote on Sun, Mar 08, 2009 at 10:18:51AM CET: This warning channel is currently turned on by -Wall, but it should also be turned on by -Wportability, I guess; or get its own switch. As noted in some of the earlier discussions, recursive $(var1$(var2)) variable expansions are in practice found to be rather portable (when the inner variable uses ${..} or $(..), not plain $..). Fixed with this patch, pushed to the branch. Cheers, Ralf Let -Wportability turn on/off the portability-recursive channel. * lib/Automake/ChannelDefs.pm (switch_warning): switch `portability-recursive' channel as well if chaning `portability' channel. * tests/dollarvar2.test: New test. * tests/Makefile.am: Update. diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm index 60520b7..436a904 100644 --- a/lib/Automake/ChannelDefs.pm +++ b/lib/Automake/ChannelDefs.pm @@ -281,6 +281,8 @@ sub switch_warning ($) elsif (channel_type ($cat) eq 'warning') { setup_channel $cat, silent = $has_no; + setup_channel 'portability-recursive', silent = $has_no +if $cat eq 'portability'; } else { diff --git a/tests/Makefile.am b/tests/Makefile.am index 9b66bff..a1af65d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -241,6 +241,7 @@ distdir.test \ distname.test \ dollar.test \ dollarvar.test \ +dollarvar2.test \ double.test \ dup2.test \ else.test \ diff --git a/tests/dollarvar2.test b/tests/dollarvar2.test new file mode 100755 index 000..676cde2 --- /dev/null +++ b/tests/dollarvar2.test @@ -0,0 +1,38 @@ +#!/bin/sh +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. + +# Test to make sure that -Wportability turns on portability-recursive, +# likewise for -Wno-... + +. ./defs + +set -e + +cat Makefile.am 'EOF' +x = 1 +bla = $(foo$(x)) +EOF + +$ACLOCAL + +# $AUTOMAKE already contains -Wall -Werror. +AUTOMAKE_fails -Wportability +$AUTOMAKE --force -Wno-all +$AUTOMAKE --force -Wno-portability +echo 'AUTOMAKE_OPTIONS = -Wno-portability' Makefile.am +$AUTOMAKE --force + +:
Re: automake less verbose branch
* Ralf Wildenhues wrote on Sun, Mar 08, 2009 at 10:07:06AM CET: * Jan Engelhardt wrote on Sat, Mar 07, 2009 at 07:17:03PM CET: I am missing the definition of am__v_GEN in the generated Makefile that is designed for use with manual rules. Like, # -*- Makefile -*- man8_MANS = foo.8 foo.8: foo.8.in ${am__v_GEN}man -l foo.8.in $@ Good point; thanks. The user extensibility should be documented, too. So far, the only extensibility I've put in was in tests/silent6.test, but it's a good idea to have automake add a documented variable. And those variables should not be in the am__ namespace. Hmm, I think that means those variables appearing directly in %VERBOSE% should not be in that space either. Fixed with this couple of patches, pushed to the branch. Cheers, Ralf Redo variable naming for `silent' machinery. The public variables are named `AM_V_' plus the compiler short-hand now, e.g.: AM_V_CC, AM_V_CXXLD, AM_V_GEN. The dispatch variables are internal details and begin with `am__v_'. * automake.in (verbose_var): Update comment. (verbose_private_var): New function. Order functions so that ones not needed outside this section are listed first. (verbose_dispatch): Remove, no need to factor this. (define_verbose_var, define_verbose_libtool): Use verbose_private_var. (define_verbose_tagvar): Likewise; and simplify. Report by Jan Engelhardt. diff --git a/automake.in b/automake.in index 675a1fe..9757ed7 100755 --- a/automake.in +++ b/automake.in @@ -1115,13 +1115,41 @@ sub backname ($) # verbose_var (NAME) # -- -# The naming policy for the variables used to implement `silent'. +# The public variable stem used to implement `silent'. sub verbose_var ($) { my ($name) = @_; +return 'AM_V_' . $name; +} + +# verbose_private_var (NAME) +# -- +# The naming policy for the private variables used to implement `silent'. +sub verbose_private_var ($) +{ +my ($name) = @_; return 'am__v_' . $name; } +# define_verbose_var (NAME, VAL) +# -- +# For `silent' mode, setup VAR and dispatcher, to expand to VAL if silent. +sub define_verbose_var ($$) +{ +my ($name, $val) = @_; +my $var = verbose_var ($name); +my $pvar = verbose_private_var ($name); +if (option 'silent') + { + # Using `$V' instead of `$(V)' breaks IRIX make. + define_variable ($var, '$(' . $pvar . '_$(V))', INTERNAL); + define_variable ($pvar . '_', $val, INTERNAL); + define_variable ($pvar . '_0', $val, INTERNAL); + } +} + +# Above should not be needed in the general automake code. + # verbose_flag (NAME) # --- # Contents of %VERBOSE%: variable to expand before rule command. @@ -1133,16 +1161,6 @@ sub verbose_flag ($) return ''; } -# verbose_dispatch (VAR) -# -- -# Recursive variable dispatch string. -sub verbose_dispatch ($) -{ -my ($var) = @_; -# Using `$V' instead of `$(V)' breaks IRIX make. -return '$(' . $var . '_$(V))'; -} - # silent_flag # --- # Contents of %SILENT%: variable to expand to `@' when silent. @@ -1151,40 +1169,16 @@ sub silent_flag () return verbose_flag ('at'); } -# define_verbose_var (VAR, VAL) -# - -# For `silent' mode, setup VAR and dispatcher, to expand to VAL if silent. -sub define_verbose_var ($$) -{ -my ($var, $val) = @_; -if (option 'silent') - { - define_variable ($var, verbose_dispatch ($var), INTERNAL); - define_variable ($var . '_', $val, INTERNAL); - define_variable ($var . '_0', $val, INTERNAL); - } -} - # define_verbose_tagvar (NAME) # # Engage the needed `silent' machinery for tag NAME. sub define_verbose_tagvar ($) { my ($name) = @_; -my $var = verbose_var ($name); -if (option 'silent' !vardef ($var, TRUE)) +if (option 'silent') { - Automake::Variable::define ($var, VAR_AUTOMAKE, '', TRUE, - verbose_dispatch ($var), - '', INTERNAL, VAR_ASIS); - Automake::Variable::define ($var . '_' , VAR_AUTOMAKE, '', TRUE, - '$(' . $var . '_0)', - '', INTERNAL, VAR_ASIS); - Automake::Variable::define ($var . '_0', VAR_AUTOMAKE, '', TRUE, - '@echo '. $name . ' ' x (6 - length ($name)) . ' $@;', - '', INTERNAL, VAR_ASIS); - my $silent = verbose_var ('at'); - define_verbose_var ($silent, '@'); + define_verbose_var ($name, '@echo '. $name . ' ' x (6 - length ($name)) . ' $@;'); + define_verbose_var ('at', '@'); } } @@ -1193,10 +1187,8 @@ sub define_verbose_tagvar ($) # Engage the needed `silent' machinery for `libtool --silent
Re: Make depmode=cpp work with Microsoft Visual C++ on MSYS.
* Peter Rosin wrote on Mon, Mar 09, 2009 at 09:51:14PM CET: Den 2009-03-04 00:07 skrev Ralf Wildenhues: Not a really nice fix, but I've come up with this below. Can you try it (at least the tests/dep* tests from automake, please)? depcomp.test is ok, depcomp2.test and depcomp3.test are not applicable (forces gcc) depcomp4.test fails with missing makedepend. FAIL or SKIP? It should be skipped in that case. depcomp5.test forces icc depcomp6.test works fine (choke me triggers and the exit status is 0) Good. depcomp7.test fails with no libtool. The thing bothering me most is that it won't fix things for other compilers not grokking `-c -o'. OTOH I think it is fairly safe. I also tested this by applying the same set of changes to an already generated libtool configure script (from the pr-msvc-support branch). Cool. however, I had to fix a tiny bug, see below. + am__minus_obj I'm missing an equal sign in the above line. I.e. works with: + am__minus_obj= Yep. Thanks for testing, I've pushed the patch with that fix. Cheers, Ralf
Re: [PATCH 4/4] New automake command line option `--silent-rules'.
* Ralf Wildenhues wrote on Sun, Mar 08, 2009 at 10:46:40AM CET: The current patch still has a couple of warts in that --silent-rules should turn off portability-recursive warnings independently of the command line argument order. This is another reason I don't like this addition much: it needs more special-casing and complex semantics in order to work seamlessly for users. Second bug fix of this patch. Pushed to the branch. The ugliness of the implementation has been mostly fixed now. So it's more or less a matter of: Do we want to allow a command line knob (--silent-rules) to turn off `silent' mode, or do we force developers to either touch the AUTOMAKE_OPTIONS variable in Makefile.am or the AM_INIT_AUTOMAKE macro call in configure.ac? List feedback has been mixed so far; there are good arguments on both sides. The --$flavor (cygwin|foreign|gnu|gnits) and --ignore-deps precedents tend to make me say yes on this matter, leaning ever so slightly over the edge. Thanks, Ralf `silent' mode unconditionally overrides portability-recursive. * automake.in (parse_arguments): Don't handle a global `silent' option here; instead, ... (handle_options): ... handle the normal `silent' option here. Override `portability-recursive' here, at the last point we deal with options, instead ... * lib/Automake/Options.pm (_process_option_list): ... of here. * tests/silent6.test: Replace unportable make snippet, remove FIXME note, add more test cases of options passed in the various locations. diff --git a/automake.in b/automake.in index fac2313..9ee9dfd 100755 --- a/automake.in +++ b/automake.in @@ -1214,6 +1214,10 @@ sub handle_options } } + # Override portability-recursive warning. + switch_warning ('no-portability-recursive') +if option 'silent'; + if ($strictness == GNITS) { set_option ('readme-alpha', INTERNAL); @@ -8189,10 +8193,6 @@ sub parse_arguments () $output_directory = '.'; } - # Override portability-recursive warning. - process_global_option_list ($cli_where, 'silent') -if global_option 'silent'; - return unless @ARGV; if ($ARGV[0] =~ /^-./) diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm index 3c152df..10fd00f 100644 --- a/lib/Automake/Options.pm +++ b/lib/Automake/Options.pm @@ -267,6 +267,7 @@ sub _process_option_list (\%$@) || $_ eq 'no-exeext' || $_ eq 'no-define' || $_ eq 'std-options' || $_ eq 'color-tests' +|| $_ eq 'silent' || $_ eq 'cygnus' || $_ eq 'no-dependencies') { # Explicitly recognize these. @@ -310,10 +311,6 @@ sub _process_option_list (\%$@) if switch_warning $cat; } } - elsif ($_ eq 'silent') -{ - switch_warning ('no-portability-recursive'); - } else { error ($where, option `$_' not recognized, diff --git a/tests/silent6.test b/tests/silent6.test index 2bc2f8f..103cd34 100755 --- a/tests/silent6.test +++ b/tests/silent6.test @@ -30,7 +30,7 @@ EOF cat Makefile.am 'EOF' if SILENT -my_verbose = $(my_verbose_$V) +my_verbose = $(my_verbose_$(V)) my_verbose_ = $(my_verbose_0) my_verbose_0 = @echo GEN $@; endif @@ -46,8 +46,7 @@ EOF : foo.in $ACLOCAL -# FIXME: it should not be necessary to disable Wportability here. -$AUTOMAKE --add-missing -Wno-portability --silent-rules +$AUTOMAKE --add-missing --silent-rules $AUTOCONF ./configure silent_rules=yes @@ -70,4 +69,30 @@ cat stdout grep 'GEN foo' stdout Exit 1 grep 'cp ' stdout +$MAKE distclean + +# Things should also work with -Wall in AM_INIT_AUTOMAKE. +cat configure.in 'END' +AC_INIT([silent6], [1.0]) +AM_INIT_AUTOMAKE([-Wall]) +AM_CONDITIONAL([SILENT], [:]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT +END + +$ACLOCAL +AUTOMAKE_fails --force +$AUTOMAKE --force -Wno-error +grep ' --silent-rules' Makefile.in Exit 1 +$AUTOMAKE --force --silent-rules +grep ' --silent-rules' Makefile.in +$AUTOMAKE --force -Wno-all -Wportability --silent-rules +grep ' --silent-rules' Makefile.in + +echo 'AUTOMAKE_OPTIONS = silent' Makefile.am +$AUTOMAKE --force +grep 'AM_V_GEN' Makefile.in +$AUTOMAKE --force -Wno-all -Wportability +grep 'AM_V_GEN' Makefile.in + :
Re: [PATCH 4/4] New automake command line option `--silent-rules'.
* Jan Engelhardt wrote on Wed, Mar 11, 2009 at 09:34:20PM CET: On Wednesday 2009-03-11 21:06, Ralf Wildenhues wrote: Do we want to allow a command line knob (--silent-rules) to turn off `silent' mode, or do we force developers to either touch the AUTOMAKE_OPTIONS variable in Makefile.am or the AM_INIT_AUTOMAKE macro call in configure.ac? Hm, what is the difference between silent and silent-rules? The command line option --silent-rules does the same as the argument `silent' to the AM_INIT_AUTOMAKE macro in configure.ac: AM_INIT_AUTOMAKE([silent]) Both enable silent mode for all Makefile.in files. Per-Makefile.in silent mode may be enabled by adding AUTOMAKE_OPTIONS = silent to the respective Makefile.am. The reason that the command line option is not called `--silent' is that normally, i.e., with several other GNU software, --silent is the opposite of --verbose, and changes the verbosity of the command. But --silent-rules does not change the verbosity of the automake command. Hope that clears things up. Cheers, Ralf
Re: [PATCH 4/4] New automake command line option `--silent-rules'.
* Jan Engelhardt wrote on Wed, Mar 11, 2009 at 10:55:02PM CET: On Wednesday 2009-03-11 22:43, Ralf Wildenhues wrote: The command line option --silent-rules does the same as the argument `silent' to the AM_INIT_AUTOMAKE macro in configure.ac: AM_INIT_AUTOMAKE([silent]) Both enable silent mode for all Makefile.in files. Hm that's a bit unintuitive. One can run `automake -Wall` from the command line, and one can put -Wall into AM_INIT_AUTOMAKE(). One can use --foreign as a CLI argument, and AUTOMAKE_OPTIONS=foreign (and probably AM_INIT_AUTOMAKE([foreign])). But introducing two names for silent/silent-rules, well.. ick. Agreed. The reason that the command line option is not called `--silent' is that normally, i.e., with several other GNU software, --silent is the opposite of --verbose, and changes the verbosity of the command. But --silent-rules does not change the verbosity of the automake command. Yeah I thought so. In that case, I would avoid using silent at all and consistently use silent-rules throughout. Good idea. Pushed. Thanks, Ralf Rename `silent' mode to `silent-rules' mode. * automake.in (define_verbose_var, verbose_flag) (define_verbose_tagvar, handle_options, handle_languages) (handle_configure, parse_arguments): Rename the `silent' option to `silent-rules', so it coincides with the `--silent-rules' command line option; adjust all code and comments. * lib/Automake/Options.pm (_process_option_list): Likewise. * doc/automake.texi (Invoking Automake, Libtool Flags, Options): Likewise. * NEWS: Adjust. * tests/dollarvar.test, tests/silent.test, tests/silent2.test, tests/silent3.test, tests/silent4.test, tests/silent5.test, tests/silent6.test, tests/silent7.test: Likewise. Suggestion by Jan Engelhardt. diff --git a/NEWS b/NEWS index 6975751..885abc0 100644 --- a/NEWS +++ b/NEWS @@ -109,7 +109,7 @@ New in 1.10a: - The `color-tests' option causes colored test result output on terminals. - - The `silent' option enables Linux kernel-style silent build output. + - The `silent-rules' option enables Linux kernel-style silent build output. This option requires the widely supported but non-POSIX `make' feature of recursive variable expansion, so do not use it if your package needs to build with `make' implementations that do not support it. diff --git a/automake.in b/automake.in index 9ee9dfd..cb4d1de 100755 --- a/automake.in +++ b/automake.in @@ -,11 +,11 @@ sub backname ($) -# Silent mode handling functions. +# `silent-rules' mode handling functions. # verbose_var (NAME) # -- -# The public variable stem used to implement `silent'. +# The public variable stem used to implement `silent-rules'. sub verbose_var ($) { my ($name) = @_; @@ -1124,7 +1124,7 @@ sub verbose_var ($) # verbose_private_var (NAME) # -- -# The naming policy for the private variables used to implement `silent'. +# The naming policy for the private variables for `silent-rules'. sub verbose_private_var ($) { my ($name) = @_; @@ -1133,13 +1133,13 @@ sub verbose_private_var ($) # define_verbose_var (NAME, VAL) # -- -# For `silent' mode, setup VAR and dispatcher, to expand to VAL if silent. +# For `silent-rules' mode, setup VAR and dispatcher, to expand to VAL if silent. sub define_verbose_var ($$) { my ($name, $val) = @_; my $var = verbose_var ($name); my $pvar = verbose_private_var ($name); -if (option 'silent') +if (option 'silent-rules') { # Using `$V' instead of `$(V)' breaks IRIX make. define_variable ($var, '$(' . $pvar . '_$(V))', INTERNAL); @@ -1157,7 +1157,7 @@ sub verbose_flag ($) { my ($name) = @_; return '$(' . verbose_var ($name) . ')' - if (option 'silent'); + if (option 'silent-rules'); return ''; } @@ -1171,11 +1171,11 @@ sub silent_flag () # define_verbose_tagvar (NAME) # -# Engage the needed `silent' machinery for tag NAME. +# Engage the needed `silent-rules' machinery for tag NAME. sub define_verbose_tagvar ($) { my ($name) = @_; -if (option 'silent') +if (option 'silent-rules') { define_verbose_var ($name, '@echo '. $name . ' ' x (6 - length ($name)) . ' $@;'); define_verbose_var ('at', '@'); @@ -1184,7 +1184,7 @@ sub define_verbose_tagvar ($) # define_verbose_libtool # -- -# Engage the needed `silent' machinery for `libtool --silent'. +# Engage the needed `silent-rules' machinery for `libtool --silent'. sub define_verbose_libtool () { define_verbose_var ('lt', '--silent'); @@ -1216,7 +1216,7 @@ sub handle_options # Override portability-recursive warning. switch_warning ('no-portability-recursive') -if option 'silent'; +if option 'silent-rules
Re: automake/533: DISTFILES containing a directory and files in that directory
Hi Peter, * Peter Breitenlohner wrote on Thu, Jan 29, 2009 at 05:24:55PM CET: Number: 533 Synopsis: DISTFILES containing a directory and files in that directory I tried to include a Third-Party package (automake manual 23.2) using the suggestion in the last paragraph, i.e., doing everything with a proxy Makefile.am such as: bin_PROGRAMS = prog prog_SOURCES = sub/prog.c EXTRA_DIST = sub with the result that 'make distcheck' failed. In this example the use of nodist_prog_SOURCES would of course avoid this problem, but there may be other situations where this cannot be done easily. Attached is a patch addressing this problem. Thank you for the good bug report and the proposed patch. The solution may be somewhat simple minded. Maybe the chmod has to be replaced by 'find ... || chmod ...' as is done in other places. Well, yes. The simple 'chmod -R' changes modes of files, too, which is a bad idea. Changing that to be find ... -type d -exec chmod ... is also not sufficient if you want to allow directories being listed multiple times: files being copied over by a later 'cp -pR' might not be writable, leading to errors again. Adding -f to these cp invocations should fix that. (Note that 'cp -fpR' alone without the prior 'find ... chmod' is not sufficient either). The following patch seems to handle these issues, and the testsuite addition seems to expose most of them. Now, I'm not so sure whether that is the way we want to go. Some may regard the distcheck failure as feature not a bug, it being more efficient and cleaner to not list things multiple times. OTOH, sometimes it may not be possible to avoid it; and I think it is a source of less compatibility between different Automake versions. So I'm still unsure whether to apply this patch. Cheers, Ralf 2009-03-13 Peter Breitenlohner p...@mppmu.mpg.de Ralf Wildenhues ralf.wildenh...@gmx.de For PR automake/533: DISTFILES containing a directory and files in that directory. When the source tree contains non-writable files or directories (as happens during distcheck), and directories or entries thereof are listed multiple times in variables to be distributed, then the corresponding directories below $(distdir) need to be made writable recursively. Since file modes should not change, they need to be copied recursively using `cp -f'. * lib/am/distdir.am: Handle this situation. * tests/distdir.test: Extend test to those cases. * NEWS: Update. Report by Peter Breitenlohner. diff --git a/NEWS b/NEWS index 35148ef..bf66ed8 100644 --- a/NEWS +++ b/NEWS @@ -187,6 +187,9 @@ Bugs fixed in 1.10a: - Targets provided by automake behave better with `make -n', in that they take care not to create files. + - `make distcheck' works also when both a directory and some file below it +have been added to a distribution variable, such as EXTRA_DIST or *_SOURCES. + * Bugs introduced by 1.10: - Fix output of dummy dependency files in presence of post-processed diff --git a/lib/am/distdir.am b/lib/am/distdir.am index ad5e771..4290fda 100644 --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -198,10 +198,16 @@ endif %?TOPDIR_P% ## directory exists only in $(srcdir), because some vendor Make (such ## as Tru64) will magically create an empty directory in `.' dir=`echo /$$file | sed -e 's,/[^/]*$$,,'`; \ +## If the destination directory already exists, it may contain read-only +## files, e.g., during `make distcheck'. + if test -d $(distdir)/$$file; then \ + find $(distdir)/$$file -type d ! -perm -777 -exec chmod a+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + find $(distdir)/$$file -type d ! -perm -777 -exec chmod a+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file $(distdir)$$dir || exit 1; \ else \ ## Test for file existence because sometimes a file gets included in ## DISTFILES twice. For example this happens when a single source diff --git a/tests/distdir.test b/tests/distdir.test index 641a307..dc5dfe9 100755 --- a/tests/distdir.test +++ b/tests/distdir.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1996, 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 1996, 2001, 2002, 2003, 2006, 2007, 2009 Free Software +# Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,6 +19,7 @@ # sure *srcdir is properly handled. Note that using `./', as in # EXTRA_DIST = ./joe # does not work portably: it fails with HP-UX and Tru64 make
* NEWS: Update.
Pushed to master and branch-1-10 similarly. Cheers, Ralf * NEWS: Update. diff --git a/NEWS b/NEWS index e08a0ce..00ea9cf 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,9 @@ New in 1.10.2a: + - The `gnupload' script has been revamped. + + - The `depcomp' and `compile' scripts now work with MSVC under MSYS. + Bugs fixed in 1.10.2a: * Long standing bugs: @@ -22,6 +26,12 @@ Bugs fixed in 1.10.2a: containing the error message, but exit successfully. However, `make dist' will ensure that no such bogus man pages are packaged into a tarball. + - `config.status Makefile... depfiles' works fine again in the presence of +disabled dependency tracking. + + - The default no-op recursive rules for these targets also work with BSD make +now: html, install-html, install-dvi, install-pdf, install-pdf, install-info. + * Bugs introduced by 1.10.2: - The manual wrongly contained portions of the 1.11a manual.
[PATCH 0/N] parallel tests execution in Automake
[ moving from automake@ ] [ N will be a dozen or so, apologies for the mail bombing ] * Ralf Wildenhues wrote on Sat, Mar 14, 2009 at 11:33:21AM CET: I've cleaned up the patch set for parallel tests execution in Automake, and put it in a public branch for people to poke with: git clone git://git.savannah.gnu.org/automake.git git checkout ad-parallel-tests origin/ad-parallel-tests Here we go. Patches 1-4 are taken directly from this thread: http://thread.gmane.org/gmane.comp.sysutils.automake.patches/3225 but with some of the comments from the thread addressed. First, here are the remaining issues that I listed in the first message: | 11) allow for extensibility like multiple test suites, each with their | own set of logs. | 12) allow for additional output on stdout/stderr? | example: test was skipped because of $reason. | 13) allow for post-test action in the rule (like: clean foo.dir in | Automake's test suite)? | 14) let subdir tests depend on dirstamp instead of each one calling | MKDIR_P? None of these have been addressed yet. However, (12) is easily achieved by the package author in the manner that coreutils does it right now: adding something like `92' to TESTS_ENVIRONMENT or, preferably, the per-extension test driver (see the last patch). The other issues are easily postponed (i.e., are useful TODO items, but nothing that prevents the current branch from being releasable). Cheers, Ralf
[PATCH 02] parallel-tests: Ensure backward-compatible semantics.
This patch is virtually unchanged compared to the previous version. Cheers, Ralf parallel-tests: Ensure backward-compatible semantics. For each test in Automake's test suite that uses TESTS, generate an identical one that uses the `parallel-tests' option, for coverage of backward-compatible functionality. * tests/gen-parallel-tests: New file, generates distributed Makefile.am snippet tests/parallel-tests.am to list all tests that use the TESTS interface but not yet the `parallel-tests' option, with names mangled to use suffix `-p.test', in ... (parallel_tests): ... this new make macro. * tests/Makefile.am ($(srcdir)/parallel-tests.am) ($(parallel_tests), defs-p): New rules. (TESTS): Add check11.test and $(parallel_tests). (check_SCRIPTS): Add defs-p, $(parallel_tests). (check-clean-local): Remove `defs-p'. (EXTRA_DIST): Distribute gen-parallel-tests. (MAINTAINERCLEANFILES): New variable, remove $(parallel_tests). * bootstrap: Generate parallel-tests.am. * tests/check8.test: Check for circular dependencies in rules. * tests/check11.test: New test, check that SKIPs are not counted as passed tests. * tests/defs.in: Unset DISABLE_HARD_ERRORS, LAZY_TEST_SUITE, VERBOSE, so the tests are not influenced by the way our test suite is invoked. diff --git a/bootstrap b/bootstrap index 8437d11..cb563ca 100755 --- a/bootstrap +++ b/bootstrap @@ -124,6 +124,11 @@ dosubst m4/amversion.in m4/amversion.m4 # Create temporary replacement for automake dosubst automake.in automake.tmp +# Create tests/parallel-tests.am. +cd tests +$BOOTSTRAP_SHELL ./gen-parallel-tests parallel-tests.am +cd .. + # Run the autotools. $PERL ./aclocal.tmp -I m4 autoconf diff --git a/tests/.gitignore b/tests/.gitignore index a6827fd..cfd4565 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,6 +1,9 @@ aclocal-* automake-* defs +defs-p +parallel-tests.am *.dir *.log *.log-t +*-p.test diff --git a/tests/Makefile.am b/tests/Makefile.am index 2a21be5..fbb6118 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,12 +1,27 @@ ## Process this file with automake to create Makefile.in AUTOMAKE_OPTIONS = parallel-tests -XFAIL_TESTS = \ +XFAIL_TESTS = \ all.test \ auxdir2.test \ cond17.test\ txinfo5.test +include $(srcdir)/parallel-tests.am + +$(srcdir)/parallel-tests.am: gen-parallel-tests Makefile.am + (cd $(srcdir) $(SHELL) ./gen-parallel-tests) $@ + +$(parallel_tests): $(parallel_tests:-p.test=.test) Makefile.am + input=`echo $@ | sed 's,.*/,,; s,-p.test$$,.test,'`; \ + sed 's,^\. \./defs,. ./defs-p,' $(srcdir)/$$input $@ + chmod a+rx $@ + +MAINTAINERCLEANFILES = $(parallel_tests) + +defs-p: defs Makefile.am + sed 's,^AM_INIT_AUTOMAKE$$,([parallel-tests]),' defs $@ + TESTS =\ aclibobj.test \ aclocal.test \ @@ -98,6 +113,7 @@ check7.test \ check8.test \ check9.test \ check10.test \ +check11.test \ checkall.test \ clean.test \ clean2.test \ @@ -676,15 +692,16 @@ yacc6.test \ yacc7.test \ yacc8.test \ yaccpp.test \ -yaccvpath.test +yaccvpath.test \ +$(parallel_tests) -EXTRA_DIST = ChangeLog-old $(TESTS) +EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS) # Each test case depends on defs, aclocal, and automake. -check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION) +check_SCRIPTS = defs defs-p aclocal-$(APIVERSION) automake-$(APIVERSION) $(parallel_tests) clean-local: check-clean-local check-clean-local: -chmod -R u+rwx *.dir - -rm -rf *.dir + -rm -rf defs-p *.dir diff --git a/tests/check11.test b/tests/check11.test new file mode 100755 index 000..2ee1145 --- /dev/null +++ b/tests/check11.test @@ -0,0 +1,53 @@ +#! /bin/sh +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. + +# Check skip summary. + +. ./defs || Exit 1 + +set -e + +cat configure.in 'END' +AC_OUTPUT +END + +cat Makefile.am 'END' +TESTS = skip skip2 +END + +cat skip 'END' +#! /bin/sh +exit 77 +END +chmod a+x skip +cp skip skip2 + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +unset TESTS || : + +./configure +env TESTS=skip $MAKE -e check stdout +cat stdout +grep
[PATCH 03] New tests for `parallel-tests'.
Compared to http://article.gmane.org/gmane.comp.sysutils.automake.patches/3228, This patch has - LAZY_TEST_SUITE testing is moved to a later patch in the series. - DISABLE_HARD_ERRORS adjusted to Benoit's semantics, - tests/*-p.test listed in MAINTAINERCLEANFILES. Cheers, Ralf New tests for `parallel-tests'. * tests/parallel-tests.test: New file, to expose a bunch of features of `parallel-tests': VERBOSE, clean, TEST_SUITE_LOG, test dependencies, DISABLE_HARD_ERRORS. * tests/parallel-tests2.test: New file, test check-html. * tests/parallel-tests3.test: New file, test concurrency. * tests/parallel-tests4.test: New file, test suffix rules. * tests/parallel-tests5.test: New file, demonstrate compile/test concurrency. * tests/defs.in: Add a `required' check for rst2html. * tests/Makefile.am: Update. Signed-off-by: Ralf Wildenhues ralf.wildenh...@gmx.de diff --git a/ChangeLog b/ChangeLog index 265a261..61be223 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2009-03-08 Ralf Wildenhues ralf.wildenh...@gmx.de + New tests for `parallel-tests'. + * tests/parallel-tests.test: New file, to expose a bunch of + features of `parallel-tests': VERBOSE, clean, TEST_SUITE_LOG, + test dependencies, DISABLE_HARD_ERRORS. + * tests/parallel-tests2.test: New file, test check-html. + * tests/parallel-tests3.test: New file, test concurrency. + * tests/parallel-tests4.test: New file, test suffix rules. + * tests/parallel-tests5.test: New file, demonstrate compile/test + concurrency. + * tests/defs.in: Add a `required' check for rst2html. + * tests/Makefile.am: Update. + parallel-tests: Ensure backward-compatible semantics. For each test in Automake's test suite that uses TESTS, generate an identical one that uses the `parallel-tests' option, for diff --git a/tests/Makefile.am b/tests/Makefile.am index fbb6118..2504941 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -480,6 +480,11 @@ overrid.test \ parallel-am.test \ parallel-am2.test \ parallel-am3.test \ +parallel-tests.test \ +parallel-tests2.test \ +parallel-tests3.test \ +parallel-tests4.test \ +parallel-tests5.test \ parse.test \ percent.test \ percent2.test \ diff --git a/tests/defs.in b/tests/defs.in index 8a08998..3b8fe96 100644 --- a/tests/defs.in +++ b/tests/defs.in @@ -186,6 +186,16 @@ do rm -rf $ro_dir_temp test $create_status = 0 exit 77 ;; +rst2html) + # Try the variants that are tried in check.am. + while :; do + for r2h in $RST2HTML rst2html rst2html.py; do + echo $me: running $r2h --version + $r2h --version break 2 + done + exit 77 + done + ;; runtest) # DejaGnu's runtest program. We rely on being able to specify # the program on the runtest command-line. This requires diff --git a/tests/parallel-tests.test b/tests/parallel-tests.test new file mode 100755 index 000..6e4b878 --- /dev/null +++ b/tests/parallel-tests.test @@ -0,0 +1,108 @@ +#! /bin/sh +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. + +# Check parallel-tests features: +# - VERBOSE +# - clean +# - TEST_SUITE_LOG +# - dependencies between tests +# - DISABLE_HARD_ERRORS + +. ./defs-p || Exit 1 + +set -e + +cat configure.in 'END' +AC_OUTPUT +END + +cat Makefile.am 'END' +TEST_SUITE_LOG = mylog.log +TESTS = foo.test bar.test baz.test +XFAIL_TESTS = bar.test +foo.log: bar.log +bar.log: baz.log +END + +cat foo.test 'END' +#! /bin/sh +echo this is $0 +exit 0 +END +cat bar.test 'END' +#! /bin/sh +echo this is $0 +exit 99 +END +cat baz.test 'END' +#! /bin/sh +echo this is $0 +exit 1 +END +chmod a+x foo.test bar.test baz.test + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +unset TESTS || : + +./configure +# No hard errors: all tests should be run, there should be one failure. +env DISABLE_HARD_ERRORS=yes $MAKE -e check stdout { cat stdout; Exit 1; } +cat stdout +test `grep -c '^FAIL' stdout` -eq 1 +test -f mylog.log +test `grep -c '^FAIL' mylog.log` -eq 1 +test -f baz.log +test -f bar.log +test -f foo.log + +# clean should remove all log files (but not more). +: unrelated.log +$MAKE clean +test ! -f baz.log +test ! -f bar.log +test ! -f foo.log +test ! -f mylog.log +test -f unrelated.log + +$MAKE clean +$MAKE
Re: [PATCH 04] Documentation for the parallel-tests driver.
Compared to http://article.gmane.org/gmane.comp.sysutils.automake.patches/3229 this patch has - docs adjusted to DISABLE_HARD_ERRORS changes and TEST_EXTENSIONS renaming, - VERBOSE change of semantics: hint user to produce verbose tests by default, as suggested by Akim. Cheers, Ralf Documentation for the parallel-tests driver. * doc/automake.texi (Tests, Options): Document the `parallel-tests' option, including new features of the test driver. * NEWS: Update. diff --git a/NEWS b/NEWS index d4b59e9..306755d 100644 --- a/NEWS +++ b/NEWS @@ -109,6 +109,11 @@ New in 1.10a: - The `color-tests' option causes colored test result output on terminals. + - The `parallel-tests' option enables a new test driver that allows for +parallel test execution, and formatted result output as RST +(reStructuredText) and HTML. Enabling this option may require some +changes to your test suite setup; see the manual for details. + - New prefix `notrans_' for manpages which should not be transformed by --program-transform. diff --git a/doc/automake.texi b/doc/automake.texi index 0dfa9c7..7a0bfdf 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -8294,7 +8294,8 @@ default, only the @code{dist-gzip} target is hooked to @code{dist}. @cindex @code{make check} @trindex check -Automake supports two forms of test suites. +Automake supports three forms of test suites, the first two of which +are very similar. @section Simple Tests @@ -8330,7 +8331,7 @@ terminal with @samp{AM_COLOR_TESTS=always}. @vindex TESTS @vindex TESTS_ENVIRONMENT The variable @code{TESTS_ENVIRONMENT} can be used to set environment -variables for the test run; the environment variable @code{srcdir} is +variables for the test run; the environment variable @env{srcdir} is set in the rule. If all your test programs are scripts, you can also set @code{TESTS_ENVIRONMENT} to an invocation of the shell (e.g. @samp{$(SHELL) -x} can be useful for debugging the tests), or any other @@ -8367,6 +8368,115 @@ that @code{check_PROGRAMS} are @emph{not} automatically added to by the tests, not the tests themselves. Of course you can set @code{TESTS = $(check_PROGRAMS)} if all your programs are test cases. + +...@section Simple tests using @samp{parallel-tests} +...@cindex @option{parallel-tests}, Using +The option @option{parallel-tests} (@pxref{Options}) enables a test +suite driver that is mostly compatible to the simple test driver +described above, but provides a few more features and slightly different +semantics. It features concurrent execution of tests with @code{make -j}, +allows to specify inter-test dependencies, lazy reruns of tests that +have not completed in a prior run, summary and verbose output in +...@samp{rst} (reStructuredText) and @samp{HTML} format, and hard errors +for exceptional failures. Similar to the simple test driver, +...@code{tests_environment}, @code{AM_COLOR_TESTS}, @code{XFAIL_TESTS}, and +the @code{check_*} variables are honored, and the environment variable +...@env{srcdir} is set during test execution. + +...@vindex TEST_SUITE_LOG +...@vindex TEST_LOGS +The driver operates by defining a set of @command{make} rules to create +a summary log file, @code{TEST_SUITE_LOG}, which defaults to +...@file{test-suite.log} and requires a @file{.log} suffix. This file +depends upon log files created for each single test program listed in +...@code{tests}, which in turn contain all output produced by the +corresponding tests. + +...@vindex TEST_EXTENSIONS +Each log file is created when the corresponding test has completed. +The set of log files is listed in the read-only variable +...@code{test_logs}, and defaults to @code{TESTS}, with the executable +extension if any (@pxref{EXEEXT}), as well as any suffix listed in +...@code{test_extensions} removed, and @file{.log} appended. +...@code{test_extensions} defaults to @file{.test}. Results are undefined +if a test file name ends in several concatenated suffixes. + +...@vindex VERBOSE +As with the simple driver above, by default one status line is printed +per completed test, and a short summary after the suite has completed. +However, standard output and standard error of the test are redirected +to a per-test log file, so that parallel execution does not produce +intermingled output. The output from failed tests is collected in the +...@file{test-suite.log} file. If the variable @samp{VERBOSE} is set, this +file is output after the summary. For best results, the tests should be +verbose by default now. + +...@trindex mostlyclean +...@trindex check-html +...@vindex RST2HTML +...@vindex TEST_SUITE_HTML +With @code{make check-html}, the log files may be converted from RST +(reStructuredText, see @uref{http://docutils.sourceforge.net/@/rst.html}) +to HTML using @samp{RST2HTML}, which defaults to @command{rst2html} or +...@command{rst2html.py}. The variable @samp{TEST_SUITE_HTML} contains the +set of converted log files.
Re: [PATCH 05] Overhaul of tests/README.
Overhaul of tests/README. * tests/README: General overhaul. Mention parallel test suite execution, the test-suite.log file; document `Exit' vs. `exit', `defs' vs. `defs-p', the naming of `parallel-tests' tests. * README: Simplify, point to tests/README. diff --git a/README b/README index bb42a7f..0e23237 100644 --- a/README +++ b/README @@ -24,13 +24,7 @@ Automake has a test suite. Use make check to run it. Capture its output in case of failing tests. For more -information, you can influence testing with the variables VERBOSE, -MAKE, TESTS, keep_testdirs. So for example, to run tests/check.test -verbosely using gmake and to inspect the test directory afterwards, -enter the tests directory and use - - env VERBOSE=yes TESTS=check.test keep_testdirs=yes MAKE=gmake \ - gmake -e check +information, please see the file tests/README. Automake has a page on the web. See: diff --git a/tests/README b/tests/README index 4b63059..c4ff407 100644 --- a/tests/README +++ b/tests/README @@ -10,6 +10,9 @@ Running all tests make check + You can use `-jN' for faster completion (it even helps on a + uniprocessor system, due to unavoidable sleep delays, as + noted below). Interpretation -- @@ -30,10 +33,13 @@ Getting details from failures - Each test is a script. In a non-VPATH build you can run them - directly, they will be verbose. + directly, they will be verbose. By default, verbose output of + a test foo.test is retained in the log file foo.log. A summary + log is created in the file test-suite.log. - Otherwise, you can invoke make as follows, just replace the list - of tests by those you want to check. + You can limit the set of files using the TESTS variable, and + enable detailed test output at the end of the test run with the + VERBOSE variable: env VERBOSE=x TESTS='first.test second.test ...' make -e check @@ -41,10 +47,10 @@ Getting details from failures Reporting failures -- - Send verbose output of failing tests to bug-autom...@gnu.org, - along with the usual version numbers (which Automake, which - Autoconf, which operating system, which make version, which shell, - etc.) + Send verbose output, i.e., the contents of test-suite.log, of failing + tests to bug-autom...@gnu.org, along with the usual version numbers + (which Automake, which Autoconf, which operating system, which make + version, which shell, etc.) @@ -68,7 +74,10 @@ Do Use `required=...' for required tools. - Include ./defs (see other tests). + Include ./defs (see other tests) for normal tests, ./defs-p for tests + that use the `parallel-tests' option. For the latter, use a name that + ends in `-p.test' and does not clash with any generated tests in the + suite. Use `set -e' to catch failures you might not have thought of. @@ -87,11 +96,16 @@ Do Use `cat' or `grep' to display (part of) files that may be interesting for debugging, so that when a user send a verbose - output we don't have to ask him for more details. + output we don't have to ask him for more details. Display stderr + output on the stderr file descriptor. If some redirected command + is likely to fail, and `set -e' is in effect, display its output + even in the failure case, before exiting. + + Use `Exit' rather than `exit' to abort a test. It's more important to make sure that a feature works, than make sure that Automake's output looks correct. It might look - correct and still fails to work. In other words, prefer + correct and still fail to work. In other words, prefer running `make' over grepping `Makefile.in' (or do both). If you run $AUTOMAKE or $AUTOCONF several times in the same test @@ -99,6 +113,7 @@ Do rm -rf autom4te.cache before the following runs. On fast machines the new `configure.in' could otherwise have the same timestamp as the old `autom4te.cache'. + Alternatively, use `--force' for subsequent runs of the tools. Use filenames with two consecutive spaces when testing that some code preserves filenames with spaces. This will catch errors like @@ -112,7 +127,7 @@ Do Do not -- - Do not test an Automake error with `$AUTOMAKE exit 1', or in three + Do not test an Automake error with `$AUTOMAKE Exit 1', or in three years we'll discover that this test failed for some other bogus reason. This happened many times. Better use something like AUTOMAKE_fails
[PATCH 07] Use append mode to capture parallel test output.
D'oh. Wonder how often we will keep encountering this. Cheers, Ralf Use append mode to capture parallel test output. * tests/lisp8.test: Use append mode for output from `make -j', to avoid dropped lines. * tests/parallel-tests3.test: Likewise. diff --git a/tests/lisp8.test b/tests/lisp8.test index 578cd9c..3e4981c 100755 --- a/tests/lisp8.test +++ b/tests/lisp8.test @@ -39,7 +39,8 @@ $AUTOCONF $AUTOMAKE --add-missing ./configure -$MAKE -j stdout || { cat stdout; Exit 1; } +: stdout +$MAKE -j stdout || { cat stdout; Exit 1; } cat stdout test 1 -eq `grep 'Warnings can be ignored' stdout | wc -l` @@ -51,7 +52,8 @@ test -f elc-stamp rm -f am-*.elc -$MAKE -j stdout +: stdout +$MAKE -j stdout cat stdout test 1 -eq `grep 'Warnings can be ignored' stdout | wc -l` diff --git a/tests/parallel-tests3.test b/tests/parallel-tests3.test index c53edee..362f369 100755 --- a/tests/parallel-tests3.test +++ b/tests/parallel-tests3.test @@ -61,7 +61,10 @@ cd serial $MAKE -j1 check cd ../parallel $sleep -$MAKE -j4 check stdout +# Use append mode here to avoid dropping output. +# Yes, this actually happens. +: stdout +$MAKE -j4 check stdout cd .. kill $! cat parallel/stdout
[PATCH 08] Match XFAIL_TESTS correctly with Solaris make.
Without this patch, Solaris make did not match any XFAIL_TESTS in a VPATH setup. Cheers, Ralf Match XFAIL_TESTS correctly with Solaris make. * lib/am/check.am [PARALLEL_TESTS]: VPATH rewriting may have changed test names, so srcdir needs to be taken into account explicitly when checking against the list of tests expected to fail. Fixes spurious FAILures from XFAIL_TESTS. diff --git a/lib/am/check.am b/lib/am/check.am index c01a25a..dab0dc8 100644 --- a/lib/am/check.am +++ b/lib/am/check.am @@ -121,11 +121,10 @@ fi; \ TERM=$$__SAVED_TERM; export TERM; \ $(am__tty_colors); \ xfailed=PASS; \ -for xfail in : $(XFAIL_TESTS); do \ - case $$f in \ -$$xfail | $(srcdir)/$$xfail) xfailed=XFAIL; break; \ - esac;\ -done; \ +case $(XFAIL_TESTS) in \ + *[\ \]$$f[\ \]* | *[\ \ ]$$dir$$f[\ \ ]*) \ +xfailed=XFAIL;;\ +esac; \ case $$estatus:$$xfailed in\ 0:XFAIL) col=$$red; res=XPASS;;\ 0:*) col=$$grn; res=PASS ;;\
[PATCH 10] Fix parallel-tests with empty $(TESTS) for BSD make.
TESTS= TEST_LOGS=$(TESTS:=.log) would otherwise barf with an error that the file `.log' could not be remade. Since this file name also looks like a single suffix rule, there is no way to portably write a rule to ignore it. So in this case we have to overwrite TESTS. Cheers, Ralf Fix parallel-tests with empty $(TESTS) for BSD make. * lib/am/check.am [PARALLEL_TESTS] ($(TEST_SUITE_LOG)): Ignore empty line stemming from empty $(TEST_LOGS), to avoid counting zero tests as one. (check-TESTS): If `$(TESTS)' is empty, override TEST_LOGS to be empty, rather than `.log', for BSD make. * tests/parallel-tests6.test: New test. * tests/Makefile.am: Update. diff --git a/lib/am/check.am b/lib/am/check.am index 9a3c256..5a2de7d 100644 --- a/lib/am/check.am +++ b/lib/am/check.am @@ -145,7 +145,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) results=`for f in $$list; do\ read line $$f echo $$line || echo FAIL; \ done`; \ - all=`echo $$results | wc -l | sed -e 's/^[ ]*//'`;\ + all=`echo $$results | sed '/^$$/d' | wc -l | sed -e 's/^[ ]*//'`; \ fail=`echo $$results | grep -c '^FAIL'`; \ pass=`echo $$results | grep -c '^PASS'`; \ skip=`echo $$results | grep -c '^SKIP'`; \ @@ -223,7 +223,10 @@ check-TESTS: test -n $(TEST_SUITE_LOG)$(TEST_LOGS); then\ rm -f $(TEST_SUITE_LOG) $(TEST_LOGS); \ fi - @$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) + @set_logs=; if test X$(TEST_LOGS) = X.log; then \ + set_logs=TEST_LOGS=; \ + fi; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) $$set_logs .MAKE: check-TESTS diff --git a/tests/Makefile.am b/tests/Makefile.am index 2504941..e0b7f23 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -485,6 +485,7 @@ parallel-tests2.test \ parallel-tests3.test \ parallel-tests4.test \ parallel-tests5.test \ +parallel-tests6.test \ parse.test \ percent.test \ percent2.test \ diff --git a/tests/parallel-tests6.test b/tests/parallel-tests6.test new file mode 100755 index 000..59a0b0e --- /dev/null +++ b/tests/parallel-tests6.test @@ -0,0 +1,43 @@ +#! /bin/sh +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. + +# Check parallel-tests features: +# - empty TESTS +# BSD make will expand `$(TESTS:=.log)' to `.log' unless overridden. + +. ./defs-p || Exit 1 +set -e + +cat configure.in 'END' +AC_OUTPUT +END + +cat Makefile.am 'END' +TESTS = +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +unset TESTS || : + +./configure +$MAKE check stdout || { cat stdout; Exit 1; } +cat stdout +grep '0 tests' stdout + +Exit 0
Re: [PATCH 11] Fix LAZY_TEST_SUITE handling and $(TEST_SUITE_LOG) recreation.
Oh, what a joyful patch; cost me most brains. Here's why: It would have been cool if make check LAZY_TEST_SUITE=yes on an up to date test directory would have no work to do at all. Well. Couple of things wrong with the prior semantics: - there would be no summary output on stdout in that case; - the exit status of `make' would not reflect the fact whether any of the tests failed. I'd consider that a bug. Here's another, more involved reason: I wanted to get fancy and let lazy test runs report how many tests were lazily run. $? should have been a good help. However, if the $(TEST_SUITE_LOG) rule isn't run at all, then see above: no summary. If a prior test run was limited to a subset of tests by make check TESTS=sub.test set.test then by virtue of fast completion the next test run could happen with same timestamps, not uncommon with lazy runs, and so the summary would again be bogus or non-present. Marking $(TEST_SUITE_LOG) as .PHONY would solve some of the problems, but .PHONY is not portable enough. I am not sure whether some arbitrary additional bogus FORCE prerequisite would be completely sufficient, but at this point I was ready to give up. So now, the test-suite.log is always recreated, even in lazy mode, and the summary is always output, and the `make check' exit status is correct. Cheers, Ralf Fix LAZY_TEST_SUITE handling and $(TEST_SUITE_LOG) recreation. * lib/am/check.am (check-TESTS): Expand `$(TEST_LOGS)' only once in the rule command, for systems with low command line limits. Remove $(TEST_SUITE_LOG) even in LAZY_TEST_SUITE mode. ($(TEST_SUITE_LOG)): Always recreate $(TEST_SUITE_LOG). Mention lazy mode in the summary output. * tests/parallel-tests.test: Test LAZY_TEST_SUITE semantics. diff --git a/lib/am/check.am b/lib/am/check.am index 5a2de7d..fcb9add 100644 --- a/lib/am/check.am +++ b/lib/am/check.am @@ -184,23 +184,26 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) msg=$$msg($$skip tests were not run). ; \ fi; \ fi; \ + { \ + echo $(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG) | \ + $(am__rst_title); \ + echo $$msg; \ + echo; \ + echo .. contents:: :depth: 2; \ + echo; \ + for f in $$list; do \ + read line $$f;\ + case $$line in \ + SKIP:*|PASS:*|XFAIL:*);; \ + *) echo; cat $$f;;\ + esac; \ + done; \ + } $(TEST_SUITE_LOG).tmp; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if test -n '$(LAZY_TEST_SUITE)'; then \ + msg=$${msg}(tests were rerun lazily). ;\ + fi; \ if test $$failures -ne 0; then\ - { \ - echo $(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG) | \ - $(am__rst_title); \ - echo $$msg; \ - echo; \ - echo .. contents:: :depth: 2; \ - echo; \ - for f in $$list; do \ - read line $$f; \ - case $$line in\ - SKIP:*|PASS:*|XFAIL:*);;\ - *) echo; cat $$f;; \ - esac; \ - done; \ - } $(TEST_SUITE_LOG).tmp; \ - mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ msg=$${msg}See $(subdir)/$(TEST_SUITE_LOG). ; \ if test -n $(PACKAGE_BUGREPORT); then \
proposed patch: parallel-tests: also record logs of SKIPped tests.
This is a patch that I don't know whether I want it or not. Package authors may be interested in SKIPs and why they happen, or not. (Could also be solved with leaving the choice to the package author and/or user, by some TEST_RECORD_SKIPS variable or so). Comments appreciated. Thanks, Ralf parallel-tests: also record logs of SKIPped tests. * lib/am/check.am [PARALLEL_TESTS] ($(TEST_SUITE_LOG)): Record SKIPs as well. diff --git a/lib/am/check.am b/lib/am/check.am index fcb9add..14df1e5 100644 --- a/lib/am/check.am +++ b/lib/am/check.am @@ -194,7 +194,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) for f in $$list; do \ read line $$f;\ case $$line in \ - SKIP:*|PASS:*|XFAIL:*);; \ + PASS:*|XFAIL:*);; \ *) echo; cat $$f;;\ esac; \ done; \
proposed patch: parallel-tests: per-extension test driver: ext_COMPILE.
This needs some thinking about the naming scheme to use. Here's why: The current Automake default compile naming scheme has the assumption that file extensions have only one default processing output. For example, .c and .cpp become .$(OBJEXT), .y become .c, and so on. Texinfo is an exception, but an ugly one in that it requires an exceptional amount of additional support code inside automake. Understandably, I would like to keep new namings as much in line with existing ones as possible. However, for test suite drivers, it is entirely reasonable if they provide additional _alternative_ default processing. For example, you could have a driver that processes all your .cxx files and extracts and runs unit test from them. But of course, your .cxx files are also regularly compiled to binary objects, using CXXCOMPILE. Corollary: the test driver may not be called CXXCOMPILE. General: For extension `.ext', we cannot use `EXTCOMPILE' as driver. ext_COMPILE or extCOMPILE seem awkward to me too, as these do not allow for generalization either, and the notational difference would be unintuitive (or even dangerous, think of preprocessed Fortran with .F extension). What else comes to mind? EXTTESTCOMPILE EXT_TESTCOMPILE EXT_TEST_COMPILE EXTLOGCOMPILE EXT_LOGCOMPILE EXT_LOG_COMPILE And then, there is the question: should the *_COMPILE var be something like *_COMPILE = $(TESTS_ENVIRONMENT) $(*C) $(AM_*CFLAGS) $(*CFLAGS) (with '*' suitably replaced as above) and the *C variable take place of the test driver? Thanks, Ralf parallel-tests: per-extension test driver: ext_COMPILE. Turn also the lib/Automake/tests testsuite over to the new test driver. * doc/automake.texi (Tests): Document `ext_COMPILE'. * lib/am/check2.am: Insert `%COMPILE%' right before test. * automake.in (handle_tests): Substitute `COMPILE' for check2, empty for tests without extension, and `$(ext_COMPILE)' for extension `ext'. * configure.ac (AM_INIT_AUTOMAKE): Use `parallel-test' globally. * tests/Makefile.am (AUTOMAKE_OPTIONS): Remove, not needed here any more. * lib/Automake/tests/Makefile.am (TESTS_ENVIRONMENT): Rename to (pl_COMPILE): ... this, as this is a true test driver now. (TESTS_EXTENSIONS): New variable, initialize to `.pl'. * tests/parallel-tests7.test: New test. * tests/Makefile.am: Update. Suggestion by Akim Demaille. diff --git a/automake.in b/automake.in index 2ab266d..12999da 100755 --- a/automake.in +++ b/automake.in @@ -4801,6 +4801,7 @@ sub handle_tests GENERIC = 0, OBJ = $obj, SOURCE = $val, + COMPILE = '', EXT = ''); return $obj; }); @@ -4825,10 +4826,13 @@ sub handle_tests $post = '.log'; $prev = $cur; $nhelper++; + (my $ext = $test_suffix) =~ s/^\.//; + my $compile = '$(' . $ext . '_COMPILE)'; $output_rules .= file_contents ('check2', new Automake::Location, GENERIC = 1, OBJ = '', SOURCE = '$', + COMPILE = $compile, EXT = $test_suffix) if $test_suffix ne $at_exeext $test_suffix ne ''; } diff --git a/configure.ac b/configure.ac index 7073d6a..d7bf2fa 100644 --- a/configure.ac +++ b/configure.ac @@ -29,7 +29,7 @@ AC_CANONICAL_BUILD AC_SUBST([am_AUTOCONF], [${AUTOCONF-autoconf}]) AC_SUBST([am_AUTOHEADER], [${AUTOHEADER-autoheader}]) -AM_INIT_AUTOMAKE([1.10a dist-bzip2 filename-length-max=99 color-tests]) +AM_INIT_AUTOMAKE([1.10a dist-bzip2 filename-length-max=99 color-tests parallel-tests]) # The API version is the base version. We must guarantee # compatibility for all releases with the same API version. diff --git a/doc/automake.texi b/doc/automake.texi index 7a0bfdf..f36e2e7 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -8401,6 +8401,25 @@ extension if any (@pxref{EXEEXT}), as well as any suffix listed in @code{TEST_EXTENSIONS} defaults to @file{.test}. Results are undefined if a test file name ends in several concatenated suffixes. +...@vindex _COMPILE +For tests that match an extension @cod...@var{ext}} listed in +...@code{test_extensions}, you can provide a test driver using the variable +...@code{@var{ext}_COMPILE}. It will cause all tests with this extension +to be called with this driver. For example, + +...@example +TESTS = foo.pl bar.py +TEST_EXTENSIONS = .pl .py +pl_COMPILE = $(PERL) +py_COMPILE = $(PYTHON) +...@end example + +...@noindent +will invoke @samp{$(PERL) foo.pl} and @samp{$(PYTHON)
Re: [PATCH 07] Use append mode to capture parallel test output.
* Akim Demaille wrote on Sat, Mar 14, 2009 at 01:24:28PM CET: Le 14 mars 09 à 11:56, Ralf Wildenhues a écrit : D'oh. Wonder how often we will keep encountering this. I have not understood what's going on here. Are these files running concurrently in the same pwd? No. The issue is different. Whenever you have $program file and $program itself spawns other processes which inherit the file descriptor to 'file', and write to it concurrently, then POSIX does not guarantee that those writes are atomic. More specifically, while it guarantees that all writes happen, there may be a time at which one of the processes has already written, but not updated the file offset. When another process then starts a write, it will happen at the old offset, and overwrite the output from the first process. Using O_APPEND avoids this race: POSIX guarantees atomicity in this case, for writes below (depending on the file type, there may be a limit on the maximum number of bytes guaranteed to be written atomically). An alternative to O_APPEND is to use a pipe: make -j | cat file works just as well. Or a named pipe, I guess. This issue really shows up in practice, but is probably very hard to reproduce on systems with only one processor (I've never seen that). Hope that helps. Cheers, Ralf Use append mode to capture parallel test output. * tests/lisp8.test: Use append mode for output from `make -j', to avoid dropped lines. * tests/parallel-tests3.test: Likewise. diff --git a/tests/lisp8.test b/tests/lisp8.test index 578cd9c..3e4981c 100755 --- a/tests/lisp8.test +++ b/tests/lisp8.test @@ -39,7 +39,8 @@ $AUTOCONF $AUTOMAKE --add-missing ./configure -$MAKE -j stdout || { cat stdout; Exit 1; } +: stdout +$MAKE -j stdout || { cat stdout; Exit 1; } cat stdout test 1 -eq `grep 'Warnings can be ignored' stdout | wc -l` @@ -51,7 +52,8 @@ test -f elc-stamp rm -f am-*.elc -$MAKE -j stdout +: stdout +$MAKE -j stdout
Do not create conditional installation directories
Hello, I have a patch to let 'make install' not create installation directories in which no files will end up. This half-fixes a long-standing TODO item; so far, one had to work around this with conditionals and hacks in order to achieve it. However, there is a downside: this patch does not fix the TODO item for the 'installdirs' target (yet). Do you still think it's worthwhile to have, and ok if we leave installdirs to be fixed in a later version? Thanks Akim for reminding me of this issue, Ralf Do not create conditional installation directories. TODO: doc If primaries are defined conditionally only, do not create their target directory if no files are going to be installed there. This fixes the `install' target but not the `installdirs' one. * lib/am/data.am (install-%DIR%%PRIMARY%): Rewrite to only create the installation directory if we have files to install. * lib/am/libs.am (install-%DIR%LIBRARIES): Likewise. * lib/am/ltlib.am (install-%DIR%LTLIBRARIES): Likewise. * lib/am/mans.am (install-man%SECTION%): Likewise. * lib/am/progs.am (install-%DIR%PROGRAMS): Likewise. * lib/am/python.am (install-%DIR%PYTHON): Likewise. * lib/am/scripts.am (install-%DIR%SCRIPTS): Likewise. * TODO: One item half down. * tests/instspc.test: Adjust: install doesn't fail any more with single quote. Tests from within the makefile are not effective in finding out that '$' is expanded, so also test for directory existence from the shell script. * tests/condinst.test: New test. * tests/condinst-ltlib.test: New test. * tests/Makefile.am: Adjust. * NEWS: Update. diff --git a/NEWS b/NEWS index 8c6445b..3d1837e 100644 --- a/NEWS +++ b/NEWS @@ -102,6 +102,10 @@ New in 1.10a: counterpart, depending on the type of files and the need for automatic target directory creation. + - Upon `make install', installation directories are not created any more +for targets which are defined only conditionally and commented out. +However, the `installdirs' rule still creates them. + - The deleted header file problem for *.m4 files is avoided by stub rules. This allows `make' to trigger a rerun of `aclocal' also if some previously needed macro file has been removed. diff --git a/TODO b/TODO index 3a1e907..9a9e3cf 100644 --- a/TODO +++ b/TODO @@ -1,8 +1,5 @@ -We should arrange so that install-%DIR%%PRIMARY% is run conditionally -when %DIR%_%PRIMARY% is defined conditionally. Currently it is always -run, and that will therefore always create %DIR% (unless %DIR%dir is -also defined conditionally). Likewise, installdirs should not -create %DIR% in conditions were no %DIR%_%PRIMARY% is enabled. +install-%DIR%%PRIMARY% does not create %DIR% when %DIR%_%PRIMARY% is +defined conditionally. installdirs should not either. check should depend on all from ben elliston diff --git a/lib/am/data.am b/lib/am/data.am index 62383fa..1995ef7 100644 --- a/lib/am/data.am +++ b/lib/am/data.am @@ -28,7 +28,6 @@ am__installdirs += $(DESTDIR)$(%NDIR%dir) .PHONY install-%EXEC?exec:data%-am: install-%DIR%%PRIMARY% install-%DIR%%PRIMARY%: $(%DIR%_%PRIMARY%) @$(NORMAL_INSTALL) - test -z $(%NDIR%dir) || $(MKDIR_P) $(DESTDIR)$(%NDIR%dir) if %?BASE% ## Funny invocation because Makefile variable can be empty, leading to ## a syntax error in sh. @@ -40,10 +39,12 @@ if %?BASE% ## new dir variable or use a nobase_ target for the latter case. echo $$d$$p; \ done | $(am__base_list) | \ - while read files; do \ + { first=:; while read files; do $$first { first=false; \ + echo $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'; \ + $(MKDIR_P) $(DESTDIR)$(%NDIR%dir) || exit $$?; } || :; \ echo $(INSTALL_%ONE_PRIMARY%) $$files '$(DESTDIR)$(%NDIR%dir)'; \ $(INSTALL_%ONE_PRIMARY%) $$files $(DESTDIR)$(%NDIR%dir) || exit $$?; \ - done + done; } else !%?BASE% @list='$(%DIR%_%PRIMARY%)'; $(am__nobase_list) | \ while read dir files; do \ @@ -51,9 +52,8 @@ else !%?BASE% if test -f $$file; then xfiles=$$xfiles $$file; \ else xfiles=$$xfiles $(srcdir)/$$file; fi; done; \ test -z $$xfiles || { \ - test x$$dir = x. || { \ - echo $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'; \ - $(MKDIR_P) $(DESTDIR)$(%NDIR%dir)/$$dir; }; \ + echo $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'; \ + $(MKDIR_P) $(DESTDIR)$(%NDIR%dir)/$$dir || exit $$?; \ echo $(INSTALL_%ONE_PRIMARY%) $$xfiles '$(DESTDIR)$(%NDIR%dir)/$$dir'; \ $(INSTALL_%ONE_PRIMARY%) $$xfiles $(DESTDIR)$(%NDIR%dir)/$$dir || exit $$?; }; \ done diff --git a/lib/am/libs.am b/lib/am/libs.am index ee0061e..192fe28 100644 --- a/lib/am/libs.am +++ b/lib/am/libs.am @@ -28,7 +28,6 @@ am__installdirs += $(DESTDIR)$(%NDIR%dir) .PHONY install-%EXEC?exec:data%-am: install-%DIR%LIBRARIES
Re: --silent-rules: status?
Hi Jim, * Jim Meyering wrote on Wed, Mar 18, 2009 at 08:24:40AM CET: I am using your new --silent-rules option (from the je-silent branch) in coreutils, albeit only privately for now. I would like to make it permanent/public, and noticed that this is not yet on next. It should be, though: $ git log origin/next..origin/je-silent turns up empty for me, and my private je-silent branch doesn't have anything else staged either. Do you need more testimonials? Anything I can do to help? No, I'm fairly confident about this one now. But thanks, feedback like this already helps being yet a bit more confident. The only issue with this topic that is still open is the one I've described in this message: http://thread.gmane.org/gmane.comp.sysutils.automake.general/10313/focus=3408 If you have any good suggestions about it, I'm all ears. As to the ad-parallel-tests branch, I still need to go through Akim's set of replies, and update it accordingly. Thanks, Ralf
Re: proposed patch: parallel-tests: also record logs of SKIPped tests.
Hi Jim, * Jim Meyering wrote on Sat, Mar 14, 2009 at 12:07:15PM CET: Ralf Wildenhues wrote: This is a patch that I don't know whether I want it or not. Package authors may be interested in SKIPs and why they happen, or not. (Could also be solved with leaving the choice to the package author and/or user, by some TEST_RECORD_SKIPS variable or so). Comments appreciated. Yes, please. Once I taught coreutils' make check to tell why a test is skipped, I discovered a few that should not have been skipped. Seeing a summary (and remembering the numbers) might help too. Yes, I agree. The thing is, though, that there may be an abundance of SKIPs; all of which are hopefully not very interesting. For example, the Automake testsuite itself can easily skip a good part of its tests when on an unusual host (that in itself is probably a bad thing, but that's for another thread ...). The question is whether there should be a toggle to enable or disable logging SKIPs, or they should always be logged, and if a toggle, what color that bikeshed^Wtoggle should have. I take that back. User API questions are never really bike shedding. Thanks, Ralf parallel-tests: also record logs of SKIPped tests. * lib/am/check.am [PARALLEL_TESTS] ($(TEST_SUITE_LOG)): Record SKIPs as well.
Re: Do not create conditional installation directories
* Ralf Corsepius wrote on Thu, Mar 19, 2009 at 03:01:45PM CET: Ralf Wildenhues wrote: * Akim Demaille wrote on Wed, Mar 18, 2009 at 06:31:50PM CET: RW == Ralf Wildenhues ralf.wildenh...@gmx.de writes: But the question remains: how do you think we should address the bug that bothers Akim, other than by this patch and a big warning in NEWS? My focus was more about an empty $(foodir), not an empty $(foo_DATA). Can you describe situations where an empty $(foodir) happens? The classic use case are packages which use a directory but not put any files into it. We are still talking past each other. AFAIU, Akim is talking about cases where the `make' macro `foodir' is initialized to be the empty string. You are talking about a use case where the macro `foodir' is set properly but `foo_DATA' is empty. Of course my last reply on this issue was confused, too: it would never happen that things are installed in '/' by mistake, only in $(DESTDIR) if that happens to be nonempty. An empty destination directory variable causes different things with 1.10.2 and 1.11a, with the latter either causing an error from the `install' program, or, if exactly 2 files are to be installed, overwriting a file in the source or build tree. I agree that both of these outcomes are a bad thing. I'll fix this issue. Cheers, and thanks for being so patient with me, Ralf
Re: [PATCH 11] Fix LAZY_TEST_SUITE handling and $(TEST_SUITE_LOG) recreation.
Hi Akim, thanks for working through this with me! * Akim Demaille wrote on Sat, Mar 14, 2009 at 01:39:07PM CET: For the records, here is the version I use currently, some of bugs you mentioned being fixed. Thanks. I am applying this improvement: Cheers, Ralf Minor optimization in parallel-tests text box creation. * lib/am/check.am [PARALLEL-TESTS] (am__text_box): Use only one awk invocation, rather than several tools, to create a text box. Suggestion from Akim Demaille. diff --git a/lib/am/check.am b/lib/am/check.am index 14df1e5..28af2ee 100644 --- a/lib/am/check.am +++ b/lib/am/check.am @@ -75,13 +75,15 @@ am__rst_title = sed 's/.*/ /;h;s/./=/g;p;x;p;g;p;s/.*//' am__rst_section = sed 'p;s/./=/g;p;g' # Put stdin (possibly several lines separated by . ) in a box. -am__text_box = { nlinit=`echo 'nl='; echo ''`; eval $$nlinit; \ - sed s/\\. /\\$$nl/g; } | sed '/^$$/d' | \ -$(AWK) '{ if (final) final = final \n $$0; else final = $$0; }\ -max length($$0) { max = length($$0); } \ -END { \ - for (i = 0; i max; ++i) line = line =; \ - print line; print final; print line; \ +am__text_box = $(AWK) '{ \ + n = split($$0, lines, \\. ); max = 0; \ + for (i = 1; i = n; ++i) \ +if (max length(lines[i]))\ + max = length(lines[i]); \ + for (i = 0; i max; ++i) line = line =; \ + print line; \ + for (i = 1; i = n; ++i) if (lines[i]) print lines[i];\ + print line; \ }' # Solaris 10 'make', and several other traditional 'make' implementations,
SunOS4 compatibility (was: automake/533: DISTFILES containing a directory and files in that directory)
[ adding automake@; this is http://thread.gmane.org/gmane.comp.sysutils.automake.patches/3439 ] * Ralf Wildenhues wrote on Sun, Mar 22, 2009 at 10:17:06AM CET: --- a/lib/am/distdir.am +++ b/lib/am/distdir.am @@ -202,10 +202,16 @@ endif %?TOPDIR_P% ## directory exists only in $(srcdir), because some vendor Make (such ## as Tru64) will magically create an empty directory in `.' dir=`echo /$$file | sed -e 's,/[^/]*$$,,'`; \ +## If the destination directory already exists, it may contain read-only +## files, e.g., during `make distcheck'. + if test -d $(distdir)/$$file; then \ + find $(distdir)/$$file -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + find $(distdir)/$$file -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file $(distdir)$$dir || exit 1; \ else \ Oh brother. According to autoconf.info, SunOS4 'cp' did not support the -f option. Anyone think we still need 'make dist' to work there? Does anyone have access to such a system any more? http://en.wikipedia.org/wiki/SunOS states it is from 1988. Thanks, Ralf
Re: How to use compiler wrappers
Hello John, * John R. Cary wrote on Mon, Mar 23, 2009 at 08:02:43PM CET: But on another note, I was using b0201.bassi$ automake --version automake (GNU automake) 1.10.2 and it seems that --tag showed up for f77 code, but not for f90 (--tag=FC). Thanks for mentioning that. It looks like a bug in Automake. I'm applying this patch to fix it, and putting you in automake/THANKS. Cheers, Ralf Use --tag=FC with libtool also for .f90 files. * automake.in: Set 'libtool_tag' for language `fc'. * tests/fort5.test: Grep for the tag. * THANKS: Update. Report by John R. Cary. diff --git a/automake.in b/automake.in index 9367a08..c1321f0 100755 --- a/automake.in +++ b/automake.in @@ -920,6 +920,7 @@ register_language ('name' = 'fc', 'compiler' = 'FCCOMPILE', 'compile_flag' = '-c', 'output_flag' = '-o', + 'libtool_tag' = 'FC', 'lder' = 'FCLD', 'ld' = '$(FC)', 'pure' = 1, diff --git a/tests/fort5.test b/tests/fort5.test index d39bb21..4390711 100755 --- a/tests/fort5.test +++ b/tests/fort5.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2006, 2009 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -84,6 +84,9 @@ $AUTOCONF # skip in this case: grep LT_PREREQ configure Exit 77 +# Ensure we use --tag for f90, too. +grep --tag=FC Makefile.in + # configure may Exit 77 if no compiler is found, # or if the compiler cannot compile Fortran 90 files). ./configure