bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with AC_REQUIRE expansion order


From: Ralf Wildenhues
Subject: Re: Problem with AC_REQUIRE expansion order
Date: Tue, 5 Aug 2008 21:43:53 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

* Eric Blake wrote on Tue, Aug 05, 2008 at 06:26:40AM CEST:
> >From c308e3f1a6d2a3667b22f4228be2d3b8a7f6e4df Mon Sep 17 00:00:00 2001
> From: Eric Blake <address@hidden>
> Date: Mon, 4 Aug 2008 22:10:24 -0600
> Subject: [PATCH] Fix autoconf 2.62 regression in AC_GNU_SOURCE vs. AC_PROG_CC.
> 
> * lib/autoconf/c.m4 (AC_PROG_CC): Put user selection of
> compilers into earlier diversion...
> (_AC_PROG_CC): ...so that remaining code can be split into new
> macro that is guaranteed to be emitted once by first AC_REQUIRE.
> * lib/autoconf/specific.m4 (AC_USE_SYSTEM_EXTENSIONS): Require the
> compiler to be found first.
> * tests/c.at (AC_USE_SYSTEM_EXTENSIONS): Add to the test.
> Reported by Andreas Schwab.

Nifty.

>  AC_DEFUN([AC_PROG_CC],
> +[AC_REQUIRE([_AC_PROG_CC])dnl
> +m4_expand_once([m4_divert_text([DEFAULTS],
> +  [ac_prog_cc_list=])])dnl
> +m4_ifval([$1], [m4_divert_text([INIT_PREPARE],
> +  [ac_prog_cc_list='$1'])])dnl

This won't like
  AC_PROG_CC(['cc -m32' "cc -m64"])

and due to how AC_CHECK_TOOLS works, it's not fixed by a simple
bpatsubst either.  Sorry.

> +])
> +
> +AC_DEFUN([_AC_PROG_CC],
>  [AC_LANG_PUSH(C)dnl
>  AC_ARG_VAR([CC],     [C compiler command])dnl
>  AC_ARG_VAR([CFLAGS], [C compiler flags])dnl
>  _AC_ARG_VAR_LDFLAGS()dnl
>  _AC_ARG_VAR_LIBS()dnl
>  _AC_ARG_VAR_CPPFLAGS()dnl
> -m4_ifval([$1],
> -      [AC_CHECK_TOOLS(CC, [$1])],
> +AS_IF([test -n "$ac_prog_cc_list"],
> +[AC_CHECK_TOOLS(CC, [$ac_prog_cc_list])],
>  [AC_CHECK_TOOL(CC, gcc)

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]