Re: modification of CFLAGS

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

 



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


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux