automake
[Top][All Lists]
Advanced

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

RE: Conditional Library Compilation


From: Drummonds, Scott B
Subject: RE: Conditional Library Compilation
Date: Tue, 3 Feb 2004 14:35:42 -0800

From: Alexandre Duret-Lutz [mailto:address@hidden 
> What are the symptoms?  (i.e., what "doesn't work" means?)

To follow up with even more detail about this, Makefile.am looks like
this:

<quote>
noinst_LIBRARIES = libNormal.a

if FEATURE
  noinst_LIBRARIES += libNormalFeature.a
endif

libNormal_a_SOURCES = source.cpp

if FEATURE
  libNormalFeature_a_SOURCES = $(libNormal_a_SOURCES)
  libNormalFeature_a_CXXFLAGS = -DFEATURE
endif
</quote>

But, the Makefile that is generated from that Makefile.am has the above
statements in the following order:

<quote>
noinst_LIBRARIES = libNormal.a
...
libNormal_a_SOURCES = source.cpp
...
LIBRARIES =  $(noinst_LIBRARIES)
...
  noinst_LIBRARIES += libNormalFeature.a
  libNormalFeature_a_SOURCES = $(libNormal_a_SOURCES)
  libNormalFeature_a_CXXFLAGS = -DFEATURE
</quote>

Since LIBRARIES gets set with the value of noinst_LIBRARIES before it is
augmented to include my special library, doesn't that mean that the
special library won't ever get built?  Why is the 'noinst_LIBRARIES +='
code in the conditional statement being inserted so late in the file
even though it is specified right after the original 'noinst_LIBRARIES =
' statement?

Scott




reply via email to

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