automake
[Top][All Lists]
Advanced

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

Re: any way to set an automake variable in a top-level automake file, an


From: Ed Hartnett
Subject: Re: any way to set an automake variable in a top-level automake file, and have it apply to subdirs?
Date: Fri, 04 Nov 2005 10:15:29 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

Ralf Wildenhues <address@hidden> 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  -- address@hidden





reply via email to

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