This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
RE: Conditional Library Compilation
- From: "Drummonds, Scott B" <scott dot b dot drummonds at intel dot com>
- To: <automake at gnu dot org>
- Cc: Alexandre Duret-Lutz <adl at src dot lip6 dot fr>
- Date: Tue, 3 Feb 2004 14:35:42 -0800
- Subject: RE: Conditional Library Compilation
From: Alexandre Duret-Lutz [mailto:adl@src.lip6.fr]
> 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