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

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

 



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



_______________________________________________
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