diff -aurN dbus-glib-0.78.orig/configure.ac dbus-glib-0.78/configure.ac --- dbus-glib-0.78.orig/configure.ac 2008-12-06 12:28:39.000000000 +0100 +++ dbus-glib-0.78/configure.ac 2008-12-06 12:50:23.000000000 +0100 @@ -628,20 +628,8 @@ ]) 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) - -if ! $have_expat ; then - AC_MSG_ERROR([expat library not found, check config.log for failed attempts]) -fi - -XML_LIBS=-lexpat -XML_CFLAGS= - +# expat check +AM_WITH_EXPAT #### Set up final flags DBUS_CLIENT_CFLAGS= @@ -649,8 +637,8 @@ AC_SUBST(DBUS_CLIENT_CFLAGS) AC_SUBST(DBUS_CLIENT_LIBS) -DBUS_BUS_CFLAGS=$XML_CFLAGS -DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS $INTLLIBS" +DBUS_BUS_CFLAGS=$EXPAT_CFLAGS +DBUS_BUS_LIBS="$EXPAT_LIBS $SELINUX_LIBS $INTLLIBS" AC_SUBST(DBUS_BUS_CFLAGS) AC_SUBST(DBUS_BUS_LIBS) @@ -700,8 +688,8 @@ AC_SUBST(DBUS_GLIB_LIBS) AC_SUBST(DBUS_GLIB_THREADS_LIBS) -DBUS_GLIB_TOOL_CFLAGS=$XML_CFLAGS -DBUS_GLIB_TOOL_LIBS="$XML_LIBS $INTLLIBS" +DBUS_GLIB_TOOL_CFLAGS=$EXPAT_CFLAGS +DBUS_GLIB_TOOL_LIBS="$EXPAT_LIBS $INTLLIBS" AC_SUBST(DBUS_GLIB_TOOL_CFLAGS) AC_SUBST(DBUS_GLIB_TOOL_LIBS) @@ -881,7 +869,6 @@ Building Gtk-doc docs: ${enable_gtk_doc} Bash Completion: ${enable_bash_completion} Gettext libs (empty OK): ${INTLLIBS} - Using XML parser: ${with_xml} 'make check' socket dir: ${TEST_SOCKET_DIR} " diff -aurN dbus-glib-0.78.orig/dbus/Makefile.am dbus-glib-0.78/dbus/Makefile.am --- dbus-glib-0.78.orig/dbus/Makefile.am 2008-12-06 12:28:39.000000000 +0100 +++ dbus-glib-0.78/dbus/Makefile.am 2008-12-06 12:56:00.000000000 +0100 @@ -57,7 +57,7 @@ libdbus_glibdir = $(includedir)/dbus-1.0/dbus -libdbus_glib_1_la_LIBADD= $(DBUS_LIBS) $(DBUS_GLIB_LIBS) +libdbus_glib_1_la_LIBADD= $(DBUS_LIBS) $(DBUS_GLIB_LIBS) $(EXPAT_LIBS) ## don't export symbols that start with "_" (we use this ## convention for internal symbols) libdbus_glib_1_la_LDFLAGS= -export-symbols-regex "^[^_].*" -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -no-undefined @@ -82,7 +82,7 @@ dbus-glib-tool.h \ dbus-glib-tool.c -dbus_binding_tool_LDADD= libdbus-gtool.la libdbus-glib-1.la $(DBUS_LIBS) $(DBUS_GLIB_LIBS) -lexpat +dbus_binding_tool_LDADD= libdbus-gtool.la libdbus-glib-1.la $(DBUS_LIBS) $(DBUS_GLIB_LIBS) $(EXPAT_LIBS) ## we just rebuilt these manually and check them into cvs; easier than ## convincing automake/make to do this properly @@ -104,7 +104,7 @@ dbus_bash_completion_helper_SOURCES = \ dbus-bash-completion-helper.c -dbus_bash_completion_helper_LDADD=$(DBUS_LIBS) $(DBUS_GLIB_LIBS) -lexpat libdbus-gtool.la libdbus-glib-1.la +dbus_bash_completion_helper_LDADD=$(DBUS_LIBS) $(DBUS_GLIB_LIBS) $(EXPAT_LIBS) libdbus-gtool.la libdbus-glib-1.la EXTRA_DIST=dbus-gmarshal.list make-dbus-glib-error-switch.sh make-dbus-glib-error-enum.sh dbus-bash-completion.sh.in diff -aurN dbus-glib-0.78.orig/m4/Makefile.am dbus-glib-0.78/m4/Makefile.am --- dbus-glib-0.78.orig/m4/Makefile.am 2008-12-06 12:28:39.000000000 +0100 +++ dbus-glib-0.78/m4/Makefile.am 2008-12-06 12:51:11.000000000 +0100 @@ -1 +1 @@ -EXTRA_DIST = gtk-doc.m4 +EXTRA_DIST = expat.m4 gtk-doc.m4 diff -aurN dbus-glib-0.78.orig/m4/expat.m4 dbus-glib-0.78/m4/expat.m4 --- dbus-glib-0.78.orig/m4/expat.m4 1970-01-01 01:00:00.000000000 +0100 +++ dbus-glib-0.78/m4/expat.m4 2008-12-06 13:05:04.000000000 +0100 @@ -0,0 +1,43 @@ +dnl Check if --with-expat[=PREFIX] is specified and +dnl Expat >= 1.95.0 is installed in the system. +dnl If yes, substitute EXPAT_CFLAGS, EXPAT_LIBS with regard to +dnl the specified PREFIX and set with_expat to PREFIX, or 'yes' if PREFIX +dnl has not been specified. Also HAVE_LIBEXPAT, HAVE_EXPAT_H are defined. +dnl If --with-expat has not been specified, set with_expat to 'no'. +dnl In addition, an Automake conditional EXPAT_INSTALLED is set accordingly. +dnl This is necessary to adapt a whole lot of packages that have expat +dnl bundled as a static library. +AC_DEFUN([AM_WITH_EXPAT], +[ AC_ARG_WITH(expat, + [ --with-expat=PREFIX Use system Expat library], + , with_expat=yes) + + AM_CONDITIONAL(EXPAT_INSTALLED, test $with_expat != no) + + EXPAT_CFLAGS= + EXPAT_LIBS= + if test $with_expat != no; then + if test $with_expat != yes; then + EXPAT_CFLAGS="-I$with_expat/include" + EXPAT_LIBS="-L$with_expat/lib" + fi + AC_CHECK_LIB(expat, XML_ParserCreate, + [ EXPAT_LIBS="$EXPAT_LIBS -lexpat" + expat_found=yes ], + [ expat_found=no ], + "$EXPAT_LIBS") + if test $expat_found = no; then + AC_MSG_ERROR([Could not find the Expat library]) + fi + expat_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $EXPAT_CFLAGS" + AC_CHECK_HEADERS(expat.h, , expat_found=no) + if test $expat_found = no; then + AC_MSG_ERROR([Could not find expat.h]) + fi + CFLAGS="$expat_save_CFLAGS" + fi + + AC_SUBST(EXPAT_CFLAGS) + AC_SUBST(EXPAT_LIBS) +])