autoconf
[Top][All Lists]
Advanced

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

Re: Obeying users CFLAGS


From: Tim Post
Subject: Re: Obeying users CFLAGS
Date: Thu, 12 Jun 2008 15:15:13 +0800

On Thu, 2008-06-12 at 09:02 +0200, Ralf Wildenhues wrote:
> Hello Tim,
> 
> * Tim Post wrote on Thu, Jun 12, 2008 at 06:53:29AM CEST:
> > 
> > I have noticed that if the CFLAGS environment is not set, @CFLAGS@ is
> > expanded to -g -O2 Is this expected behavior?
> 
> Yes, that is documented in
> <http://www.gnu.org/software/autoconf/manual/html_node/C-Compiler.html>.
> The first macro invoked, of AC_PROG_{CC,CXX,F77,FC} does this.

Ahh, Thanks. The documentation is rather extensive, I missed that.
Note, I'm not in any way complaining about extensive documentation! :)

> Well, if you as a user set './configure CFLAGS=...' then that is not
> overridden: the user is assumed to be always right.  If you as a
> developer want to modify CFLAGS in configure.ac, then I suggest you do
> so only if the user hasn't set it.  You can find this out with
>   test "${CFLAGS+set}" = set

Yes, that's my goal. The user is always right. They know their computer,
obey their preferences. But, since I know my program better than they
do, I wanted to be as descriptive as possible when issuing configure
errors.

> before AC_PROG_CC, and modifying CFLAGS in that case, preferably after
> the AC_PROG_CC invocation so that you get the -g/-O2 testing done by
> this macro.  To find out whether your flags work you could just try to
> compile or link a simple test program (see AC_COMPILE_IFELSE).

That clears it up, thanks Ralf!

Regards,
--Tim






reply via email to

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