autoconf
[Top][All Lists]
Advanced

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

Re: AC_PROG_CC_C99


From: Ralf Wildenhues
Subject: Re: AC_PROG_CC_C99
Date: Wed, 1 Dec 2004 16:22:55 +0100
User-agent: Mutt/1.4.1i

* Roger Leigh wrote on Wed, Dec 01, 2004 at 03:44:41PM CET:
> 
> 
> # AC_PROG_CC_C99
> # ----------------
> # If the C compiler in not in ISO C99 C mode by default, try to add an
> # option to output variable @code{CC} to make it so.  This macro tries
> # various options that select ISO C99 C on some system or another.  It
> # considers the compiler to be in ISO C99 C mode if it handles mixed
> # code and declarations, _Bool, inline and restrict.
> AC_DEFUN([AC_PROG_CC_C99],
> [AC_MSG_CHECKING([for $CC option to accept ISO C99 C])

I think instead of this line you want something like:

[AC_REQUIRE([AC_PROG_CC])dnl
AC_MSG_CHECKING([for $CC option to accept ISO C99 C])

> AC_CACHE_VAL(ac_cv_prog_cc_c99,
> [ac_cv_prog_cc_c99=no
> ac_save_CC=$CC
*snip rest*

Successfully sets -qlanglvl=extc99 with xlc v6, -std=c99 works with icc.
However, it also wrongly reports `none needed' for old gcc-2.95, which
fails to compile the test program with all of the options.

Is it considered better for the result of AC_PROG_CC_C99 to end up in
$CC or in $CFLAGS (I'm not really sure myself, just wondering)?

Regards,
Ralf




reply via email to

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