Conditionals in autoconf/make



Hi,

I'm trying to integrate the gnome-canvas-pixbuf item into a GNOME 1.x
application, while leaving a path open to GNOME 2.0, using autoconf
checks.  I copied gnome-canvas-pixbuf.[ch] into my application
directory, to conditionally compile in case the user has a GNOME 1.x
install.  Here's my intial pass, which unfortunately doesn't work:

-------------------

<configure.in>
AC_CHECK_LIB(gnomeui, gnome_canvas_pixbuf_get_type, ,
 [GNOME_1_X_SOURCES="gnome-canvas-pixbuf.c"
  AC_SUBST(GNOME_1_X_SOURCES)
  AC_MSG_RESULT([*** Using local version of gnome-canvas-pixbuf...])],
 `gnome-config --libs gnomeui`)

<Makefile.am>
bin_PROGRAMS = anvil
anvil_SOURCES = $(GNOME_1_X_SOURCES) <etc...>

-------------------

It works fine if I put "gnome-canvas-pixbuf.c" directly into
anvil_SOURCES, but ignores it when I put it in as $(GNOME_1_X_SOURCES).
Is this something goofy with automake?

Am I going about this in the wrong way?  It seems like this is something
that would have come up before.  What's the officially encouraged way?
I did notice AM_CONDITIONAL, but that looks more geared towards
command-line configure options.

John



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]