Ticket #159: avahi_use_bsdxml.patch

File avahi_use_bsdxml.patch, 4.7 kB (added by zml, 1 year ago)
  • avahi-daemon/static-services.c

    old new  
    3131#include <fcntl.h> 
    3232#include <unistd.h> 
    3333 
     34#ifdef USE_EXPAT_H 
    3435#include <expat.h> 
     36#endif /* USE_EXPAT_H */ 
     37 
     38#ifdef USE_BSDXML_H 
     39#include <bsdxml.h> 
     40#endif /* USE_BSDXML_H */ 
    3541 
    3642#include <avahi-common/llist.h> 
    3743#include <avahi-common/malloc.h> 
  • avahi-daemon/Makefile.am

    old new  
    2323AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")' 
    2424 
    2525if HAVE_LIBDAEMON 
    26 if HAVE_EXPAT 
     26if HAVE_XML 
    2727 
    2828pkgsysconfdir=$(sysconfdir)/avahi 
    2929servicedir=$(pkgsysconfdir)/services 
     
    5656    ../avahi-client/check-nss.c \ 
    5757    inotify-nosys.h 
    5858 
    59 avahi_daemon_CFLAGS = $(AM_CFLAGS) $(LIBDAEMON_CFLAGS) 
    60 avahi_daemon_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la ../avahi-core/libavahi-core.la $(LIBDAEMON_LIBS) -lexpat 
     59avahi_daemon_CFLAGS = $(AM_CFLAGS) $(LIBDAEMON_CFLAGS) $(XML_CFLAGS) 
     60avahi_daemon_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la ../avahi-core/libavahi-core.la $(LIBDAEMON_LIBS) $(XML_LIBS) 
    6161 
    6262ini_file_parser_test_SOURCES = \ 
    6363    ini-file-parser.c ini-file-parser.h \ 
  • configure.ac

    old new  
    590590# 
    591591# Expat 
    592592# 
    593 AC_ARG_ENABLE(expat, 
    594         AS_HELP_STRING([--disable-expat],[Disable use of Expat]), 
    595         [case "${enableval}" in 
    596                 yes) HAVE_EXPAT=yes ;; 
    597                 no)  HAVE_EXPAT=no ;; 
    598                 *) AC_MSG_ERROR(bad value ${enableval} for --enable-expat) ;; 
    599         esac], 
    600         [HAVE_EXPAT=yes])  
     593AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[expat/bsdxml/none]],[XML library to use])) 
     594use_expat=false 
     595use_bsdxml=false 
    601596 
    602 if test "x$HAVE_EXPAT" = "xyes" ; then 
    603     AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false) 
     597# See what we have 
     598AC_CHECK_LIB(expat, XML_ParserCreate, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false) 
     599AC_CHECK_LIB(bsdxml, XML_ParserCreate, [ AC_CHECK_HEADERS(bsdxml.h, have_bsdxml=true, have_bsdxml=false) ], have_bsdxml=false) 
    604600 
    605     if ! $have_expat ; then 
    606         AC_MSG_ERROR([*** libexpat not found ***]) 
    607     fi 
     601if test "x$with_xml" = "xnone"; then 
     602elif test "x$with_xml" = "xexpat"; then 
     603    use_expat=true 
     604    if ! $have_expat ; then 
     605        AC_MSG_ERROR([*** libexpat requested, but not found ***]) 
     606    fi 
     607elif test "x$with_xml" = "xbsdxml"; then 
     608    use_bsdxml=true 
     609    if ! $have_bsdxml ; then 
     610        AC_MSG_ERROR([*** libbsdxml requested, but not found ***]) 
     611    fi 
     612elif test "x$with_xml" != "x"; then 
     613    AC_MSG_ERROR([*** unknown with-xml option ***]) 
     614else 
     615    if $have_expat ; then 
     616        use_expat=true 
     617    elif $have_bsdxml ; then 
     618        use_bsdxml=true 
     619    else 
     620        AC_MSG_ERROR([*** neither libexpat not libbsdxml could be found ***]) 
     621    fi 
    608622fi 
    609 AM_CONDITIONAL(HAVE_EXPAT, test "x$HAVE_EXPAT" = "xyes") 
    610623 
     624if $use_expat; then 
     625    with_xml=expat 
     626    XML_CLAGS=-DUSE_EXPAT_H 
     627    XML_LIBS=-lexpat 
     628fi 
     629if $use_bsdxml; then 
     630    with_xml=bsdxml 
     631    XML_CFLAGS=-DUSE_BSDXML_H 
     632    XML_LIBS=-lbsdxml 
     633fi 
     634AC_SUBST(XML_LIBS) 
     635AC_SUBST(XML_CFLAGS) 
     636 
     637if $use_expat || $use_bsdxml; then 
     638    HAVE_XML=yes 
     639fi 
     640 
     641AM_CONDITIONAL(HAVE_XML, test "x$HAVE_XML" = "xyes") 
     642 
    611643# 
    612644# GDBM 
    613645# 
     
    10281060    Enable GLIB:                               ${HAVE_GLIB} 
    10291061    Enable GTK:                                ${HAVE_GTK} 
    10301062    Enable D-Bus:                              ${HAVE_DBUS} 
    1031     Enable Expat:                              ${HAVE_EXPAT
     1063    With XML:                                  ${with_xml
    10321064    Enable GDBM:                               ${HAVE_GDBM} 
    10331065    Enable DBM:                                ${HAVE_DBM} 
    10341066    Enable libdaemon:                          ${HAVE_LIBDAEMON} 
     
    10501082    Enable stack-smashing protection:          ${enable_ssp} 
    10511083" 
    10521084 
    1053 BUILD_DAEMON="no   (You need libdaemon and expat!)" 
     1085BUILD_DAEMON="no   (You need libdaemon and expat/bsdxml!)" 
    10541086 
    1055 if test "x$HAVE_EXPAT" = "xyes" -a "x$HAVE_LIBDAEMON" = "xyes" ; then 
     1087if test "x$HAVE_XML" = "xyes" -a "x$HAVE_LIBDAEMON" = "xyes" ; then 
    10561088    BUILD_DAEMON=yes 
    10571089fi 
    10581090 
  • avahi-dnsconfd/Makefile.am

    old new  
    1717# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 
    1818# USA. 
    1919 
    20 if HAVE_EXPAT 
     20if HAVE_XML 
    2121if HAVE_LIBDAEMON 
    2222 
    2323pkgsysconfdir=$(sysconfdir)/avahi