diff --git a/configure.ac b/configure.ac index e618e424..0251e09c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ AC_INIT(src/arabica.cpp) AC_CONFIG_HEADERS(include/SAX/ArabicaConfig.h) -AM_INIT_AUTOMAKE(arabica, Sept2006-2) +AM_INIT_AUTOMAKE(arabica, Sept2006-3) AC_PROG_CXX AM_PROG_LIBTOOL @@ -9,6 +9,7 @@ AM_PROG_LIBTOOL AC_LANG_CPLUSPLUS ARABICA_HAS_BOOST([1.32]) +ARABICA_WANT_DOM ARABICA_HAS_EXPAT ARABICA_HAS_LIBXML2 ARABICA_HAS_XERCES diff --git a/examples/Makefile.am b/examples/Makefile.am index f02bb1f2..54715a65 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,5 +1,8 @@ -SUBDIRS = SAX DOM Utils -if HAVE_BOOST +SUBDIRS = SAX Utils +if WANT_DOM + SUBDIRS += DOM +endif +if WANT_XPATH SUBDIRS += XPath endif diff --git a/m4/ax_boost_base.m4 b/m4/ax_boost_base.m4 index 08d2427d..c9e90d13 100644 --- a/m4/ax_boost_base.m4 +++ b/m4/ax_boost_base.m4 @@ -151,16 +151,21 @@ AC_DEFUN([ARABICA_HAS_BOOST], else AC_MSG_NOTICE('Your Boost libraries seems to old (version $_version). We need at least $boost_lib_version_shorten') fi - AC_MSG_NOTICE([[Arabica will build, but XPath and some other features will not be available]]) + AC_MSG_NOTICE([[Arabica will build, but some features will not be available]]) else AC_SUBST(BOOST_CPPFLAGS) AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available]) fi CPPFLAGS="$CPPFLAGS_SAVED" else - AC_MSG_NOTICE([[Not searching for Boost. Arabica will build, but XPath and some other features will not be available]]) + AC_MSG_NOTICE([[Not searching for Boost. Arabica will build, but some features will not be available]]) fi AM_CONDITIONAL(HAVE_BOOST, test x$succeeded = xyes) + if test "$succeeded" = "yes"; then + boost_is_available=yes + else + boost_is_available=no + fi ]) diff --git a/m4/want_dom.m4 b/m4/want_dom.m4 new file mode 100755 index 00000000..1d583392 --- /dev/null +++ b/m4/want_dom.m4 @@ -0,0 +1,25 @@ +AC_DEFUN([ARABICA_WANT_DOM], +[ + AC_ARG_WITH([dom], + AS_HELP_STRING([--with-dom=yes|no], + [Control whether DOM tests and examples are built. --with-dom=no to disable]), + [if test "$withval" = "no"; then + want_dom="no" + else + want_dom="yes" + fi], + [want_dom="yes"]) + if test x$want_dom = xno; then + AC_MSG_NOTICE([[DOM disabled. DOM components will not be built.]]) + fi + AM_CONDITIONAL(WANT_DOM, test "$want_dom" = "yes") + if test "$want_dom" = "yes"; then + if test "$boost_is_available" = "yes"; then + want_xpath = "yes" + fi + fi + if test "$want_xpath" != "yes"; then + AC_MSG_NOTICE([[XPath disabled. XPath components will not be built.]]) + fi + AM_CONDITIONAL(WANT_XPATH, test "$want_xpath" = "yes") +]) diff --git a/test/Makefile.am b/test/Makefile.am index 3f4786b5..c18d9fb8 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,5 +1,8 @@ -SUBDIRS = DOM SAX2DOM -if HAVE_BOOST +SUBDIRS = +if WANT_DOM + SUBDIRS += DOM SAX2DOM +endif +if WANT_XPATH SUBDIRS += XPath endif