diff options
-rw-r--r-- | Makefile.am | 8 | ||||
-rw-r--r-- | configure.ac | 27 | ||||
-rw-r--r-- | python/pyinterp.h | 4 | ||||
-rw-r--r-- | src/main.cc | 2 |
4 files changed, 18 insertions, 23 deletions
diff --git a/Makefile.am b/Makefile.am index db0c7b55..55d2df7c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,12 +13,6 @@ lib_LTLIBRARIES = \ lib_cppflags = -I$(srcdir)/src -I$(srcdir)/lib \ -I$(srcdir)/lib/utfcpp/source \ -I$(srcdir)/lib/irrxml/src -if HAVE_LIBOFX -lib_cppflags += -DHAVE_LIBOFX=1 -endif -if DEBUG -lib_cppflags += -DDEBUG_MODE -endif libledger_util_la_SOURCES = \ src/utils.cc \ @@ -198,7 +192,7 @@ bin_PROGRAMS = ledger ledger_CPPFLAGS = $(lib_cppflags) if HAVE_BOOST_PYTHON -ledger_CPPFLAGS += -DHAVE_BOOST_PYTHON=1 -I$(srcdir)/python +ledger_CPPFLAGS += -I$(srcdir)/python endif ledger_SOURCES = src/main.cc ledger_LDADD = $(LIBOBJS) $(lib_LTLIBRARIES) diff --git a/configure.ac b/configure.ac index e1fc2e77..3f42d55b 100644 --- a/configure.ac +++ b/configure.ac @@ -31,6 +31,9 @@ AC_ARG_ENABLE(debug, *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; esac],[debug=false]) +if [ test x$debug = xtrue ]; then + AC_DEFINE([DEBUG_MODE], [1], [Whether debugging is enabled]) +fi AM_CONDITIONAL(DEBUG, test x$debug = xtrue) AC_ARG_ENABLE(pch, @@ -41,6 +44,9 @@ AC_ARG_ENABLE(pch, *) AC_MSG_ERROR(bad value ${enableval} for --enable-pch) ;; esac],[pch=false]) +if [ test x$pch = xtrue ]; then + AC_DEFINE([USE_PCH], [1], [Whether pre-compiled headers are being used]) +fi AM_CONDITIONAL(USE_PCH, test x$pch = xtrue) AC_ARG_WITH(boost-suffix, @@ -228,12 +234,11 @@ AC_CACHE_CHECK( AC_LANG_POP LIBS=$libofx_save_libs]) -if [test x$libofx_avail_cv_ = xtrue ]; then - AM_CONDITIONAL(HAVE_LIBOFX, true) +if [ test x$libofx_avail_cv_ = xtrue ]; then + AC_DEFINE([HAVE_LIBOFX], [1], [Whether libofx is available]) LIBS="-lofx $LIBS" -else - AM_CONDITIONAL(HAVE_LIBOFX, false) fi +AM_CONDITIONAL(HAVE_LIBOFX, test x$libofx_avail_cv_ = xtrue) # check for Python AM_PATH_PYTHON(2.4,, :) @@ -259,16 +264,14 @@ if [test "$PYTHON" != :]; then AC_LANG_POP LIBS=$boost_python_save_libs]) - if [test x$boost_python_cpplib_avail_cv_ = xtrue ]; then - AM_CONDITIONAL(HAVE_BOOST_PYTHON, true) + if [ test x$boost_python_cpplib_avail_cv_ = xtrue ]; then + AC_DEFINE([HAVE_BOOST_PYTHON], [1], [Whether Boost.Python is available]) LIBS="-lboost_python$BOOST_SUFFIX -lpython$PYTHON_VERSION $LIBS" - else - AM_CONDITIONAL(HAVE_BOOST_PYTHON, false) fi else AM_CONDITIONAL(HAVE_PYTHON, false) - AM_CONDITIONAL(HAVE_BOOST_PYTHON, false) fi +AM_CONDITIONAL(HAVE_BOOST_PYTHON, test x$boost_python_cpplib_avail_cv_ = xtrue) # check for CppUnit AC_CACHE_CHECK( @@ -294,11 +297,7 @@ AC_CACHE_CHECK( AC_LANG_POP LIBS=$cppunit_save_libs]) -if [test x$cppunit_avail_cv_ = xtrue ]; then - AM_CONDITIONAL(HAVE_CPPUNIT, true) -else - AM_CONDITIONAL(HAVE_CPPUNIT, false) -fi +AM_CONDITIONAL(HAVE_CPPUNIT, test x$cppunit_avail_cv_ = xtrue) # Checks for header files. AC_HEADER_STDC diff --git a/python/pyinterp.h b/python/pyinterp.h index df0e00dd..de910223 100644 --- a/python/pyinterp.h +++ b/python/pyinterp.h @@ -35,6 +35,8 @@ #include "scope.h" #include "session.h" +#if defined(HAVE_BOOST_PYTHON) + #include <boost/python.hpp> #include <Python.h> @@ -126,4 +128,6 @@ public: } // namespace ledger +#endif // HAVE_BOOST_PYTHON + #endif // _PYINTERP_H diff --git a/src/main.cc b/src/main.cc index dfbeeb75..faeec6ac 100644 --- a/src/main.cc +++ b/src/main.cc @@ -33,9 +33,7 @@ #include "report.h" #include "option.h" #include "help.h" -#if defined(HAVE_BOOST_PYTHON) #include "pyinterp.h" -#endif #include "textual.h" #include "qif.h" |