summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-13 13:41:54 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-13 13:41:54 -0500
commit73baf9cd727407f6e47b410bbde3b4bcad482ae3 (patch)
tree71a93ea1eaf17901ebf89fe0556e87ab7ec6db50
parentef3adb5fe0b91cfd7d74eab7275356aa49de7120 (diff)
parent2986bc779e055fe8bd3511994c539d65d3a7aa57 (diff)
downloadfork-ledger-73baf9cd727407f6e47b410bbde3b4bcad482ae3.tar.gz
fork-ledger-73baf9cd727407f6e47b410bbde3b4bcad482ae3.tar.bz2
fork-ledger-73baf9cd727407f6e47b410bbde3b4bcad482ae3.zip
Merge branch 'next'
-rwxr-xr-xacprep22
-rw-r--r--src/draft.h2
-rw-r--r--src/filters.cc2
-rw-r--r--src/item.h6
-rw-r--r--src/query.cc2
-rw-r--r--src/query.h4
-rw-r--r--src/times.cc8
-rw-r--r--src/times.h4
-rw-r--r--src/utils.cc5
-rw-r--r--src/value.cc2
-rw-r--r--tools/configure.ac67
11 files changed, 71 insertions, 53 deletions
diff --git a/acprep b/acprep
index 958d777e..d9029741 100755
--- a/acprep
+++ b/acprep
@@ -751,22 +751,26 @@ class PrepareBuild(CommandLineApp):
def setup_for_johnw(self):
# jww (2009-03-09): Some peculiarities specific to my system
if exists('/Users/johnw/Dropbox/Accounts/ledger.dat'):
- if exists('/usr/local/stow/cppunit/include'):
- self.sys_include_dirs.insert(0, '/usr/local/stow/cppunit/include')
- self.sys_library_dirs.insert(0, '/usr/local/stow/cppunit/lib')
+ if self.current_flavor == 'debug':
+ if exists('/usr/local/stow/cppunit/include'):
+ self.sys_include_dirs.insert(0, '/usr/local/stow/cppunit/include')
+ self.sys_library_dirs.insert(0, '/usr/local/stow/cppunit/lib')
- if exists('/usr/local/stow/icu/include'):
- self.sys_include_dirs.insert(0, '/usr/local/stow/icu/include')
- self.sys_library_dirs.insert(0, '/usr/local/stow/icu/lib')
+ if exists('/usr/local/stow/icu/include'):
+ self.sys_include_dirs.insert(0, '/usr/local/stow/icu/include')
+ self.sys_library_dirs.insert(0, '/usr/local/stow/icu/lib')
+
+ self.CPPFLAGS.append('-D_GLIBCXX_FULLY_DYNAMIC_STRING=1')
+
+ self.options.use_glibcxx_debug = True
self.CXXFLAGS.append('-march=nocona')
self.CXXFLAGS.append('-msse3')
- self.CPPFLAGS.append('-D_GLIBCXX_FULLY_DYNAMIC_STRING=1')
self.configure_args.append('--disable-shared')
self.configure_args.append('--enable-doxygen')
+ self.configure_args.append('--enable-python')
- self.options.use_glibcxx_debug = True
self.locate_my_libraries()
def setup_for_system(self):
@@ -1049,7 +1053,9 @@ class PrepareBuild(CommandLineApp):
def setup_flavor_opt(self):
self.CXXFLAGS.append('-O3')
+ self.LDFLAGS.append('-O3')
self.CXXFLAGS.append('-fomit-frame-pointer')
+ self.LDFLAGS.append('-fomit-frame-pointer')
def setup_flavor_gcov(self):
self.CXXFLAGS.append('-g')
diff --git a/src/draft.h b/src/draft.h
index 277b4ff8..003dcefa 100644
--- a/src/draft.h
+++ b/src/draft.h
@@ -93,7 +93,7 @@ public:
void parse_args(const value_t& args);
virtual result_type real_calc(scope_t&) {
- assert(0);
+ assert(false);
return true;
}
diff --git a/src/filters.cc b/src/filters.cc
index 8c5d099e..811067fc 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -710,7 +710,7 @@ void transfer_details::operator()(post_t& post)
switch (which_element) {
case SET_DATE:
- xact.set_date(substitute.to_date());
+ temp.xdata().date = substitute.to_date();
break;
case SET_ACCOUNT: {
diff --git a/src/item.h b/src/item.h
index 13332f0b..84385eb7 100644
--- a/src/item.h
+++ b/src/item.h
@@ -172,12 +172,6 @@ public:
virtual optional<date_t> effective_date() const {
return _date_eff;
}
- virtual void set_date(const date_t& date) {
- if (use_effective_date)
- _date_eff = date;
- else
- _date = date;
- }
void set_state(state_t new_state) {
_state = new_state;
diff --git a/src/query.cc b/src/query.cc
index de1c5631..21304f92 100644
--- a/src/query.cc
+++ b/src/query.cc
@@ -333,7 +333,7 @@ query_t::parser_t::parse_query_term(query_t::lexer_t::token_t::kind_t tok_contex
case lexer_t::token_t::TOK_NOTE:
ident->set_ident("note"); break;
default:
- assert(0); break;
+ assert(false); break;
}
expr_t::ptr_op_t mask = new expr_t::op_t(expr_t::op_t::VALUE);
diff --git a/src/query.h b/src/query.h
index e3545396..73639263 100644
--- a/src/query.h
+++ b/src/query.h
@@ -157,12 +157,12 @@ public:
case END_REACHED: return "<EOF>";
case TERM:
- assert(0);
+ assert(false);
return "<TERM>";
case UNKNOWN:
default:
- assert(0);
+ assert(false);
return "<UNKNOWN>";
}
}
diff --git a/src/times.cc b/src/times.cc
index b737b2a0..6afbab0a 100644
--- a/src/times.cc
+++ b/src/times.cc
@@ -789,8 +789,8 @@ std::string format_datetime(const datetime_t& when,
return printed_datetime_io->format(when);
}
else {
- assert(0);
- return "";
+ assert(false);
+ return empty_string;
}
}
@@ -815,8 +815,8 @@ std::string format_date(const date_t& when,
return printed_date_io->format(when);
}
else {
- assert(0);
- return "";
+ assert(false);
+ return empty_string;
}
}
diff --git a/src/times.h b/src/times.h
index 3cd359d2..77f25d9e 100644
--- a/src/times.h
+++ b/src/times.h
@@ -174,7 +174,7 @@ public:
case YEARS:
return date + gregorian::years(length);
default:
- assert(0); return date_t();
+ assert(false); return date_t();
}
}
@@ -189,7 +189,7 @@ public:
case YEARS:
return date - gregorian::years(length);
default:
- assert(0); return date_t();
+ assert(false); return date_t();
}
}
diff --git a/src/utils.cc b/src/utils.cc
index d661f410..f2460ba1 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -550,8 +550,13 @@ bool logger_func(log_level_t level)
logger_has_run = true;
logger_start = TRUE_CURRENT_TIME();
+#if defined(VERIFY_ON)
IF_VERIFY()
*_log_stream << " TIME OBJSZ MEMSZ" << std::endl;
+#else
+ IF_VERIFY()
+ *_log_stream << " TIME" << std::endl;
+#endif
}
*_log_stream << std::right << std::setw(5)
diff --git a/src/value.cc b/src/value.cc
index 910a9140..ce852c2d 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -696,7 +696,7 @@ value_t& value_t::operator/=(const value_t& val)
as_amount_lval() /= simpler.as_amount();
break;
default:
- assert(0);
+ assert(false);
break;
}
return *this;
diff --git a/tools/configure.ac b/tools/configure.ac
index 747d940d..f576bd61 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -62,6 +62,14 @@ AC_ARG_ENABLE(doxygen,
AM_CONDITIONAL(USE_DOXYGEN, test x$doxygen = xtrue)
+AC_ARG_ENABLE(python,
+ [ --enable-python Turn on Python support (experimental)],
+ [case "${enableval}" in
+ yes) python=true ;;
+ no) python=false ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;;
+ esac],[python=false])
+
AC_ARG_WITH(boost-suffix,
[ --with-boost-suffix=X Append X to the Boost library names],
[BOOST_SUFFIX="${withval}"],
@@ -336,37 +344,42 @@ fi
AM_CONDITIONAL(HAVE_BOOST_SERIALIZATION, test x$boost_serialization_cpplib_avail_cv_ = xtrue)
# check for Python
-AM_PATH_PYTHON(2.4,, :)
-if [test "$PYTHON" != :]; then
- AM_CONDITIONAL(HAVE_PYTHON, true)
- AC_CACHE_CHECK(
- [if boost_python is available],
- [boost_python_cpplib_avail_cv_],
- [boost_python_save_libs=$LIBS
- LIBS="-lboost_python$BOOST_SUFFIX -lpython$PYTHON_VERSION $LIBS"
- AC_LANG_PUSH(C++)
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <boost/python.hpp>
- using namespace boost::python;
- class foo {};
- BOOST_PYTHON_MODULE(samp) {
- class_< foo > ("foo") ;
- }]],
- [[return 0]])],
- [boost_python_cpplib_avail_cv_=true],
- [boost_python_cpplib_avail_cv_=false])
- AC_LANG_POP
- LIBS=$boost_python_save_libs])
-
- 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"
+if [ test x$python = xtrue ]; then
+ AM_PATH_PYTHON(2.4,, :)
+ if [test "$PYTHON" != :]; then
+ AM_CONDITIONAL(HAVE_PYTHON, true)
+ AC_CACHE_CHECK(
+ [if boost_python is available],
+ [boost_python_cpplib_avail_cv_],
+ [boost_python_save_libs=$LIBS
+ LIBS="-lboost_python$BOOST_SUFFIX -lpython$PYTHON_VERSION $LIBS"
+ AC_LANG_PUSH(C++)
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <boost/python.hpp>
+ using namespace boost::python;
+ class foo {};
+ BOOST_PYTHON_MODULE(samp) {
+ class_< foo > ("foo") ;
+ }]],
+ [[return 0]])],
+ [boost_python_cpplib_avail_cv_=true],
+ [boost_python_cpplib_avail_cv_=false])
+ AC_LANG_POP
+ LIBS=$boost_python_save_libs])
+
+ 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"
+ fi
+ else
+ AM_CONDITIONAL(HAVE_PYTHON, false)
fi
+ AM_CONDITIONAL(HAVE_BOOST_PYTHON, test x$boost_python_cpplib_avail_cv_ = xtrue)
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(