[Glade-users] Include others libraries in a Glade project
Damon Chaplin
damon@helixcode.com
Mon, 11 Sep 2000 14:21:41 +0100
Marc Billaud wrote:
>
> Hello everybody
>
> I want to ask you some questions that could have already included in the
> FAQ. I need to include external libraries in order to compile and make
> link edit of programs which need the libXml2-2.2.0 (the last one of the
> W3C) inside a glade project.
> _Are there any risks of libraries conflicts with the ones that are used
> by Glade ?
> _What is the easy way to do this ?
I think there would be a conflict if you use libglade, since it probably
depends on the 1.8.X versions of libxml.
But if you're just using Glade-generated source you should be OK.
> In the FAQ,(may be old) that I ve printed, explanations are given on how
> to modify "/src/Makefile.am" in order to include .c and .h for the own
> code we need to include inside a Glade project but I haven't seen any
> details regarding the extern libraries which we could need to insert for
> compilation.
>
> Exple:of my own "/src/Makefile.am":
>
> XLIBS=`/usr/local/bin/xml-config --libs`
> XFLAGS=`/usr/local/bin/xml-config --cflags`
>
> INCLUDES = \
> $(XFLAGS) \
> -I$(top_srcdir)/intl \
> $(GNOME_INCLUDEDIR)
>
> bin_PROGRAMS = project2
>
> project2_SOURCES = \
> main.c \
> support.c support.h \
> interface.c interface.h \
> callbacks.c callbacks.h
>
> project2_LDADD = $(XLIBS) $(GNOME_LIBDIR) $(GNOMEUI_LIBS) $(INTLLIBS)
>
> This configuration of file failed because both variables XLIBS and
> XFLAGS are not recognised properly.
As someone else said, you should probably be determining the position
of the XML libs in configure.in
You could try adding something like this to configure.in:
dnl Get libxml flags & libs
AC_PATH_PROG(xml_config, xml-config)
if test "x$xml_config" = "x"; then
AC_MSG_ERROR([*** xml-config not found.])
fi
XML_CFLAGS=`$xml_config --cflags 2>/dev/null`
XML_LIBS=`$xml_config --libs 2>/dev/null`
CPPFLAGS="$XML_CFLAGS $CPPFLAGS"
LIBS="$XML_LIBS $LIBS"
Damon