>>> "Filip" == Filip Kaliński <[EMAIL PROTECTED]> writes:

 Filip> I have AM_CONDITIONAL(ENABLE_BAR, ... ) in configure.in
 Filip> and I want to have

 Filip> if ENABLE_BAR
 Filip> lib_LTLIBARAIES=libfoo.la
 Filip> libfoo_la_LDADD=-lbaz
 Filip> ...
 Filip> else
 Filip> noninst_LTILIBRARIES=libfoo.la
 Filip> ...
 Filip> endif

 Filip> in Makefile.am, but it doesn't work, automake wants to
 Filip> define both of ..._LTLIBRARIES and screams that it is
 Filip> alredy defined (while parsing second) :-(

This looks like a bug.

 Filip> Does anyone know how to solve it?

I think you can workaround Automake as follows (untested):

  EXTRA_LTLIBRARIES = libfoo.la
  libfoo_la_SOURCES = ...

  if ENABLE_BAR
  lib_LTLIBRARIES = @LIBFOO1@
  libfoo_la_LIBADD = -lbaz
  libfoo_la_LDFLAGS = -rpath $(libdir)
  else
  noinst_LTLIBRARIES = @LIBFOO2@
  endif

and add  

  AC_SUBST([LIBFOO1], [libfoo.la])
  AC_SUBST([LIBFOO2], [libfoo.la])

to your configure.ac.

-- 
Alexandre Duret-Lutz


Reply via email to