automake
[Top][All Lists]
Advanced

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

Conditional Library Compilation


From: Drummonds, Scott B
Subject: Conditional Library Compilation
Date: Tue, 3 Feb 2004 09:41:26 -0800

Hi, everyone,

I've been playing around with the conditionals as defined in the
documentation but have been unable to achieve one of my build
environment goals.  I'm hoping someone can help me with this: I want to
be able to build an additional library (using the same source as an
existing library target, but with a preprocessor variable defined) based
on a parameter to 'configure'.

I've got configure properly working.  When "--enable-myfeature" is
specified, AM_CONDITIONAL(FEATURE, true) is set.  So, I am able to use a
'FEATURE' conditional in my Makefile.am.  But, the following doesn't
work:

if FEATURE
  EXTRA_LIBS=libMyLib.a
endif

noinst_LIBRARIES = ... $(EXTRA_LIBS)

It seems that, when FEATURE is set, the code inside the conditional is
inserted after the noinst_LIBRARIES statement.  As such, the EXTRA_LIBS
variable is empty and my additional library is not added as a target.

How do I have an additional library built based on a Automake
conditional?

Thanks,
Scott




reply via email to

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