automake-ng
[Top][All Lists]
Advanced

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

Re: [Automake-NG] [PATCH] [ng] utils: new function 'am.vars.is-undef'


From: Stefano Lattarini
Subject: Re: [Automake-NG] [PATCH] [ng] utils: new function 'am.vars.is-undef'
Date: Sat, 28 Jul 2012 10:09:41 +0200

HI Jim.

On 07/28/2012 09:32 AM, Jim Meyering wrote:
> Stefano Lattarini wrote:
>> Sometimes, in our makefiles, we want to assign a default value to a
>> variable that might not have been assigned yet.  One might think that
>> using the GNU make assignment '?=' is enough:
>>
>>     VAR ?= DEFAULT-VALUE
>>
>> But alas, such an usage allow environment overrides; i.e., if an
> 
> s/an /
> s/allow/allows/
> 
>> environment variable named 'VAR' is present there and defined to,
> 
> s/is present there /
> 
>> say, BAD-VALUE, the construct above will result in the $(VAR) make
>> variable being defined to BAD-VALUE, not to DEFAULT-VALUE.
>>
>> To help overcoming this situation, we define a new make function
> 
> At first I was going to say s/ing//, but how about rewording?
> 
>     Use the 'am.vars.is-undef' function to avoid this situation.
>     It tells whether the given make variable is ...
> 
>> 'am.vars.is-undef', that tells whether the given make variable is
>> not "safely" defined, i.e., either undefined, or defined to a value
>> that is inherited from the environment.
>>
Good advice, as usual.  I've amended the comments and the commit message
following all your suggestions, and pushed.

Thanks,
  Stefano




reply via email to

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