Thanks Sjoerd for your answer. I think COND is the one I was looking for. However defining a library twice with different conditions ignores the second condition. Is their also the possibility for EITHER/OR (in the following example HAVE_BAR?bar.c:bar_alternative.c)? I tried it the following way (where HAVE_BAR is not HAVE_NO_BAR): lib_foo = { COND = HAVE_BAR NOINST DIR = libdir SOURCES = \ foo1.c \ foo2.c \ bar.c } lib_foo = { COND = HAVE_NO_BAR NOINST DIR = libdir SOURCES = \ foo1.c \ foo2.c \ bar_alternative.c } On 01/15/2007 04:16 PM, Sjoerd Mullender wrote with possible deletions:
On 2007-01-15 15:54, Jan Rittinger wrote:
Hi Niels, hi Sjoerd,
Based on a condition in configure I want to compile different files.
I know that it is possible to include a directory based on a condition, but couldn't find a solution for files. Is there any?
-- If that's not possible is there some magic for the Makefile.ag files to write a snippet of code that survives autoconf and automake without changes?
Jan
Look for COND in Makefile.ag. There are some that have that, and that's what you can use. There's even one in pathfinder in src/tools/Makefile.ag.