Perhaps this is a FAQ, but I can't seem to find the answer anywhere:
What's the proper way of telling automake that the same source file
needs to be compiled multiple times with different options.
For example, I have a file called foo.c and I'd like to compile it
once with the normal options and once with -DBAR defined. The
resulting two objects would have to go into the same library (foo.c
will define different global symbols depending on whether or not BAR
is defined).
I supposed I could have autoconf generate a stub source file
foo-BAR.c which contains:
#define BAR
#include "foo.c"
and then have configure expand these files into _LDADD variable, but
I'm unsure whether this is the best way of making this work.
Suggestions?
Thanks,
--david