I am trying to figure out how to do conditional sources. Basically, here is the setup:
lib/uuid.c lib32/uuid.c If I pass --with-m32 to configure, I want to use the second source. If I don't, then I want to use the first. I put this in configure.ac: AC_ARG_WITH(m32, [ --with-m32 Compile lib32 stuff.. testing only], [ WITH_32=yes ], [ WITH_32= ]) AM_CONDITIONAL(WITH32, test x$WITH_32 != x) And I put this in Makefile.am: if WITH32 crtdir=$(prefix)/lib32 uuidsrc = lib32/uuid.c else crtdir=$(prefix)/$(target)/lib uuidsrc = lib/uuid.c endif crtlibs_LIBRARIES += libuuid.a libuuid_a_SOURCES = $(uuidsrc) When I run autoreconf, I get this: Makefile.am: object `uuid.$(OBJEXT)' created by `lib32/uuid.c' and `lib/uuid.c' make: *** [../crttest/Makefile.in] Error 1 Any ideas?