--- configure.in +++ configure.in @@ -3,25 +3,24 @@ m4_define(LSYNCD_VERSION,1.26) AM_INIT_AUTOMAKE(LSYNCD_PACKAGE,LSYNCD_VERSION) -AC_ARG_ENABLE([xml_config], -[ --enable-xml-config Lsyncd is able to parse lsyncd.conf files (default: enabled)], -[case "${enableval}" in - yes) xml_config=true ;; - no) xml_config=false ;; - *) AC_MSG_ERROR([bad value ${enableval} for --enable-xml-config]) ;; -esac],[xml_config=true]) -AM_CONDITIONAL(XML_CONFIG,[test x$xml_config = xtrue]) - -#if test x$xml_config = xtrue; then -#AM_PATH_XML2(2.5.0,,AC_MSG_ERROR([*** Libxml is required if you do not --disable-xml-config])) -#fi - AM_MAINTAINER_MODE AC_PROG_CC +AM_PROG_CC_C_O AC_PROG_INSTALL AC_CHECK_HEADERS([sys/inotify.h]) +AC_MSG_CHECKING([checking whether to use libxml2]) +AC_ARG_ENABLE([xml], + [ --enable-xml Lsyncd is able to parse lsyncd.conf files], + [enable_xml=$enableval], + [enable_xml="no"]) +AC_MSG_RESULT($enable_xml) +if test "$enable_xml" = "yes"; then + AC_DEFINE(XML_CONFIG) + AM_PATH_XML2(2.4.0) +fi + AC_CONFIG_HEADERS([config.h]) AC_OUTPUT(Makefile) --- Makefile.am +++ Makefile.am @@ -1,6 +1,8 @@ ## Makefile.am -- Process this file with automake to produce Makefile.in bin_PROGRAMS = lsyncd lsyncd_SOURCES = lsyncd.c +lsyncd_CPPFLAGS = $(XML_CPPFLAGS) +lsyncd_LDADD = $(XML_LIBS) TESTS = tests/help.sh \ tests/directorymv.sh \ tests/directorycpr.sh \ @@ -33,10 +35,3 @@ $(XP) -o $@ $(DB2MAN) $< AM_CFLAGS=-Wall -AM_LDFLAGS= -if XML_CONFIG -DEFS+=-DXML_CONFIG -AM_CFLAGS += `xml2-config --cflags` -AM_LDFLAGS += `xml2-config --libs` -endif -