Ralf Wildenhues <[EMAIL PROTECTED]> writes:

> Hi Ed,
>
> * Ed Hartnett wrote on Fri, Nov 04, 2005 at 02:57:44PM CET:
>> 
>> Is there any way to set an automake variable in the top-level automake
>> file? (That is, the file which contains SUBDIRS = ...)
>> 
>> I find myself setting AM_CFLAGS=-g in many subdirectories. Also I am
>> setting AM_LDFLAGS everywhere to point to a library directory that the
>> user can specify at configure time.
>> 
>> Surely there is an easier way?
>
> Why not just put
>
>   AC_SUBST([AM_CFLAGS], [-g])
>
> in configure.ac?  Automake will end put in all Makefile.in's
>   AM_CFLAGS = @AM_CFLAGS@
> then and configure will substitute @AM_FLAGS@ with -g then.
>
> Note though that many compilers cannot mix -g and optimization options;
> you should allow the user the override with CFLAGS without breaking this.
>

How exactly would I be sure to allow that?

How does everyone else handle this? Is it usual to turn on -g
everywhere?

It would be really convenient from a testing point of view if it were
on by default, but most users are just using, not testing, the library
involved.

What's the common practice here in automake land? (If any...)

Thanks!

Ed

-- 
Ed Hartnett  -- [EMAIL PROTECTED]



Reply via email to