summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-01-14 23:40:09 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:40:50 -0400
commit35d7cbb7a04823375501d9e9353b65585829a4e1 (patch)
tree8585e8f98c3f674593aae401462ff15cffdef9e7 /configure.in
parentea283a27ce4e804cd2f3bd3fb4ed7a58b5e96f6e (diff)
downloadfork-ledger-35d7cbb7a04823375501d9e9353b65585829a4e1.tar.gz
fork-ledger-35d7cbb7a04823375501d9e9353b65585829a4e1.tar.bz2
fork-ledger-35d7cbb7a04823375501d9e9353b65585829a4e1.zip
Check for libxmlparse.a using a compile test instead of a link test.
This is much less ambiguous.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in40
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