summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-03-26 07:16:03 +0000
committerHavoc Pennington <hp@redhat.com>2003-03-26 07:16:03 +0000
commit269d74f214f87bed0f6fd58f1c848240d31e0b9f (patch)
tree61da2c953118a7e4459d8288e32246a369e0b66a /configure.in
parent90ed1d84588a84697051e643175452c50d682ece (diff)
2003-03-26 Havoc Pennington <hp@pobox.com>
* bus/test-main.c, dbus/dbus-test.c (main): check memleaks after every test so it's quick and easy to see which leaked, and so we test multiple dbus_shutdown() calls * configure.in: change configure.in XML stuff to also support expat * config-loader-libxml.c: some hacking * config-loader-expat.c: some hacking * config-parser.c: some hacking, plus tests
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in76
1 files changed, 54 insertions, 22 deletions
diff --git a/configure.in b/configure.in
index 552a7cfa..7212f3be 100644
--- a/configure.in
+++ b/configure.in
@@ -31,7 +31,7 @@ AC_ARG_ENABLE(verbose-mode, [ --enable-verbose-mode support verbose debug mode]
AC_ARG_ENABLE(asserts, [ --enable-asserts include assertion checks],enable_asserts=$enableval,enable_asserts=yes)
AC_ARG_ENABLE(gcov, [ --enable-gcov compile with coverage profiling instrumentation (gcc only)],enable_gcov=$enableval,enable_gcov=no)
-AC_ARG_WITH(xml, [ --with-xml=[libxml] XML library to use])
+AC_ARG_WITH(xml, [ --with-xml=[libxml/expat] XML library to use])
dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
dnl and also some stuff in the test/ subdir
@@ -47,23 +47,6 @@ if test x$enable_asserts = xno; then
AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
fi
-dbus_use_libxml=false
-dbus_use_fooxml=false
-if test x$with_xml = xfooxml; then
- dbus_use_fooxml=true
-elif test x$with_xml = xlibxml; then
- dbus_use_libxml=true
-else
- with_xml=libxml
- dbus_use_libxml=true
-fi
-
-AM_CONDITIONAL(DBUS_USE_LIBXML, $dbus_use_libxml)
-if $dbus_use_libxml; then
- PKG_CHECK_MODULES(LIBXML, libxml-2.0)
-fi
-AM_CONDITIONAL(DBUS_USE_FOOXML, $dbus_use_fooxml)
-
if test "x$GCC" = "xyes"; then
changequote(,)dnl
case " $CFLAGS " in
@@ -137,8 +120,6 @@ else
fi
fi
-
-
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(long)
@@ -238,13 +219,64 @@ if test x$dbus_have_struct_cmsgcred = xyes; then
AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
fi
+
+#### Sort out XML library
+
+# see what we have
+AC_CHECK_LIB(expat, XML_ParserCreate_MM,
+ [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ],
+ have_expat=false)
+
+PKG_CHECK_MODULES(LIBXML, libxml-2.0, have_libxml=true, have_libxml=false)
+
+# see what we want to use
+dbus_use_libxml=false
+dbus_use_expat=false
+if test x$with_xml = xexpat; then
+ dbus_use_expat=true
+ if ! $have_expat ; then
+ AC_MSG_ERROR([Explicitly requested expat but expat not found])
+ fi
+elif test x$with_xml = xlibxml; then
+ dbus_use_libxml=true
+ if ! $have_libxml ; then
+ AC_MSG_ERROR([Explicitly requested libxml but libxml not found])
+ fi
+else
+ ### expat is the default because libxml can't currently survive
+ ### our brutal OOM-handling unit test setup. Need to find the
+ ### bugs and submit to DV
+ if $have_expat ; then
+ with_xml=expat
+ dbus_use_expat=true
+ elif $have_libxml ; then
+ with_xml=libxml
+ dbus_use_libxml=true
+ else
+ AC_MSG_ERROR([No XML library found, check config.log for failed attempts])
+ fi
+fi
+
+AM_CONDITIONAL(DBUS_USE_EXPAT, $dbus_use_expat)
+AM_CONDITIONAL(DBUS_USE_LIBXML, $dbus_use_libxml)
+
+if $dbus_use_expat; then
+ XML_LIBS=-lexpat
+ XML_CFLAGS=
+fi
+if $dbus_use_libxml; then
+ XML_LIBS=$LIBXML_LIBS
+ XML_CFLAGS=$LIBXML_CFLAGS
+fi
+
+#### Set up final flags
DBUS_CLIENT_CFLAGS=
DBUS_CLIENT_LIBS=
AC_SUBST(DBUS_CLIENT_CFLAGS)
AC_SUBST(DBUS_CLIENT_LIBS)
-DBUS_BUS_CFLAGS=$LIBXML_CFLAGS
-DBUS_BUS_LIBS=$LIBXML_LIBS
+DBUS_BUS_CFLAGS=$XML_CFLAGS
+DBUS_BUS_LIBS=$XML_LIBS
AC_SUBST(DBUS_BUS_CFLAGS)
AC_SUBST(DBUS_BUS_LIBS)