autoconf
[Top][All Lists]
Advanced

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

Re: modification of CFLAGS


From: Jason Curl
Subject: Re: modification of CFLAGS
Date: Thu, 20 May 2010 21:03:53 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4

Hello Ralf,
On 20/05/2010 20:45, Ralf Wildenhues wrote:
Hello Jason,

* Jason Curl wrote on Thu, May 20, 2010 at 08:40:39PM CEST:
However, I see that the autoconf macros already modify CFLAGS. Is
there a way that I can obtain what the user originally entered
*within* my macro after AC_PROG_CC? If the user provided CFLAGS, I
wish to use that and make no modifications. Otherwise, if GNU CC is
used, I wish to set it to "-O0 -g".

Currently, autotools sets it to "-O2 -g". I can't seem to figure out
where the original settings are given.
You can access $CFLAGS before AC_PROG_CC, for example save its value to
some other variable:
   LX_CFLAGS=${CFLAGS-NONE}
Thought about this before I posted and it's viable. Are you sure there's no way to get this within my macro? This allows me to encapsulate all functionality in a separate file with only one line in the configure.ac.
This will set them to "NONE" if CFLAGS was not set, and to $CFLAGS if it
was set to some empty or nonempty value.

Then, in your macro, you can access and compare $LX_CFLAGS and $CFLAGS,
for example.  The macro should be called right (or soon) after
AC_PROG_CC, I guess, so other compiler tests use your flags.

Cheers,
Ralf




reply via email to

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