platform/upstream/automake.git
11 years agoMerge branch 'prog-cc-c-o-work' into maint
Stefano Lattarini [Sun, 26 May 2013 11:30:52 +0000 (13:30 +0200)]
Merge branch 'prog-cc-c-o-work' into maint

* prog-cc-c-o-work:
  tests: some tests make no sense if "$CC -c -o" doesn't work
  AM_PROG_CC_C_O: don't rely on AC_PROG_CC_C_O, re-implement similar logic
  compile: rewrite AC_PROG_CC with AM_PROG_CC_C_O contents

11 years agom4: rename minuso.m4 -> prog-cc-c-o.m4
Stefano Lattarini [Sun, 26 May 2013 10:52:07 +0000 (12:52 +0200)]
m4: rename minuso.m4 -> prog-cc-c-o.m4

The new name is much clearer.

* m4/minuso.m4: Rename ...
* m4/prog-cc-c-o.m4: ... like this.
* m4/Makefile.in (dist_automake_DATA): Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoMerge branch 'micro' into maint
Stefano Lattarini [Sun, 26 May 2013 10:04:48 +0000 (12:04 +0200)]
Merge branch 'micro' into maint

* micro:
  tests: avoid a couple of extra sleep with GNU make
  NEWS: document testsuite work for 1.13.3
  lint: remove a couple of obsolete syntax checks
  lint: cosmetics: use #-comments, not ##-comments
  lint: cosmetics: some reordering
  lint: recipes of syntax check require GNU grep; ensure it is used
  lint: better name for a syntax check
  tests: rename $am_make_rc_got -> $am_make_rc
  tests: ensure $required is not set too late

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: avoid a couple of extra sleep with GNU make
Stefano Lattarini [Sun, 26 May 2013 09:35:15 +0000 (11:35 +0200)]
tests: avoid a couple of extra sleep with GNU make

They are only required by BSD make in order to avoid spurious failures.

* t/deleted-am.sh: Here.
* t/parallel-tests-recheck-pr11791.sh: And here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoNEWS: document testsuite work for 1.13.3
Stefano Lattarini [Sun, 26 May 2013 09:23:29 +0000 (11:23 +0200)]
NEWS: document testsuite work for 1.13.3

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agolint: remove a couple of obsolete syntax checks
Stefano Lattarini [Sat, 25 May 2013 20:50:20 +0000 (22:50 +0200)]
lint: remove a couple of obsolete syntax checks

* syntax-checks.mk (sc_obsolete_requirements_rules): Remove
definition of this variable.
(modern-requirement.texi2dvi-o): Likewise.
(modern-requirement.makeinfo-html): Likewise.
($(sc_obsolete_requirements_rules)): Remove these obsolete
syntax checks.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agolint: cosmetics: use #-comments, not ##-comments
Stefano Lattarini [Sat, 25 May 2013 20:22:55 +0000 (22:22 +0200)]
lint: cosmetics: use #-comments, not ##-comments

* syntax-checks.mk: Here.  This makes sense because this file is
not meant to be processed by Automake, so the ##-comments are not
treated specially.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agolint: cosmetics: some reordering
Stefano Lattarini [Sat, 25 May 2013 20:20:44 +0000 (22:20 +0200)]
lint: cosmetics: some reordering

* syntax-checks.mk: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agolint: recipes of syntax check require GNU grep; ensure it is used
Stefano Lattarini [Sat, 25 May 2013 20:18:45 +0000 (22:18 +0200)]
lint: recipes of syntax check require GNU grep; ensure it is used

* syntax-checks.mk (sc_sanity_gnu_grep): New.
($(syntax_check_rules)): Depend on it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agolint: better name for a syntax check
Stefano Lattarini [Sat, 25 May 2013 19:36:35 +0000 (21:36 +0200)]
lint: better name for a syntax check

* syntax-checks.mk (sc_tests_make_without_am_makeflags): Rename ...
(sc_make_without_am_makeflags): ... like this.
(syntax_check_rules): Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: rename $am_make_rc_got -> $am_make_rc
Stefano Lattarini [Fri, 24 May 2013 18:54:41 +0000 (20:54 +0200)]
tests: rename $am_make_rc_got -> $am_make_rc

The latter is more natural  More importantly, I keep misspelling
the former over and over.

* t/ax/am-test-lib.sh (run_make): Update.
* t/ax/tap-summary-aux.sh: Adjust.
* t/ax/testsuite-summary-checks.sh: Likewise.
* t/parallel-tests-exit-statuses.sh: Likewise.
* t/parallel-tests-extra-programs.sh: Likewise.
* t/parallel-tests-fd-redirect-exeext.sh: Likewise.
* t/parallel-tests-fd-redirect.sh: Likewise.
* t/parallel-tests-fork-bomb.sh: Likewise.
* t/parallel-tests-no-spurious-summary.sh: Likewise.
* t/parallel-tests-recheck-pr11791.sh: Likewise.
* t/parallel-tests-reset-term.sh: Likewise.
* t/tap-signal.tap: Likewise.
* t/test-driver-acsubst.sh: Likewise.
* t/test-driver-cond.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: some tests make no sense if "$CC -c -o" doesn't work
Stefano Lattarini [Wed, 15 May 2013 13:48:08 +0000 (15:48 +0200)]
tests: some tests make no sense if "$CC -c -o" doesn't work

So just skip them, to avoid spurious failures when running
"make check-no-cc-c-o".

* t/ax/am-test-lib.sh (require_tool): New requirement '-c-o'.
* t/subobj10.sh ($required): Add it.
* gen-testsuite-part (%depmodes): Adjust so that tests that
use 'makedepend' will be skipped if the compiler is being
forced not to grasp "-c -o".

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoAM_PROG_CC_C_O: don't rely on AC_PROG_CC_C_O, re-implement similar logic
Stefano Lattarini [Wed, 15 May 2013 08:14:46 +0000 (10:14 +0200)]
AM_PROG_CC_C_O: don't rely on AC_PROG_CC_C_O, re-implement similar logic

** Theoretical problems of AC_PROG_CC_C_O:

  Both cc and $CC are checked to see if they support the '-c' and '-o'
  options together.
  This behaviour is highly inconsistent with that of the other macros
  related to C compiler checks -- which test only $CC.
  It can also cause unwarranted uses of the 'compile' script on systems
  where the default 'cc' is inferior, but the user is compiling with a
  proper, different compiler (e.g., gcc).

** Practical problems with our previous implementation of C support m4
   macros in Automake:

  - AM_PROG_AR must now be called *before* AC_PROG_CC; this wasn't the
    case before, and it turns out there are packages in the wild that
    relied on the old behaviour.

  - The cross-referenced requirements and macro rewrites juggled among
    AC_PROG_CC, AC_PROG_CC_C_O and AM_PROG_CC_C_O caused warnings in
    autoconf; for example, in our test 't/libobj3.sh', we could see
    warnings like these (here slightly tweaked for legibility):

        configure.ac:5: AC_REQUIRE: `AC_PROG_CC' expanded before required
        autoconf/c.m4:567: AC_PROG_CC_C_O is expanded from...
        autoconf/c.m4:429: AC_LANG_COMPILER(C) is expanded from...
        autoconf/lang.m4:329: AC_LANG_COMPILER_REQUIRE is expanded from...
        autoconf/general.m4:2606: AC_COMPILE_IFELSE is expanded from...
        m4sugar/m4sh.m4:639: AS_IF is expanded from...
        autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
        autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
        aclocal.m4:70: AM_PROG_AR is expanded from...
        configure.ac:5: the top level

** Fix all of that:

We fix all of the described issues with a new internal m4 macro
_AM_PROG_CC_C_O (inspired to, but not based on, AC_PROG_CC_C_O) that
gets tacked on to AC_PROG_CC automatically (this is done in the
Automake-generated aclocal.m4) and that takes care of checking and
adjusting '$CC' for "-c -o" support.

The macro AM_PROG_CC_C_O is still present, but is now just a thin
wrapper around such Automake-enhanced AC_PROG_CC.

It is worth noting that the present patch causes three slight
*backward-incompatibilities*:

  1. The name cache variable used by AM_PROG_CC_C_O is no longer
     computed (at configure runtime!) from the content of '$CC',
     but is statically defined as 'am_cv_prog_cc_c_o'.

  2. 'cc' is no longer checked by AM_PROG_CC_C_O, only '$CC' is.

  3. AM_PROG_CC_C_O no longer AC_DEFINE the C preprocessor symbol
     'NO_MINUS_C_MINUS_O'.

Given however that the third change can easily be worked around, that
the first two changes can be legitimately seen as bug fixes, and that
the new semantics introduced by such changes will simplify the transition
to Automake 2.0 (when the 'subdir-objects' will always be enabled
unconditionally), we believe they are acceptable to be shipped with
Automake 1.14.

With this patch, we also revert some of the testsuite adjustments done
in previous commit v1.13.2-178-g9877109 of 2013-05-24 (compile: rewrite
AC_PROG_CC with AM_PROG_CC_C_O contents).  Such adjustments are no longer
needed.

* m4/minuso.m4 (_AM_PROG_CC_C_O): New internal macro, basically and
adjusted version of a merge between Autoconf-provided AC_PROG_CC_C_O
and our old implementation of AM_PROG_CC_C_O.
(AM_PROG_CC_C_O): Redefine as a simple wrapper around AC_PROG_CC.
* m4/init.m4 (AC_PROG_CC): Append _AM_PROG_CC_C_O, not AM_PROG_CC_C_O,
to the pre-existing expansion of this macro.
* m4/ar-lib.m4 (AM_PROG_AR): No longer require it to be expanded after
AC_PROG_CC.
* t/aclocal-deps.sh: Move AC_PROG_CC invocation after AC_PROG_RANLIB
and AM_PROG_AR invocations.  Things should work this way too (as they
used to).
* t/subobj-clean-lt-pr10697.sh: Likewise.
* t/alloca.sh: Move AC_PROG_CC invocation after AM_PROG_AR invocation.
* t/condlib.sh: Likewise.
* t/aclocal-deps.sh: Move AC_PROG_CC invocation after LT_INIT and
AM_PROG_AR invocations.  Make autoconf and autoheader warnings fatal.
* t/am-prog-cc-c-o.sh: Adjust to the new semantics, enhance a  little,
and reduce code duplication.
* t/ccnoco.sh: Make autoconf warnings fatal.
* t/subpkg.sh: Likewise.
* t/ccnoco-lib.sh: Likewise, and fix a comment.
* t/link_cond.sh: Enhance a couple of error messages.
* configure.ac: Drop "nullification" of AM_PROG_CC_C_O.
* NEWS: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agocompile: rewrite AC_PROG_CC with AM_PROG_CC_C_O contents
Stefano Lattarini [Tue, 14 May 2013 14:08:32 +0000 (16:08 +0200)]
compile: rewrite AC_PROG_CC with AM_PROG_CC_C_O contents

This is a much simpler rewrite than the one we attempted in the past,
and that was later removed by commit 'v1.13.1d-137-g32eb770' of
2013-05-11 (compile: avoid AC_PROG_CC messy rewrite).

Not only this change simplifies the code a little, but has the welcome
collateral effect of making automatic dependency tracking work better
with compilers that doesn't grasp the '-c' and '-o' options together.
Issues in that setup have been caught by several failures in the target
'check-no-cc-c-o'.

Unfortunately, this change has less welcome collateral effects:

  1. AM_PROG_AR must now be called *after* AC_PROG_CC;

  2. Autoconf emits extra warnings when used with Automake-generated
     aclocal.m4.

These are unacceptable regressions for a release, but since we are
going to fix them soon enough in a follow-up patch (surely to be
applied before Automake 1.14 is released) we don't worry too much.

* m4/init.m4: Redefine AC_PROG_CC early, to automatically invoke
AM_PROG_CC_C_O as well.  Accordingly, drop now-unneeded "automagical"
AM_PROG_CC_C_O expansion at later time (which took place thanks to
a AC_CONFIG_COMMANDS_PRE call).
* m4/minuso.m4 (AM_PROG_CC_C_O): Ensure the expansion of the body
of this macro takes place with C as "current Autoconf language" (use
AC_LANG_PUSH/AC_LANG_POP).
* m4/ar-lib.m4 (AM_PROG_AR): Likewise.  Also, require this macro to
be expanded *after* AC_PROG_CC (so that any rewrite of $CC, if required,
has already taken place).
* t/add-missing.tap: Adjust to avoid spurious failures.
* t/aclocal-deps.sh: Likewise, by having AM_PROG_AR called *after*
AC_PROG_CC.
* t/subobj-clean-lt-pr10697.sh: Likewise.
* t/alloca.sh: Likewise.
* t/condlib.sh: Likewise.
* t/discover.sh: Likewise.
* t/objc-megademo.sh: Likewise.
* t/ccnoco.sh: Extend a little.
* t/ccnoco-deps.sh: New test.
* t/ccnoco-lib.sh: Likewise.
* t/ccnoco-lt.sh: Likewise.
* t/list-of-tests.mk: Add them.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: ensure $required is not set too late
Stefano Lattarini [Fri, 24 May 2013 10:46:17 +0000 (12:46 +0200)]
tests: ensure $required is not set too late

And do so in a safer way, with a runtime check rather than a brittle
static maintainer check.

* t/ax/test-init.sh: Set the 'required' variable to readonly.
* syntax-checks.mk (sc_tests_required_after_defs): Remove.
(syntax_check_rules): No longer list it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoMerge branch 'micro' into maint
Stefano Lattarini [Fri, 24 May 2013 10:17:59 +0000 (12:17 +0200)]
Merge branch 'micro' into maint

* micro:
  tests: use append mode to capture parallel make output
  tests: new convenience target 'check-parallel'

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: use append mode to capture parallel make output
Stefano Lattarini [Thu, 23 May 2013 23:13:40 +0000 (01:13 +0200)]
tests: use append mode to capture parallel make output

This will allow us to run the Automake testsuite forcing all the make
invocations in the test cases to run in parallel mode [1], but without
hitting the spurious failure reported in automake bug#11413.

See also:
<http://lists.gnu.org/archive/html/bug-make/2013-05/msg00135.html>

The make invocations in the test cases can be forced to run in parallel
mode by, e.g., invoking "make check" like this:

      make check AM_TESTSUITE_MAKE="make -j16"

The possible spurious failures hinted above are due to the fact that
the redirected output of parallel make can racily lose lines.  For
example, if GNU make (3.82) is run with -j10 on a Makefile like this:

    all = 0 1 2 3 4 5 6 7 8 9
    default: $(all)
    $(all):
            @sleep 0.$$(($RANDOM % 10)); echo $@

and has its standard output redirected in overwrite-mode to a regular
file, it looses a line of that output every 15 runs or so on a Fedora
17 system with 64 ppc64 cores.  Redirection in append mode does not
suffer of this problem, as explained here:
<http://lists.gnu.org/archive/html/automake-patches/2009-03/msg00073.html>

See also previous commits v1.12-63-g45c1fcd of 2012-05-05 (tests: use
append mode to capture parallel make output) and Release-1-10-280-g6426999
of 2009-03-10 (Use append mode to capture parallel test output).

* t/ax/am-test-lib.sh (run_make): Adjust and enhance.
* t/lisp8.sh: Take advantage of the enhancement, nd stop doing output
redirection for $MAKE by hand.
* t/tap-more.sh: Likewise.
* t/parallel-tests-concurrency.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: new convenience target 'check-parallel'
Stefano Lattarini [Thu, 23 May 2013 22:44:59 +0000 (00:44 +0200)]
tests: new convenience target 'check-parallel'

To force the test scripts to invoke make in parallel mode.  This should
enhance coverage of use cases (make concurrency) that are becoming more
and more important with today multicore fast machines.

* Makefile.am (check-parallel): New .PHONY target.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: avoid few lingering $MAKE redirections
Stefano Lattarini [Thu, 23 May 2013 18:48:03 +0000 (20:48 +0200)]
tests: avoid few lingering $MAKE redirections

These were present in the 'maint' branch, but not in the 'micro' branch.
Their occurrences has been found by the 'sc_tests_no_run_make_redirect'
maintainer check.

* t/fort2.sh: Adjust.
* t/preproc-demo.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoMerge branch 'micro' into maint
Stefano Lattarini [Thu, 23 May 2013 18:12:17 +0000 (20:12 +0200)]
Merge branch 'micro' into maint

* micro:
  tests: avoid '$MAKE' redirections, use 'run_make' instead
  tests: avoid use of redirected 'run_make' invocations
  lint: warn against redirected 'run_make' invocations
  comments: next GNU make release 4.0, not 3.83
  tests: fix a potential spurious failure due to global config.site
  HACKING: it's OK to do testsuite refactoring in a micro version

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: avoid '$MAKE' redirections, use 'run_make' instead
Stefano Lattarini [Thu, 23 May 2013 10:10:18 +0000 (12:10 +0200)]
tests: avoid '$MAKE' redirections, use 'run_make' instead

The use 'run_make' with  the -E, -O and -M option, it is more
idiomatic now.  Also, this way, centralized fixes and improvements
done in 'run_make' will automatically propagate through most of
the testsuite.

* syntax-checks.mk (sc_tests_no_run_make_redirect): Also check against
'$MAKE' invocations that uses output redirections (and not only against
'run_make' invocation that do so).
* Several tests: Adjust (and few minor cosmetic changes as well, while
at it).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: avoid use of redirected 'run_make' invocations
Stefano Lattarini [Wed, 22 May 2013 21:29:47 +0000 (23:29 +0200)]
tests: avoid use of redirected 'run_make' invocations

Instead, properly use the -E, -O, or -M options of run_make.
The occurrences of the 'run_make' invocations using output
redirection has been found by the recently-introduced maintainer
check 'sc_tests_no_run_make_redirect'.

* t/ax/tap-summary-aux.sh: Adjust.
* t/ax/testsuite-summary-checks.sh: Likewise.
* Several other tests: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agolint: warn against redirected 'run_make' invocations
Stefano Lattarini [Wed, 22 May 2013 20:34:12 +0000 (22:34 +0200)]
lint: warn against redirected 'run_make' invocations

The testsuite shell function 'run_make()' has the three options
-E, -O and -M to perform the various kind of output redirections,
so the test scripts should use them instead of redirecting the
output "by hand":

    run_make ARGS >stdout           =>  run_make -O ARGS
    run_make ARGS >stderr           =>  run_make -E ARGS
    run_make ARGS >stdout 2>stderr  =>  run_make -O -E ARGS
    run_make ARGS >output 2>&1      =>  run_make -M ARGS

See the commit message of v1.13.2-13-gc7cfa09, 2013-05-22
(tests: run_make: options to do command redirection) for an
explanation of why this is a good idea.

It's worth noting that the present patch only introduced a new
static maintainer check looking against the undesired idioms,
but doesn't yet remove usages of such idioms from the testsuite.
That will be done by follow-up patch(es).

* syntax-checks.mk (sc_tests_no_run_make_redirect): New check.
(syntax_check_rules): List it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agocomments: next GNU make release 4.0, not 3.83
Stefano Lattarini [Wed, 22 May 2013 21:42:09 +0000 (23:42 +0200)]
comments: next GNU make release 4.0, not 3.83

See: <http://lists.gnu.org/archive/html/bug-make/2013-05/msg00093.html>

* lib/am/header-vars.am (am__make_running_with_option): Adjust
comments.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: fix a potential spurious failure due to global config.site
Stefano Lattarini [Wed, 22 May 2013 18:39:59 +0000 (20:39 +0200)]
tests: fix a potential spurious failure due to global config.site

* t/instdir-no-empty.sh: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoHACKING: it's OK to do testsuite refactoring in a micro version
Stefano Lattarini [Wed, 22 May 2013 18:13:41 +0000 (20:13 +0200)]
HACKING: it's OK to do testsuite refactoring in a micro version

Reported-by: Peter Rosin <peda@lysator.liu.se>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoMerge branch 'micro' into maint
Stefano Lattarini [Wed, 22 May 2013 13:59:06 +0000 (15:59 +0200)]
Merge branch 'micro' into maint

* micro:
  tests: remove some code duplication
  cosmetics: remove a couple of extra whitespaces in tests
  tests: two minor fixups

11 years agotests: remove some code duplication
Stefano Lattarini [Wed, 22 May 2013 11:00:48 +0000 (13:00 +0200)]
tests: remove some code duplication

* t/ax/am-test-lib (null_install): New function.
* t/instdir-java.sh: Use it instead of copied & pasted code.
* t/instdir-lisp.sh: Likewise.
* t/instdir-ltlib.sh: Likewise.
* t/instdir-prog.sh: Likewise.
* t/instdir-python.sh: Likewise.
* t/instdir-texi.sh: Likewise.
* t/instdir.sh: Likewise.
* t/instdir2.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agocosmetics: remove a couple of extra whitespaces in tests
Stefano Lattarini [Wed, 22 May 2013 09:09:39 +0000 (11:09 +0200)]
cosmetics: remove a couple of extra whitespaces in tests

* t/instdir.sh: Here.
* t/instdir2.sh: And here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: two minor fixups
Stefano Lattarini [Wed, 22 May 2013 08:56:07 +0000 (10:56 +0200)]
tests: two minor fixups

* t/make-keepgoing.tap: Here.
* t/parallel-tests-exit-statuses.sh: And here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoMerge branch 'micro' into maint
Stefano Lattarini [Tue, 21 May 2013 22:09:30 +0000 (00:09 +0200)]
Merge branch 'micro' into maint

* micro:
  tests: run_make: options to do command redirection
  tests: only activate 'unset' alias if required
  tests: better idiom to override make macro defs on the cmdline
  test-lib: minor style changes
  test-lib: fix botched function name in an error message

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: run_make: options to do command redirection
Stefano Lattarini [Tue, 21 May 2013 18:22:17 +0000 (20:22 +0200)]
tests: run_make: options to do command redirection

Let's improve the API of the 'run_make()' helper shell function by
adding three new options:

  -O   Save the standard output from make on disk, in a regular file
       named 'stdout'.

  -E   Save the standard error from make on disk, in a regular file
       named 'stderr'.

  -M   Save both the standard output and standard error from make on
       disk, in a regular file named 'output'. This option supersedes
       both the '-O' and '-E' options.

This new API has two main advantages.

  1. Its use will allow us to get rid of more cumbersome idioms
     like, e.g.,

       $MAKE check >stdout && { cat stdout; exit 1; }
       cat stdout

     That can now be substituted with a simpler one:

       run_make -e FAIL -O check

  2. More importantly, using the new API we will prevent any extra output
     from the shell traces of the code in run_make to be redirected along
     with the make stderr (where that was redirected).  This problem was
     present in usages like, e.g.,

       run_make TESTS=foo.test check 2>stderr && exit 1
       grep 'expected error message' stderr

     Such usages are now to be rewritten as follows:

       run_make -e FAIL -E TESTS=foo.test check
       grep 'expected error message' stderr

     ensuring that 'stderr' won't end up containing unrelated stuff.

Note that we do not convert in bulk the old idioms and the use of
redirected 'run_make' invocations with this patch.  We only convert
some occurrences, to ensure that the new implementation of 'run_make'
is sound enough.  More sweeping conversions will likely be done in
follow-up patches.

* t/ax/am-test-lib.sh (run_make): Enhance and implement the extended API.
* t/tap-xfail-tests.sh: Use the new 'run_make' API.
* t/test-driver-cond.sh: Likewise.
* t/tests-environment-fd-redirect.sh: Likewise.
* t/uninstall-fail.sh: Likewise.
* t/yacc-dist-nobuild.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: only activate 'unset' alias if required
Stefano Lattarini [Tue, 21 May 2013 09:59:21 +0000 (11:59 +0200)]
tests: only activate 'unset' alias if required

This makes the test logs easier to read for most shells (which do not
actually require that alias).  This is especially important now that
'unset' is used in the new 'run_make()' function, and that function is
likely going to be used more and more in the future.

* t/ax/test-lib.sh (_am_unset, unset): Only define this function and
alias if "unset VAR" returns a non-zero exit status when VAR is already
unset.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: better idiom to override make macro defs on the cmdline
Stefano Lattarini [Mon, 20 May 2013 09:23:01 +0000 (11:23 +0200)]
tests: better idiom to override make macro defs on the cmdline

We now do so with a new wrapper shell function 'run_make()', which
relies on the use of AM_MAKEFLAGS, avoiding the use of the '-e' make
option.  The use of that option (that causes the environment variables
to take precedence over the macro definitions in the Makefile) has
proved to be quite brittle in the past, causing annoying and sometimes
problematic spurious failures.  This has worsened in some still
unpublished work going on in development branches.  It's time to solve
the issue once and for all.

Note that we do not convert all uses of $MAKE in the testsuite right
away; we might do so in follow-up changes, with leisure, to avoid a
"patch bomb" effect (this commit is already too much of a bomb itself).
What we do in this commit is to get rid of all "$MAKE -e" invocations.

We admit that the implementation and feature-set of 'run_make()' are
far from perfect, but good enough for our current purposes.  We'll
improve 'run_make()' if and when the need arises.

* syntax-checks.mk (sc_tests_no_make_e): New syntax check, guard against
the use of "$MAKE -e".
(syntax_check_rules): Add it.
(sc_tests_overriding_macros_on_cmdline): Adjust.
(lint): New, alias for 'maintainer-check', for lazy typists.  Idea
backported from the 'maint' branch (Automake 1.13a).
* t/ax/am-test-lib.sh (run_make): New function.  Run $MAKE with the
given command-line arguments, handling command-line override of variable
definitions in a smart way (using AM_MAKEFLAGS if a non-GNU make
implementation is detected to be in use).
(useless_vpath_rebuild): Adjust to use 'run_make', to avoid a spurious
maintainer check failure.
(yl_distcheck): Use 'run_make' rather than bare '$MAKE'.
(single_quote, append_single_quoted, is_valid_varname): New auxiliary
function, used, directly or indirectly, by it.
* Many tests: Adjust to avoid the use of "$MAKE -e", and prefer the
use of 'run_make' in few other contexts as well, where it makes sense.
Other minor fixlets while at it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotest-lib: minor style changes
Stefano Lattarini [Mon, 20 May 2013 13:17:11 +0000 (15:17 +0200)]
test-lib: minor style changes

* t/ax/am-test-lib.sh (require_tool): Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotest-lib: fix botched function name in an error message
Stefano Lattarini [Mon, 20 May 2013 13:07:48 +0000 (15:07 +0200)]
test-lib: fix botched function name in an error message

* t/ax/am-test-lib.sh (useless_vpath_rebuild): Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoMerge branch 'micro' into maint
Stefano Lattarini [Mon, 20 May 2013 08:58:43 +0000 (10:58 +0200)]
Merge branch 'micro' into maint

* micro:
  maintcheck: minor tweaks and fixlets

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agomaintcheck: minor tweaks and fixlets
Stefano Lattarini [Mon, 20 May 2013 08:53:11 +0000 (10:53 +0200)]
maintcheck: minor tweaks and fixlets

* syntax-checks.mk: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: fix a spurious failure on NetBSD 5.1
Stefano Lattarini [Sun, 19 May 2013 20:10:23 +0000 (22:10 +0200)]
tests: fix a spurious failure on NetBSD 5.1

* t/dist-shar.sh ($required): Also require the 'unshar' program.
Apparently, NetBSD has a 'shar' program but not the corresponding
'unshar' one.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotexi: build version.texi and stamp-vti in srcdir
Stefano Lattarini [Sun, 19 May 2013 14:48:19 +0000 (16:48 +0200)]
texi: build version.texi and stamp-vti in srcdir

Do so even when the 'info-in-builddir' option is present, or when
the corresponding '*.info' files are listed in $(CLEANFILES) or in
$(DISTCLEANFILES).

This fixes failures in the following tests, when they are run with
$MAKE pointing to FreeBSD make:

    - txinfo-nodist-info.sh
    - txinfo23.sh
    - txinfo24.sh
    - txinfo28.sh
    - txinfo25.sh

BTW, notice that the test 'txinfo-builddir.sh' fails with FreeBSD make
as well, but that is due to a known FreeBSD make VPATH issue (the same
described in automake bug#7884).  But that is not a regression, since
the 'info-in-builddir' option will be new in Automake 1.14.  Moreover,
we already warn in the manual that the use of that option can indeed
cause problems with VPATH builds done by non-GNU make.

* bin/automake.in (handle_texinfo_helper): New local variable
'$soutdir'.  Use it instead of '$outdir' where appropriate (in
particular, in the transform used on file 'texi-vers.am'.
* t/txinfo-builddir.sh: Adjust to avoid spurious failures.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: fix a botched heading comment
Stefano Lattarini [Sun, 19 May 2013 10:24:48 +0000 (12:24 +0200)]
tests: fix a botched heading comment

* t/parallel-tests-recheck-pr11791.sh: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: fix another spurious with FreeBSD make
Stefano Lattarini [Sun, 19 May 2013 10:22:22 +0000 (12:22 +0200)]
tests: fix another spurious with FreeBSD make

* t/parallel-tests-recheck-pr11791.sh: Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: fix a spurious failure with FreeBSD make
Stefano Lattarini [Sat, 18 May 2013 22:09:30 +0000 (00:09 +0200)]
tests: fix a spurious failure with FreeBSD make

Failures due to known VPATH support issues in that make implementation
(the same issues that have been causing the long-standing bug#7884).

* t/lex-multiple.sh: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoMerge branch 'micro' into maint
Stefano Lattarini [Sat, 18 May 2013 13:23:20 +0000 (15:23 +0200)]
Merge branch 'micro' into maint

* micro:
  lisp: fix a failure with Solaris /usr/xpg4/bin/sh
  tests: sanitize 'unset' usages
  tests: fix some botched/outdated comments
  tests: use perl, not find+rm, to remove temporary directories

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agolisp: fix a failure with Solaris /usr/xpg4/bin/sh
Stefano Lattarini [Sat, 18 May 2013 11:35:16 +0000 (13:35 +0200)]
lisp: fix a failure with Solaris /usr/xpg4/bin/sh

* lib/am/lisp.am (.el.elc): By initializing the 'am__dir' properly
here.  For most shells, the lacking initialization, while technically
incorrect, didn't cause any issue in practice, because in those shells
"test -d" returns an exit status of 0. But with /usr/xpg4/bin/sh, the
shell complains like this: "test: argument expected", and returns a
non-zero exit status.  This caused testsuite failures in several lisp
tests.
Also, while we are at it, use more proper quoting in the recipe, to
ensure a missing initialization to now be caught by more forgiving
shells as well.
* NEWS: Update.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: sanitize 'unset' usages
Stefano Lattarini [Fri, 17 May 2013 11:45:44 +0000 (13:45 +0200)]
tests: sanitize 'unset' usages

In some shells (e.g., Solaris 10 /bin/ksh, or NetBSD 5.1 /bin/sh),
"unset VAR" returns a non-zero exit status in case the VAR variable
is already unset.  This doesn't interact well with our usage of
"set -e" in the testsuite.  So far, we've avoided spurious failures
by either explicitly ignoring the exit status from unset:

    unset VAR || :

or explicitly ensuring that a variable is set, before trying to
unset it:

    VAR=; unset VAR

But we can do better, by aliasing the 'unset' command to a custom
function that will take care of these details for us.  This will
avoid us annoying spurious failures in the future, failures that
have already bitten us too much times.  For an example, refer to
commit 'v1.12.2-88-g5b1dae5' of 2012-08-05 (tests: avoid tons of
spurious failures on NetBSD).

* t/ax/test-lib.sh (_am_unset): New function.
(unset): New alias to it.
(_am_exit): Adjust comments.
* t/ax/am-test-lib.sh: No need to temporary disable the 'errexit'
shell flag when unsetting variables that are potentially already
unset.
(am_process_requirements): Adjust to remove a now-useless
workaround related to unset.
* t/aclocal-macrodir.tap: Likewise.
* t/aclocal-macrodirs.tap: Likewise.
* t/auxdir-autodetect.sh: Likewise.
* t/ax/am-test-lib.sh: Likewise.
* t/ax/test-lib.sh: Likewise.
* t/check-tests-in-builddir.sh: Likewise.
* t/dist-formats.tap: Likewise.
* t/distcheck-configure-flags-am.sh: Likewise.
* t/distcheck-configure-flags.sh: Likewise.
* t/java-empty-classpath.sh: Likewise.
* t/javaflags.sh: Likewise.
* t/lflags.sh: Likewise.
* t/lflags2.sh: Likewise.
* t/lisp-flags.sh: Likewise.
* t/lisp6.sh: Likewise.
* t/missing-auxfile-stops-makefiles-creation.sh: Likewise.
* t/parallel-am.sh: Likewise.
* t/parallel-am2.sh: Likewise.
* t/parallel-am3.sh: Likewise.
* t/parallel-tests-log-override-recheck.sh: Likewise.
* t/pkg-config-macros.sh: Likewise.
* t/python-missing.sh: Likewise.
* t/python-too-old.sh: Likewise.
* t/python11.sh: Likewise.
* t/self-check-dir.tap: Likewise.
* t/self-check-report.sh: Likewise.
* t/self-check-seq.tap: Likewise.
* t/silent-configsite.sh: Likewise.
* t/suffix6c.sh: Likewise.
* t/tar-override.sh: Likewise.
* t/tests-environment-and-log-compiler.sh: Likewise.
* t/vala-configure.sh: Likewise.
* t/werror3.sh: Likewise.
* t/yflags-cmdline-override.sh: Likewise.
* t/yflags.sh: Likewise.
* t/yflags2.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: fix some botched/outdated comments
Stefano Lattarini [Thu, 16 May 2013 12:49:44 +0000 (14:49 +0200)]
tests: fix some botched/outdated comments

* t/ax/test-defs.in: Here.  Also, fix a couple of grammaros while at it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: use perl, not find+rm, to remove temporary directories
Stefano Lattarini [Thu, 16 May 2013 12:18:55 +0000 (14:18 +0200)]
tests: use perl, not find+rm, to remove temporary directories

The File::Path::rmtree function from perl, if used right, is
more reliable and more portable of our past idiom:

    find $dirs -type d ! -perm -700 -exec chmod u+rwx {} ';';
    rm -rf $$dirs || exit 1

at least of the face of unreadable dirs/files and other similar
permission issues (and we have those in our test directories).

In fact, this change fixes some spurious failures seen in
"make distcheck" on Solaris 10.

* t/ax/deltree.pl: New.
* Makefile.am (EXTRA_DIST): Add it.
(clean-local-check): Use it.
* t/ax/test-lib.sh (rm_rf_): Use it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: remove remaining exec bits ('maint' branch)
Stefano Lattarini [Thu, 16 May 2013 11:36:49 +0000 (13:36 +0200)]
tests: remove remaining exec bits ('maint' branch)

The executable bit gives the impression that the tests are directly
runnable, as with "./t/foo.sh", but it has been a while since that
was the case.  Today, tests are runnable only through "make check"
or "./runtest".

This change is for the 'maint' branch (automake 1.13a), and is a
follow-up to commit 'v1.13.2-3-g74017b5', done on the 'micro' branch
(automake 1.13.2a).  It will soon be followed by a similar patch
for the 'master' branch (automake 1.99a).

* t/am-prog-cc-c-o.sh: Remove executable bit.
* t/ccnoco4.sh: Likewise.
* t/dist-shar.sh: Likewise.
* t/dist-tarZ.sh: Likewise.
* t/lex-multiple.sh: Likewise.
* t/preproc-basics.sh: Likewise.
* t/preproc-c-compile.sh: Likewise.
* t/preproc-demo.sh: Likewise.
* t/preproc-errmsg.sh: Likewise.
* t/rm-f-probe.sh: Likewise.
* t/self-check-cc-no-c-o.sh: Likewise.
* t/txinfo-builddir.sh: Likewise.
* t/txinfo-nodist-info.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoMerge branch 'micro' into maint
Stefano Lattarini [Thu, 16 May 2013 11:35:45 +0000 (13:35 +0200)]
Merge branch 'micro' into maint

* micro:
  tests: remove exec bit from all of them ('micro' branch)
  maint: tests no longer need to have executable bit set

11 years agotests: remove exec bit from all of them ('micro' branch)
Stefano Lattarini [Thu, 16 May 2013 10:18:43 +0000 (12:18 +0200)]
tests: remove exec bit from all of them ('micro' branch)

It gives the impression that they are directly runnable, as with
"./t/foo.sh", but it has been a while since that was the case.  Today,
tests are runnable only through "make check" or "./runtest".

This change is for the 'micro' branch (automake 1.13.2a).  It will
soon be followed by similar patches for the 'maint' branch (automake
1.13a) and the 'master' branch (automake 1.99a).

* t/*.sh, t/*.tap: Remove executable bit.
* maint.mk (sc_tests_executable): Remove.
(syntax_check_rules): Adjust.
* gen-testsuite-part: Set permissions of generated tests to
'444' (-r--r--r--), rather than 555 (-r-xr-xr-x).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agomaint: tests no longer need to have executable bit set
Stefano Lattarini [Thu, 16 May 2013 10:13:32 +0000 (12:13 +0200)]
maint: tests no longer need to have executable bit set

It has been a while since they are runnable only through "make check"
or "./runtest", and not directly.

* HACKING: Adjust.
* t/README: Likewise, and updated the surrounding text to get rid of
obsolete statements and advices.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoPLANS: subdir-objects: various updates
Stefano Lattarini [Wed, 15 May 2013 22:21:20 +0000 (00:21 +0200)]
PLANS: subdir-objects: various updates

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoMerge branch 'micro' into maint
Stefano Lattarini [Wed, 15 May 2013 20:54:15 +0000 (22:54 +0200)]
Merge branch 'micro' into maint

* micro:
  post-release: micro version bump (1.13.2a)
  release: stable micro release 1.13.2
  vala tests: skip in a cross compiler setup
  HACKING: miscellaneous fixes, updates and enhancements
  NEWS: minor improvements to wording (about new versioning scheme)

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agopost-release: micro version bump (1.13.2a)
Stefano Lattarini [Wed, 15 May 2013 20:44:43 +0000 (22:44 +0200)]
post-release: micro version bump (1.13.2a)

* configure.ac, m4/amversion.m4: Bump version: 1.13.2 -> 1.13.2a

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agorelease: stable micro release 1.13.2 v1.13.2
Stefano Lattarini [Wed, 15 May 2013 17:43:39 +0000 (19:43 +0200)]
release: stable micro release 1.13.2

* configure.ac (AC_INIT): Bump version number to 1.13.2.
* m4/amversion.m4: Likewise (auto-updated by "make bootstrap").

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agovala tests: skip in a cross compiler setup
Stefano Lattarini [Wed, 15 May 2013 20:05:21 +0000 (22:05 +0200)]
vala tests: skip in a cross compiler setup

The "vala + pkg-config" doesn't interact well with cross-compilation:
<https://mail.gnome.org/archives/vala-list/2012-September/msg00094.html>

That is causing annoying failures in our testsuite when it's run in
cross-compilation mode.  It's not worth trying too be overly smart and
work around these problems; just skip the affected tests instead.

* t/ax/am-test-lib.sh (require_tool): A new requirement 'valac', telling
that the test needs to compile Vala-generated C files.  In particular,
this causes the test to be skipped when using a cross-compiler.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoHACKING: miscellaneous fixes, updates and enhancements
Stefano Lattarini [Wed, 15 May 2013 17:34:41 +0000 (19:34 +0200)]
HACKING: miscellaneous fixes, updates and enhancements

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoNEWS: minor improvements to wording (about new versioning scheme)
Stefano Lattarini [Wed, 15 May 2013 17:13:13 +0000 (19:13 +0200)]
NEWS: minor improvements to wording (about new versioning scheme)

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoTHANKS: update Akim's e-mail address
Stefano Lattarini [Wed, 15 May 2013 13:55:44 +0000 (15:55 +0200)]
THANKS: update Akim's e-mail address

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: less uses of "make -e"; avoid spurious failures in 'check-cc-no-c-o'
Stefano Lattarini [Tue, 14 May 2013 13:50:12 +0000 (15:50 +0200)]
tests: less uses of "make -e"; avoid spurious failures in 'check-cc-no-c-o'

That is, when the testsuite is run using a fake C compiler that doesn't
grasp the '-c' and '-o' options together.

* t/instdir-prog.sh: Adjust.
* t/instdir-ltlib.sh: Likewise.
* t/python-virtualenv.sh: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agobuild: be more respectful of user-specified verbosity
Stefano Lattarini [Tue, 14 May 2013 12:18:00 +0000 (14:18 +0200)]
build: be more respectful of user-specified verbosity

* t/Makefile.in (check-cc-no-c-o, check-no-trailing-backslash-in-recipes,
installcheck-testsuite, perf): Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agocheck-cc-no-c-o: unify initializations in a single place
Stefano Lattarini [Tue, 14 May 2013 11:40:48 +0000 (13:40 +0200)]
check-cc-no-c-o: unify initializations in a single place

* t/ax/test-defs.in: That is, by setting CC and GNU_CC here, in accord
with the value of the variable 'AM_TESTSUITE_SIMULATING_NO_CC_C_O'.
* t/Makefile.in (check-cc-no-c-o) : No need to reset CC and GNU_CC any
longer in the recursive "make check" invocation.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agocheck-cc-no-c-o: avoid a spurious failure
Stefano Lattarini [Tue, 14 May 2013 11:17:50 +0000 (13:17 +0200)]
check-cc-no-c-o: avoid a spurious failure

* t/am-prog-cc-c-o.sh: In this test, by relying on the knowledge
that we are running under the aegis of the 'check-cc-no-c-o'
maintainer-specific target, knowledge given us by ...
* t/Makefile.in (check-cc-no-c-o) : ... the new environment
variable 'AM_TESTSUITE_SIMULATING_NO_CC_C_O', set to a value
of "yes" by this rule.
* t/ax/test-defs.in: Initialize the new variable to "no" by
default, and add an explanatory comment.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agobuild: fixup for building in a VPATH setup
Stefano Lattarini [Tue, 14 May 2013 10:12:44 +0000 (12:12 +0200)]
build: fixup for building in a VPATH setup

* bin/Makefile.inc (%D%/automake, %D%/aclocal): Make sure that the
directory where the targets scripts are going to be built exists,
before trying to create said scripts.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoUse AC_DEFUN_ONCE to define AM_PROG_CC_C_O
Nick Bowler [Sat, 11 May 2013 09:45:16 +0000 (11:45 +0200)]
Use AC_DEFUN_ONCE to define AM_PROG_CC_C_O

If AM_PROG_CC_C_O is expanded multiple times, and the compiler does not
support -c and -o together, each expansion of the macro will prepend
the compile script to CC.  This can result in the compile script
invoking the compile script, which at best pointless and silly.
Fortunately, there does not appear to be any serious problems as the
first compile invocation strips out -o options, causing subsequent
invocations of the script to merely exec their arguments.

Other than fixing the above, this should not normally cause any changes
to the resulting configure script, except in the (hopefully rare) case
where AM_PROG_CC_C_O is directly expanded (i.e., *not* using AC_REQUIRE)
in the body of a macro defined with AC_DEFUN.  In that case, the use of
AC_DEFUN_ONCE may cause the expansion of AM_PROG_CC_C_O to appear
earlier in the configure script.

* m4/minuso.m4: Change the definition of AM_PROG_CC_C_O to use
AC_DEFUN_ONCE, avoiding problems caused by multiple expansions.

Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agocompile: avoid AC_PROG_CC messy rewrite
Stefano Lattarini [Sat, 11 May 2013 09:03:41 +0000 (11:03 +0200)]
compile: avoid AC_PROG_CC messy rewrite

Instead, add an hook to AC_OUTPUT to have AM_PROG_CC_C_O invoked
automatically.

See also the long-winded discussion about automake bug#13378.

* m4/minuso.m4 (AM_PROG_CC_C_O): Bring back the old implementation,
from commit v1.13.1-55-g1ab8fb6.
* m4/init.m4 (AC_PROG_CC): Remove this horrible, hacky re-write.
* (AM_INIT_AUTOMAKE): Arrange for AM_PROG_CC_C_O to be called if
necessary.
* t/am-prog-cc-c-o.sh: Adjust to avoid spurious failure.
* t/subobj.sh: Likewise.

Suggested-by: Nick Bowler <nbowler@elliptictech.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agooptions: tiny simplification in dealing with incompatible versions
Stefano Lattarini [Sat, 11 May 2013 08:25:33 +0000 (10:25 +0200)]
options: tiny simplification in dealing with incompatible versions

* lib/Automake/Options.pm (_process_option_list): Here, when an
incompatible version number option is detected, there's no need
to call error() with the "uniq_scope => US_GLOBAL" switch.
In fact, if the same incompatible version number is specified in
AUTOMAKE_OPTIONS in both (say) 'Makefile.am' and 'sub/Makefile.am',
we want each such erroneous usage reported separately, rather than
just the first time it is encountered (as we'd expect to happen
when "uniq_scope => US_GLOBAL" is used).
Ideally, this change should have been folded into the similar
commit 'v1.13.1d-129-gf7ef16f', but we noticed that too late.
Oh well.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agooptions: try to report as much errors as possible
Stefano Lattarini [Fri, 10 May 2013 22:28:15 +0000 (00:28 +0200)]
options: try to report as much errors as possible

For example, if two invalid options are used in AUTOMAKE_OPTIONS, don't
report just the first one, but both of them.

* lib/Automake/Options.pm (_process_option_list): Do so by avoiding
early returns in here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoMerge branch 'branch-1.13.2' into maint
Stefano Lattarini [Fri, 10 May 2013 22:16:14 +0000 (00:16 +0200)]
Merge branch 'branch-1.13.2' into maint

* branch-1.13.2:
  warns: don't tell AM_PROG_MKDIR_P is going to be removed

11 years agowarns: don't tell AM_PROG_MKDIR_P is going to be removed
Stefano Lattarini [Fri, 10 May 2013 21:59:02 +0000 (23:59 +0200)]
warns: don't tell AM_PROG_MKDIR_P is going to be removed

That is no longer true.  For a more extended rationale, see file
'PLANS/obsolete-removed/am-prog-mkdir-p.txt' in the maint branch
(as of commit v1.13.1d-132-g90ec3fe).

* automake.in (scan_autoconf_traces): So adjust the warning message
here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agorefactor: fix few "inverted boolean" usages
Stefano Lattarini [Fri, 10 May 2013 21:50:25 +0000 (23:50 +0200)]
refactor: fix few "inverted boolean" usages

In some subroutines, we used a return value of 0 to indicate success,
and a return status of 1 to indicate failure.  That was not very
consistent with the perl interpretation of 0 as a false value and 1 as
a true value.  So we now invert the meaning of the exit statuses.

* lib/Automake/Options.pm (_process_option_list): Here.
(process_global_option_list, process_option_list): And by reflex,
here as well.
* bin/automake.in (handle_options): And here.
(generate_makefile, scan_autoconf_traces): Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agooptions: better name for an internal function
Stefano Lattarini [Fri, 10 May 2013 21:29:04 +0000 (23:29 +0200)]
options: better name for an internal function

* lib/Automake/Options.pm (_option_must_be_from_configure): Rename ...
(_option_is_from_configure): ... like this.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agooptions: more consistency in use of return statuses to report errors
Stefano Lattarini [Fri, 10 May 2013 21:08:28 +0000 (23:08 +0200)]
options: more consistency in use of return statuses to report errors

* lib/Automake/Options.pm (_option_must_be_from_configure): By giving
a proper return status here.
(_process_option_list): And using it here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agooptions: tiny simplification in dealing with erroneous opts
Stefano Lattarini [Fri, 10 May 2013 21:01:27 +0000 (23:01 +0200)]
options: tiny simplification in dealing with erroneous opts

* lib/Automake/Options.pm (_process_option_list): Here, when an
invalid option is detected, there's no need to call &error with
the "uniq_scope => US_GLOBAL" switch.  In fact, if the same
erroneous option is specified in AUTOMAKE_OPTIONS in both (say)
'Makefile.am' and 'sub/Makefile.am', we want each such erroneous
usage reported separately, rather than just the first time it is
encountered (as happens when "uniq_scope => US_GLOBAL" is used).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agooptions: consistently use return statuses to report errors
Stefano Lattarini [Fri, 10 May 2013 20:50:54 +0000 (22:50 +0200)]
options: consistently use return statuses to report errors

* lib/Automake/Options.pm (_process_option_list): Here.
(process_option_list, process_global_option_list): Remove
redundant use of 'return'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agooptions: re-enable some sanity checks
Stefano Lattarini [Fri, 10 May 2013 20:34:21 +0000 (22:34 +0200)]
options: re-enable some sanity checks

They had been unwittingly disabled by a slightly incorrect
code ordering.

* lib/Automake/Options.pm (process_option_list): Here.
(process_global_option_list): And here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoTHANKS: update Eric Blake's e-mail address
Stefano Lattarini [Fri, 10 May 2013 20:19:03 +0000 (22:19 +0200)]
THANKS: update Eric Blake's e-mail address

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoNEWS: typofix
Stefano Lattarini [Fri, 10 May 2013 20:17:43 +0000 (22:17 +0200)]
NEWS: typofix

Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agonews: document new 'subdir-objects' warning
Stefano Lattarini [Fri, 10 May 2013 19:17:30 +0000 (21:17 +0200)]
news: document new 'subdir-objects' warning

* NEWS: Automake 1.14 will warn if a subdir source file is
specified but the 'subdir-objects' option is not given.  This
is done to smooth the transition to Automake 2.0, which will
unconditionally assume the behaviour now given only with the
'subdir-objects' option.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoPLANS: one minor fixlet (mostly cosmetic)
Stefano Lattarini [Fri, 10 May 2013 18:56:07 +0000 (20:56 +0200)]
PLANS: one minor fixlet (mostly cosmetic)

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoPLANS: we have already dropped support for split info files in master
Stefano Lattarini [Fri, 10 May 2013 18:52:36 +0000 (20:52 +0200)]
PLANS: we have already dropped support for split info files in master

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoNEWS: fix a reference to Automake 1.14 where Automake 2.0 was intended
Stefano Lattarini [Fri, 10 May 2013 18:35:21 +0000 (20:35 +0200)]
NEWS: fix a reference to Automake 1.14 where Automake 2.0 was intended

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoPLANS: fix reference to non-existent 'next' branch
Stefano Lattarini [Fri, 10 May 2013 18:09:42 +0000 (20:09 +0200)]
PLANS: fix reference to non-existent 'next' branch

* PLANS/obsolete-removed/configure.in.txt: Here.  We should refer
to the 'master' branch instead.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoPLANS: fix botched version reference
Stefano Lattarini [Fri, 10 May 2013 18:06:08 +0000 (20:06 +0200)]
PLANS: fix botched version reference

* PLANS/rm-f-without-args.txt: Here.  The probe checking that "rm -f"
without arguments works will be introduced in Automake 1.14, not in
Automake 1.13.2.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agomaintcheck: fix two references to old location of aclocal and automake
Stefano Lattarini [Fri, 10 May 2013 17:32:20 +0000 (19:32 +0200)]
maintcheck: fix two references to old location of aclocal and automake

* maintainer/syntax-checks.mk (sc_perl_at_substs): Here: it should
refer to 'bin/automake' and 'bin/aclocal', not 'automake' and
'alocal'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agodist: deprecated shar and tar+compress formats
Stefano Lattarini [Fri, 10 May 2013 17:22:06 +0000 (19:22 +0200)]
dist: deprecated shar and tar+compress formats

See also discussion about automake wishlist bug#13324.

* lib/Automake/Options.pm: Give proper warnings in the 'obsolete'
category if the 'dist-shar' or 'dist-tarZ' options are used.
* lib/distdir.am: When the 'dist-tarZ' or 'dist-shar' targets are
invoked, make them give a non-fatal warning.
* doc/automake.texi: Report the new deprecations.
* t/dist-shar.sh: New test.
* t/dist-tarZ.sh: Likewise.
* t/lzma.sh: While at it, rename ...
* t/dist-lzma.sh: ... like this, and tweak it to keep more in
sync with the new tests.
* t/dist-formats.tap: Remove references to deprecated formats.
* t/list-of-tests.mk: Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoMerge branch 'dog-feeding' into maint
Stefano Lattarini [Fri, 10 May 2013 11:31:59 +0000 (13:31 +0200)]
Merge branch 'dog-feeding' into maint

* dog-feeding:
  build: move automake and aclocal in 'bin' subdir
  build: break up monolithic Makefile.am in subdir-specific fragments

11 years agoMerge branch 'branch-1.13.2' into maint
Stefano Lattarini [Fri, 10 May 2013 11:31:45 +0000 (13:31 +0200)]
Merge branch 'branch-1.13.2' into maint

* branch-1.13.2:
  automake: typofix in comments: s/AC_CONFIG_HEADER/AC_CONFIG_HEADERS/

11 years agoautomake: typofix in comments: s/AC_CONFIG_HEADER/AC_CONFIG_HEADERS/
Stefano Lattarini [Fri, 10 May 2013 10:13:00 +0000 (12:13 +0200)]
automake: typofix in comments: s/AC_CONFIG_HEADER/AC_CONFIG_HEADERS/

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoam: prefer a shorter idiom where possible
Stefano Lattarini [Fri, 10 May 2013 08:57:38 +0000 (10:57 +0200)]
am: prefer a shorter idiom where possible

That is, prefer:

    test -f FILE || do_action

over:

    if test ! -f FILE; then do_action; else :; fi

* lib/am/remake-hdr.am (%CONFIG_H%): Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoMerge branch 'branch-1.13.2' into maint
Stefano Lattarini [Fri, 10 May 2013 08:53:15 +0000 (10:53 +0200)]
Merge branch 'branch-1.13.2' into maint

* branch-1.13.2:
  cosmetics: fix few typos, grammaros and missing whitespace
  fixup: remove an obsolete comment
  docs: we still don't have the promised better Java interface

11 years agocosmetics: fix few typos, grammaros and missing whitespace
Stefano Lattarini [Fri, 10 May 2013 08:50:05 +0000 (10:50 +0200)]
cosmetics: fix few typos, grammaros and missing whitespace

* lib/am/*.am: In comments in some of these files.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agofixup: remove an obsolete comment
Stefano Lattarini [Fri, 10 May 2013 08:35:26 +0000 (10:35 +0200)]
fixup: remove an obsolete comment

* lib/am/header-vars.am (am__make_running_with_option): Here.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agodocs: we still don't have the promised better Java interface
Stefano Lattarini [Thu, 9 May 2013 18:23:40 +0000 (20:23 +0200)]
docs: we still don't have the promised better Java interface

Reported by Michael Zucchi:
<http://lists.gnu.org/archive/html/automake/2013-05/threads.html>

See also automake bug#9088.

* doc/automake.texi (Java): Adjust and clarify.
* THANKS: Update.

Reported-by: Michael Zucchi <notzed@gmail.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agomaint: re-run "make update-copyright" ...
Stefano Lattarini [Thu, 9 May 2013 18:13:19 +0000 (20:13 +0200)]
maint: re-run "make update-copyright" ...

* t/lex-multiple.sh: ... which updates the copyright years
of this test (they were somehow not bumped in the past).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agotests: avoid spurious failure with older flex (2.5.4)
Stefano Lattarini [Thu, 9 May 2013 17:50:38 +0000 (19:50 +0200)]
tests: avoid spurious failure with older flex (2.5.4)

That old version is unfortunately still relevant, being the one
installed on NetBSD 5.1.

* t/lex-multiple.sh: Use the '-o' option rather than the longer
equivalent '--outfile'.  The latter is not supported by older
versions of flex (e.g., flex 2.5.4).

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agoMerge branch 'branch-1.13.2' into maint
Stefano Lattarini [Thu, 9 May 2013 12:14:00 +0000 (14:14 +0200)]
Merge branch 'branch-1.13.2' into maint

* branch-1.13.2:
  announcement: cater to more flexible NEWS format

11 years agoannouncement: cater to more flexible NEWS format
Stefano Lattarini [Thu, 9 May 2013 11:55:15 +0000 (13:55 +0200)]
announcement: cater to more flexible NEWS format

* maint.mk (announcement): Here, be prepared to handle the case
in which the first section of the NEWS file is dedicated to report
future backward-incompatibilities and/or other warnings.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
11 years agobuild: move automake and aclocal in 'bin' subdir
Stefano Lattarini [Thu, 9 May 2013 09:57:20 +0000 (11:57 +0200)]
build: move automake and aclocal in 'bin' subdir

* automake.in: Rename ...
* bin/automake.in: ... like this.
* aclocal.in: Rename ...
* bin/aclocal.in: ... like this.
* Makefile.am: Move parts that dealt with the building/distribution
of aclocal and Automake ..
* bin/Makefile.inc): ... in this new included fragment.  Adjust as
needed, and make deliberate use of the '%D%' substitution.
* lib/gen-perl-protos: Move ...
* bin/gen-perl-protos: ... here.
* bootstrap.sh, configure.ac, maintainer/rename-tests,
t/wrap/aclocal.in, t/wrap/automake.in, doc/Makefile.inc,
t/ax/tap-setup.sh, .gitignore: Adjust.
* maintainer/syntax-checks.mk: Likewise, and enhance a little.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>