summaryrefslogtreecommitdiff
path: root/tools/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'tools/configure.ac')
-rw-r--r--tools/configure.ac168
1 files changed, 137 insertions, 31 deletions
diff --git a/tools/configure.ac b/tools/configure.ac
index e078ebc4..f7623f62 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -332,37 +332,143 @@ else
fi
# check for boost_serialization
-#AC_CACHE_CHECK(
-# [if boost_serialization is available],
-# [boost_serialization_cpplib_avail_cv_],
-# [boost_serialization_save_libs=$LIBS
-# LIBS="-lboost_serialization$BOOST_SUFFIX -lboost_system$BOOST_SUFFIX $LIBS"
-# AC_LANG_PUSH(C++)
-# AC_LINK_IFELSE(
-# [AC_LANG_PROGRAM(
-# [[#include <boost/archive/binary_oarchive.hpp>
-# #include <iostream>
-# struct foo {
-# int a;
-# template<class Archive>
-# void serialize(Archive & ar, const unsigned int) {
-# ar & a;
-# }
-# };]],
-# [[boost::archive::binary_oarchive oa(std::cout);
-# foo x;
-# oa << x;]])],
-# [boost_serialization_cpplib_avail_cv_=true],
-# [boost_serialization_cpplib_avail_cv_=false])
-# AC_LANG_POP
-# LIBS=$boost_serialization_save_libs])
-#
-#if [test x$boost_serialization_cpplib_avail_cv_ = xtrue -a x$cache = xtrue]; then
-# AC_DEFINE([HAVE_BOOST_SERIALIZATION], [1], [Whether Boost.Serialization is available])
-# LIBS="-lboost_serialization$BOOST_SUFFIX $LIBS"
-#fi
-#AM_CONDITIONAL(HAVE_BOOST_SERIALIZATION, test x$boost_serialization_cpplib_avail_cv_ = xtrue -a x$cache = xtrue)
-AM_CONDITIONAL(HAVE_BOOST_SERIALIZATION, false)
+AC_CACHE_CHECK(
+ [if boost_serialization is available],
+ [boost_serialization_cpplib_avail_cv_],
+ [boost_serialization_save_libs=$LIBS
+ LIBS="-lboost_serialization$BOOST_SUFFIX -lboost_system$BOOST_SUFFIX $LIBS"
+ AC_LANG_PUSH(C++)
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <boost/archive/binary_oarchive.hpp>
+ #include <iostream>
+ struct foo {
+ int a;
+ template<class Archive>
+ void serialize(Archive & ar, const unsigned int) {
+ ar & a;
+ }
+ };]],
+ [[boost::archive::binary_oarchive oa(std::cout);
+ foo x;
+ oa << x;]])],
+ [boost_serialization_cpplib_avail_cv_=true],
+ [boost_serialization_cpplib_avail_cv_=false])
+ AC_LANG_POP
+ LIBS=$boost_serialization_save_libs])
+
+if [test x$boost_serialization_cpplib_avail_cv_ = xtrue -a x$cache = xtrue]; then
+ AC_DEFINE([HAVE_BOOST_SERIALIZATION], [1], [Whether Boost.Serialization is available])
+ LIBS="-lboost_serialization$BOOST_SUFFIX $LIBS"
+fi
+AM_CONDITIONAL(HAVE_BOOST_SERIALIZATION, test x$boost_serialization_cpplib_avail_cv_ = xtrue -a x$cache = xtrue)
+
+# check for expat or 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 libexpat is available],
+ [libexpat_avail_cv_],
+ [libexpat_save_libs=$LIBS
+ LIBS="-lexpat $LIBS"
+ AC_LANG_PUSH(C++)
+ AC_TRY_LINK(
+ [#include <stdio.h>
+ extern "C" {
+ #include <expat.h> // expat XML parser
+ }],
+ [XML_Parser parser = XML_ParserCreate(NULL);
+ return parser != NULL;],
+ [libexpat_avail_cv_=true],
+ [libexpat_avail_cv_=false])
+ AC_LANG_POP
+ LIBS=$libexpat_save_libs])
+
+ if [test x$libexpat_avail_cv_ = xtrue ]; then
+ AM_CONDITIONAL(HAVE_EXPAT, true)
+ LIBS="-lexpat $LIBS"
+ else
+ AM_CONDITIONAL(HAVE_EXPAT, false)
+ fi
+else
+ AM_CONDITIONAL(HAVE_EXPAT, false)
+fi
+
+if [test x$xml = xtrue ]; then
+ if [test x$libexpat_avail_cv_ = xfalse ]; then
+ AC_CACHE_CHECK(
+ [if libxmlparse is available],
+ [libxmlparse_avail_cv_],
+ [libxmlparse_save_libs=$LIBS
+ LIBS="-lxmlparse -lxmltok $LIBS"
+ AC_LANG_PUSH(C++)
+ AC_TRY_LINK(
+ [#include <stdio.h>
+ extern "C" {
+ #include <xmlparse.h> // expat XML parser
+ }],
+ [XML_Parser parser = XML_ParserCreate(NULL);
+ return parser != NULL;],
+ [libxmlparse_avail_cv_=true],
+ [libxmlparse_avail_cv_=false])
+ AC_LANG_POP
+ LIBS=$libxmlparse_save_libs])
+
+ if [test x$libxmlparse_avail_cv_ = xtrue ]; then
+ AM_CONDITIONAL(HAVE_XMLPARSE, true)
+ LIBS="-lxmlparse -lxmltok $LIBS"
+ else
+ AM_CONDITIONAL(HAVE_XMLPARSE, false)
+ fi
+ else
+ AM_CONDITIONAL(HAVE_XMLPARSE, false)
+ fi
+else
+ AM_CONDITIONAL(HAVE_XMLPARSE, false)
+fi
+
+# check for libofx
+AC_ARG_ENABLE(ofx,
+ [ --enable-ofx Turn on support for OFX/OCF parsing],
+ [case "${enableval}" in
+ yes) ofx=true ;;
+ no) ofx=false ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-ofx) ;;
+ esac],[ofx=true])
+AM_CONDITIONAL(USE_OFX, test x$ofx = xtrue)
+
+if [test x$ofx = xtrue ]; then
+ AC_CACHE_CHECK(
+ [if libofx is available],
+ [libofx_avail_cv_],
+ [libofx_save_libs=$LIBS
+ LIBS="-lofx $LIBS"
+ AC_LANG_PUSH(C++)
+ AC_TRY_LINK(
+ [#include <libofx.h>],
+ [ LibofxContextPtr libofx_context = libofx_get_new_context();],
+ [libofx_avail_cv_=true],
+ [libofx_avail_cv_=false])
+ AC_LANG_POP
+ LIBS=$libofx_save_libs])
+
+ if [test x$libofx_avail_cv_ = xtrue ]; then
+ AM_CONDITIONAL(HAVE_LIBOFX, true)
+ LIBS="-lofx $LIBS"
+ else
+ AM_CONDITIONAL(HAVE_LIBOFX, false)
+ fi
+else
+ AM_CONDITIONAL(HAVE_LIBOFX, false)
+fi
# check for Python
if [ test x$python = xtrue ]; then