autoconf
[Top][All Lists]
Advanced

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

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


From: Ralf Corsepius
Subject: Re: How to let autoconf NOT include ($CFLAGS) in LINK?
Date: Thu, 21 Jul 2005 11:26:30 +0200

On Thu, 2005-07-21 at 07:29 +0000, address@hidden
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






reply via email to

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