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: autoconf-list
Subject: Re: How to let autoconf NOT include ($CFLAGS) in LINK?
Date: Thu, 21 Jul 2005 09:59:46 +0000
User-agent: Internet Messaging Program (IMP) H3 (4.0.2) / FreeBSD-5.3

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

For future reference (like people searching this list), I followed the helpful
comments from these three people and did the following:

* I removed the AC_SUBST(CFLAGS, "-g -O -Wall -ansi") directive
* I added the Tru64 specific flags in a script that calls ./configure with the
appropriate CFLAGS="-foo -bar" settings.

That works like a charm. On CygWin I of course use other CFLAGS.

Thanks again for all your (I might say QUICK) help! Now I can proceed making
_actual_ software :-)

Jeroen





reply via email to

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