On Mon, 26 Jun 2000, Tom Tromey wrote:

> Mo> libtkgs_la_SOURCES += @SYSINIT@
> 
> If we had a FAQ this would be one.

Need more examples in the docs!

> Mo> Whats the deal? How the heck do I compile
> Mo> something conditionally?
> 
> You use an automake conditional.
> 
>     if FOO
>     srcs = whatever for sysinit
>     endif
>     libtkgs_la_SOURCES = unconditional sources $(srcs)
> 
> Tom


Ok, I tried that. I defined my var like so:

AM_CONDITIONAL(WIN, test "$PLATFORM" = "win")
AM_CONDITIONAL(UNIX, test "$PLATFORM" = "unix")



Then I put this in Makefile.am:

if WIN
sysinit = tkgsWinInit.c
endif

if UNIX
sysinit = tkgsUnixInit.c
endif

libtkgs_la_SOURCES = \
tkgs.c \
tkgs.h \
tkgsColor.c \
tkgsColor.h \
tkgsDrawable.c \
tkgsDrawable.h \
tkgsDriver.h \
tkgsFont.c \
tkgsInit.c \
tkgsInt.h \
tkgsObj.c \
tkgsObj.h \
tkgsUnixInit.c \
$(sysinit)


But I still get an error when I run automake.

src/Makefile.am:15: warning: automake does not support conditional 
definition of sysinit in libtkgs_la_SOURCES

I am using the CVS versions of autoconf, automake, and libtool
(the ML branch).

Mo DeJong
Red Hat Inc

Reply via email to