automake
[Top][All Lists]
Advanced

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

Re: ifdef ... endif issue


From: Daniel Leidert
Subject: Re: ifdef ... endif issue
Date: Mon, 27 Aug 2007 00:37:00 +0200

Am Sonntag, den 26.08.2007, 01:28 +0200 schrieb Benoit SIGOURE:
> On Aug 26, 2007, at 12:04 AM, Daniel Leidert wrote:

[..]
> > I wanted to use this code in one of my Makefiles:
> >
> > ifdef WIN32_EXTRA_LDFLAGS
> > WIN32_EXTRA_LDFLAGS += -export-symbols $(srcdir)/entities.def
> > endif
> >
> > But that doesn't work. automake complains:
> >
> > src/plugin_entities/Makefile.am:22: WIN32_EXTRA_LDFLAGS must be set  
> > with
> > `=' before using `+='
> > src/plugin_entities/Makefile.am:23: endif without if
> >
> > 1. Shouldn't automake stop complaining about setting  
> > WIN32_EXTRA_LDFLAGS
> > first, when I test for its existence?
> >
> > 2. Why is automake complaining about the endif "without" if? The
> > ifdef...endif condition is part of make and I know several Makefiles,
> > that use it. Is it a bug in automake?
> 
> I don't think you can do what you're trying to achieve.  AFAIK the  
> if .. endif syntax used by automake is for conditionals only (see:  
> http://www.gnu.org/software/automake/manual/html_node/ 
> Conditionals.html) and there is nothing such as "ifdef".

ifdef...endif is GNU make syntax. I found some old mail now, that tells
me, that automake doesn't accept that syntax, although it doesn't need
to process it. The ifdef...endif syntax would be interpreted by GNU
make. Of course
my example probably would need to be interpreted by automake too,
because WIN32_EXTRA_LDFLAGS is set, before it gets extended. But to know
that, automake would need to understand this syntax.

However, what I wanted to do is not possible atm, so I restored the old
Makefile code.

Regards, Daniel





reply via email to

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