Why is it that using '+=' inside an 'if' with automake causes errors?

Here is an example makefile.am illustrating the offending behavior:

DUMMY = a

if SOME_CONDITION
DUMMY += b
endif

---
This prompts automake to produce the following error:
Makefile.am:1: DUMMY was already defined in condition TRUE, which implies 
condition SOME_CONDITION

   DUMMY (User, where = 1) +=
   {
     TRUE => a
   }

Since 'DUMMY' is previously unconditionally defined, I don't see a way that 
it could cause an error later. Automake should allow the definition.

I know that Automake likes to collect all definitions of a particular macro 
into a single definition. Couldn't Automake make an exception with '+=' in 
conditionals?

Can anyone point to me what I am doing wrong or provide a workaround?

Thank you,

Jean-Bernard Delva


Reply via email to