]> git.meshlink.io Git - catta/blobdiff - configure.ac
Allow compilation against bsdxml instead of Expat. Patch from zml. (Closes #159)
[catta] / configure.ac
index 8d8659b4549316e06ae872ccebe743e9f0679616..7dc41700385761214e67eaf201b2ae0fb1bab455 100644 (file)
@@ -32,6 +32,7 @@ AC_SUBST(LIBAVAHI_COMMON_VERSION_INFO, [7:5:4])
 AC_SUBST(LIBAVAHI_CORE_VERSION_INFO, [5:3:0])
 AC_SUBST(LIBAVAHI_CLIENT_VERSION_INFO, [5:3:2])
 AC_SUBST(LIBAVAHI_GLIB_VERSION_INFO, [1:1:0])
+AC_SUBST(LIBAVAHI_GOBJECT_VERSION_INFO, [0:0:0])
 AC_SUBST(LIBAVAHI_QT3_VERSION_INFO, [1:1:0])
 AC_SUBST(LIBAVAHI_QT4_VERSION_INFO, [1:1:0])
 AC_SUBST(LIBAVAHI_UI_VERSION_INFO, [0:2:0])
@@ -418,12 +419,31 @@ AC_ARG_ENABLE(glib,
         [HAVE_GLIB=yes])
 
 if test "x$HAVE_GLIB" = "xyes" ; then
-        PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 gobject-2.0 ])
+        PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ])
         AC_SUBST(GLIB20_CFLAGS)
         AC_SUBST(GLIB20_LIBS)
 fi
 AM_CONDITIONAL(HAVE_GLIB, test "x$HAVE_GLIB" = "xyes")
 
+#
+# Check for GLIB's gobject 2.0
+#
+AC_ARG_ENABLE(gobject,
+        AS_HELP_STRING([--disable-gobject],[Disable use of GLib GObject]),
+        [case "${enableval}" in
+                yes) HAVE_GOBJECT=yes ;;
+                no)  HAVE_GOBJECT=no ;;
+                *) AC_MSG_ERROR(bad value ${enableval} for --enable-gobject) ;;
+        esac],
+        [HAVE_GOBJECT=yes])
+
+if test "x$HAVE_GOBJECT" = "xyes" ; then
+        PKG_CHECK_MODULES(GOBJECT, [ glib-2.0 >= 2.4.0 gobject-2.0 ])
+        AC_SUBST(GOBJECT_CFLAGS)
+        AC_SUBST(GOBJECT_LIBS)
+fi
+AM_CONDITIONAL(HAVE_GOBJECT, test "x$HAVE_GOBJECT" = "xyes")
+
 #
 # Check for Qt 3
 #
@@ -592,23 +612,55 @@ AM_CONDITIONAL(HAVE_DBUS, test "x$HAVE_DBUS" = "xyes")
 #
 # Expat
 #
-AC_ARG_ENABLE(expat,
-        AS_HELP_STRING([--disable-expat],[Disable use of Expat]),
-        [case "${enableval}" in
-                yes) HAVE_EXPAT=yes ;;
-                no)  HAVE_EXPAT=no ;;
-                *) AC_MSG_ERROR(bad value ${enableval} for --enable-expat) ;;
-        esac],
-        [HAVE_EXPAT=yes])
+AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[expat/bsdxml/none]],[XML library to use]))
+use_expat=false
+use_bsdxml=false
+
+# See what we have
+AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false)
+AC_CHECK_LIB(bsdxml, XML_ParserCreate, [ AC_CHECK_HEADERS(bsdxml.h, have_bsdxml=true, have_bsdxml=false) ], have_bsdxml=false)
+
+if test "x$with_xml" = "xnone"; then
+elif test "x$with_xml" = "xexpat"; then
+       use_expat=true
+       if ! $have_expat ; then
+               AC_MSG_ERROR([*** libexpat requested, but not found ***])
+       fi
+elif test "x$with_xml" = "xbsdxml"; then
+       use_bsdxml=true
+       if ! $have_bsdxml ; then
+               AC_MSG_ERROR([*** libbsdxml requested, but not found ***])
+       fi
+elif test "x$with_xml" != "x"; then
+       AC_MSG_ERROR([*** unknown with-xml option ***])
+else
+       if $have_expat ; then
+               use_expat=true
+       elif $have_bsdxml ; then
+               use_bsdxml=true
+       else
+               AC_MSG_ERROR([*** neither libexpat not libbsdxml could be found ***])
+       fi
+fi
 
-if test "x$HAVE_EXPAT" = "xyes" ; then
-    AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false)
+if $use_expat; then
+       with_xml=expat
+       XML_CLAGS=-DUSE_EXPAT_H
+       XML_LIBS=-lexpat
+fi
+if $use_bsdxml; then
+       with_xml=bsdxml
+       XML_CFLAGS=-DUSE_BSDXML_H
+       XML_LIBS=-lbsdxml
+fi
+AC_SUBST(XML_LIBS)
+AC_SUBST(XML_CFLAGS)
 
-    if ! $have_expat ; then
-        AC_MSG_ERROR([*** libexpat not found ***])
-    fi
+if $use_expat || $use_bsdxml; then
+       HAVE_XML=yes
 fi
-AM_CONDITIONAL(HAVE_EXPAT, test "x$HAVE_EXPAT" = "xyes")
+
+AM_CONDITIONAL(HAVE_XML, test "x$HAVE_XML" = "xyes")
 
 #
 # GDBM
@@ -877,7 +929,7 @@ DX_CHM_FEATURE(OFF)
 DX_CHI_FEATURE(OFF)
 DX_MAN_FEATURE(OFF)
 DX_RTF_FEATURE(OFF)
-DX_XML_FEATURE(OFF)
+DX_XML_FEATURE(ON)
 DX_PDF_FEATURE(OFF)
 DX_PS_FEATURE(OFF)
 DX_INIT_DOXYGEN(avahi, doxygen.cfg, doxygen)
@@ -980,6 +1032,7 @@ Makefile
 avahi-common/Makefile
 avahi-core/Makefile
 avahi-glib/Makefile
+avahi-gobject/Makefile
 avahi-qt/Makefile
 avahi-daemon/Makefile
 avahi-daemon/avahi-dbus.conf
@@ -1029,9 +1082,10 @@ echo "
     C Compiler:                                ${CC}
     CFLAGS:                                    ${CFLAGS}
     Enable GLIB:                               ${HAVE_GLIB}
+    Enable GLIB GObject:                       ${HAVE_GOBJECT}
     Enable GTK:                                ${HAVE_GTK}
     Enable D-Bus:                              ${HAVE_DBUS}
-    Enable Expat:                              ${HAVE_EXPAT}
+    With XML:                                  ${with_xml}
     Enable GDBM:                               ${HAVE_GDBM}
     Enable DBM:                                ${HAVE_DBM}
     Enable libdaemon:                          ${HAVE_LIBDAEMON}
@@ -1053,9 +1107,9 @@ echo "
     Enable stack-smashing protection:          ${enable_ssp}
 "
 
-BUILD_DAEMON="no   (You need libdaemon and expat!)"
+BUILD_DAEMON="no   (You need libdaemon and expat/bsdxml!)"
 
-if test "x$HAVE_EXPAT" = "xyes" -a "x$HAVE_LIBDAEMON" = "xyes" ; then
+if test "x$HAVE_XML" = "xyes" -a "x$HAVE_LIBDAEMON" = "xyes" ; then
     BUILD_DAEMON=yes
 fi
 
@@ -1094,6 +1148,7 @@ echo "\
     Building avahi-utils:               ${BUILD_CLIENT}
     Building avahi-python:              ${BUILD_PYTHON}
     Building libavahi-glib:             ${HAVE_GLIB}
+    Building libavahi-gobject:          ${HAVE_GOBJECT}
     Building avahi-discover-standalone: ${HAVE_GTK}
     Building libavahi-qt3:              ${HAVE_QT3}
     Building libavahi-qt4:              ${HAVE_QT4}