compile: rewrite AC_PROG_CC with AM_PROG_CC_C_O contents
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 14 May 2013 14:08:32 +0000 (16:08 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 24 May 2013 12:17:26 +0000 (14:17 +0200)
commit9877109c1f00e20f76a69ac656fc02a439ae318a
tree97fe748cf815830dcfdf3b9af4ca60f4cf8dff24
parentac13ca500648395417e5d9bcf110475b42841bee
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>
16 files changed:
configure.ac
m4/ar-lib.m4
m4/init.m4
m4/minuso.m4
t/aclocal-deps.sh
t/add-missing.tap
t/alloca.sh
t/ccnoco-deps.sh [new file with mode: 0755]
t/ccnoco-lib.sh [new file with mode: 0755]
t/ccnoco-lt.sh [new file with mode: 0755]
t/ccnoco.sh
t/condlib.sh
t/discover.sh
t/list-of-tests.mk
t/objc-megademo.sh
t/subobj-clean-lt-pr10697.sh