diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 62 |
1 files changed, 40 insertions, 22 deletions
diff --git a/configure.in b/configure.in index d295b3f8..7788528a 100644 --- a/configure.in +++ b/configure.in @@ -12,6 +12,7 @@ AC_PROG_CXX AC_PROG_MAKE_SET AC_PROG_LIBTOOL AM_PROG_LIBTOOL +#AC_PROG_RANLIB # Checks for libraries. AC_CHECK_LIB([gmp], [__gmpz_add], [], @@ -26,31 +27,48 @@ AC_CHECK_LIB([xmlparse], [XML_ParserCreate], AM_CONDITIONAL(READ_GNUCASH, false)], [-lxmltok]) -AM_PATH_PYTHON(2.2,, :) -AM_CONDITIONAL(HAVE_PYTHON, [test "$PYTHON" != :]) -AC_CACHE_CHECK( - [if boost_python is available], - [boost_python_cpplib_avail], - [boost_python_save_libs=$LIBS - LIBS="-lboost_python $LIBS" - AC_LANG_PUSH(C++) - AC_TRY_COMPILE( - [#include <boost/python.hpp> - using namespace boost::python; - class foo {}; - BOOST_PYTHON_MODULE(samp) { - class_< foo > ("foo") ; - }], - [return 0], - [boost_python_cpplib_avail=true], - [boost_python_cpplib_avail=false]) - AC_LANG_POP - LIBS=$boost_python_save_libs]) -AM_CONDITIONAL(HAVE_BOOST_PYTHON, test x$boost_python_cpplib_avail = xtrue) +AC_ARG_ENABLE(python, + [ --enable-python Turn on Python support], + [case "${enableval}" in + yes) python=true ;; + no) python=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;; + esac],[python=false]) +AM_CONDITIONAL(USE_PYTHON, test x$python = xtrue) + +if [test x$python = xtrue ]; then + AM_PATH_PYTHON(2.2,, :) + if [test "$PYTHON" != :]; then + AC_CACHE_CHECK( + [if boost_python is available], + [boost_python_cpplib_avail], + [boost_python_save_libs=$LIBS + LIBS="-lboost_python $LIBS" + AC_LANG_PUSH(C++) + AC_TRY_COMPILE( + [#include <boost/python.hpp> + using namespace boost::python; + class foo {}; + BOOST_PYTHON_MODULE(samp) { + class_< foo > ("foo") ; + }], + [return 0], + [boost_python_cpplib_avail=true], + [boost_python_cpplib_avail=false]) + AC_LANG_POP + LIBS=$boost_python_save_libs]) + AM_CONDITIONAL(HAVE_BOOST_PYTHON, + test x$boost_python_cpplib_avail = xtrue) + else + AM_CONDITIONAL(HAVE_BOOST_PYTHON, false) + fi +else + AM_CONDITIONAL(HAVE_BOOST_PYTHON, false) +fi # Check for options AC_ARG_ENABLE(debug, - [ --enable-debug Turn on debugging], + [ --enable-debug Turn on debugging], [case "${enableval}" in yes) debug=true ;; no) debug=false ;; |