autoconf/automake: conditional compilation/linking





Hi,

I'm trying to get autoconf/automake to conditionally
compile some code depending on the presence of certain
libraries.

Here's what I'm doing (in Makefile.am, LIBFLAG is set
in configure):


files = main.cc file1.cc file2.cc
#if LIBFLAG
     prog_SOURCES = $(files) file3.cc
#else
     prog_SOURCES = $(files)
#endif


At this point I must admit that I'm a bit confused
here (as I generally seem to be when it comes to
autoconf/automake). I've tried #if, #ifdef, the shell script
type if and anything else that seems reasonable but
have never gotten to the point where file3.cc is
actually appended to the build list. Could
anybody enlight me as to what I'm doing wrong?

Thanks alot
--> Robert




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