Check for libxmlparse.a using a compile test instead of a link test.

This is much less ambiguous.
This commit is contained in:
John Wiegley 2005-01-14 23:40:09 +00:00
parent ea283a27ce
commit 35d7cbb7a0

View file

@ -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