Re: How to let autoconf NOT include ($CFLAGS) in LINK?

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

 



On Thu, 2005-07-21 at 07:29 +0000, autoconf-list@xxxxxxxxxxxxxxxxxx
wrote:

> So my question is, is there a simple way to only include ($CFLAGS) when
> compiling, and only ($LDFLAGS) when linking, NOT ($CFLAGS)?
Firstly, this is OT for this list. It's an automake question.

To answer your question: no. 

Automake rules assume you using the compiler to link and not to use ld
directly. That's why automake uses CCLD (calling the linker through CC)
and not LD (the raw linker) in "LINK". 

It does so, because CFLAGS can implicitly influence linking in various
ways, which should remain transparent to users.

> #create compiler options
> AC_SUBST(CFLAGS, "-g -O -Wall -ansi")
BTW: Such constructs should be considered as bad design.

1. CFLAGS is supposed to be overridden from the command line and not to
be hard coded into configure.acs.
2. This is non portable. You are hard-coding GCC specific flags into
your package.
3. CFLAGS already are implicitly AC_SUBST'ed

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