Use AC_DEFUN_ONCE to define AM_PROG_CC_C_O
authorNick Bowler <nbowler@elliptictech.com>
Sat, 11 May 2013 09:45:16 +0000 (11:45 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 11 May 2013 09:54:21 +0000 (11:54 +0200)
commitc148dc73a92c1df5e70a61e9495e62c010090bd4
tree12bb1d737adce38e1282690f3ae8abc8749f4a77
parent32eb770b73903a6b09216709790a093b33afff8d
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>
m4/minuso.m4