diff options
-rw-r--r-- | configure.in | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/configure.in b/configure.in index 850e7786..583de185 100644 --- a/configure.in +++ b/configure.in @@ -17,14 +17,40 @@ AC_CHECK_LIB([gmp], [__gmpz_add], [], AC_MSG_FAILURE("Could not find gmp (GNU multi-precision) library")) AC_CHECK_LIB([pcre], [pcre_compile], [], AC_MSG_FAILURE("Could not find pcre (Perl regular expression) library")) -AC_CHECK_LIB([xmlparse], [XML_ParserCreate], - [AC_DEFINE([HAVE_XMLPARSE], [1], [Support reading Gnucash and XML files]) - AM_CONDITIONAL(HAVE_XMLPARSE, true) - AC_SUBST(LIBS, "-lxmlparse -lxmltok $LIBS")], - [AC_MSG_NOTICE([Could not find xmlparse library: Gnucash and XML support disabled]) - AM_CONDITIONAL(HAVE_XMLPARSE, false)], - [-lxmltok]) +# check for xmlparse +AC_ARG_ENABLE(xml, + [ --enable-xml Turn on support for XML parsing], + [case "${enableval}" in + yes) xml=true ;; + no) xml=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-xml) ;; + esac],[xml=true]) +AM_CONDITIONAL(USE_XML, test x$xml = xtrue) + +if [test x$xml = xtrue ]; then + AC_CACHE_CHECK( + [if libxmlparse is available], + [libxmlparse_avail], + [libxmlparse_save_libs=$LIBS + LIBS="-lxmlparse -lxmltok $LIBS" + AC_LANG_PUSH(C++) + AC_TRY_COMPILE( + [extern "C" { + #include <xmlparse.h> // expat XML parser + } + class foo {};], + [return 0], + [libxmlparse_avail=true], + [libxmlparse_avail=false]) + AC_LANG_POP + LIBS=$libxmlparse_save_libs]) + AM_CONDITIONAL(HAVE_XMLPARSE, test x$libxmlparse_avail = xtrue) +else + AM_CONDITIONAL(HAVE_XMLPARSE, false) +fi + +# check for Python AC_ARG_ENABLE(python, [ --enable-python Turn on Python support], [case "${enableval}" in |