autoconf-patches
[Top][All Lists]
Advanced

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

Re: AC_PROG_CC_C99


From: Roger Leigh
Subject: Re: AC_PROG_CC_C99
Date: Wed, 05 Jan 2005 22:11:45 +0000
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Noah Misch <address@hidden> writes:

> On Tue, Jan 04, 2005 at 03:59:44PM -0800, Paul Eggert wrote:
>> Noah Misch <address@hidden> writes:
>> > will it work for AC_PROG_CC_C89 (via AC_PROG_CC) to add the
>> > C89-tolerance option, and for AC_PROG_CC_99 to then try to add the
>> > C99-tolerance option in addition?
>> 
>> Good question.  We'd rather have it do C99 from day one in that case,
>> I suppose.  Roger?
>
> I don't think that's necessary.  See the patch below, for example.

I think the intent of the patch is fine.  However, the use of sed is a
little dangerous IMHO, since it could break on odd CC environment
variables.  It might be a bit cleaner (and safer) to have two
variables that make up $CC (for example $CC_COMPILER and $CC_STANDARD,
where $CC_COMPILER will contain the compiler name e.g. gcc and
$CC_STANDARD will contain options to put it into a particular mode
e.g. -std=gnu99).  This will allow them to be changed separately.

This would allow one to simply say:
CC_STANDARD="$ac_cv_prog_cc_c99"
CC="$CC_COMPILER $CC_STANDARD"

With this, you can call AC_PROG_CC_C89 and AC_PROG_CC_C99 in any order
without worries: it will always use the last result.


Regards,
Roger

- -- 
Roger Leigh
                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD8DBQFB3GXnVcFcaSW/uEgRAotdAKCKO17M0XUxcfskxMmuHeFuqgPV+ACgzbnO
umMcsly75mX157Sj72WDefE=
=ozt2
-----END PGP SIGNATURE-----




reply via email to

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