diff options
author | John Wiegley <johnw@newartisans.com> | 2010-01-18 12:54:41 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-01-18 12:54:41 -0500 |
commit | c6873d32aa121289e87be7eb16ff531c6d468d2a (patch) | |
tree | c77cbf49617aea589cac7c4b0ca245f426793fd5 | |
parent | e3c8b91b5faedafd6b8f6a9a4c54638eba78c769 (diff) | |
parent | 67ce17e24959f55a4cd55857c7741d058397d758 (diff) | |
download | fork-ledger-c6873d32aa121289e87be7eb16ff531c6d468d2a.tar.gz fork-ledger-c6873d32aa121289e87be7eb16ff531c6d468d2a.tar.bz2 fork-ledger-c6873d32aa121289e87be7eb16ff531c6d468d2a.zip |
Merge branch 'next'
-rwxr-xr-x | acprep | 86 | ||||
-rw-r--r-- | src/item.cc | 5 | ||||
-rw-r--r-- | src/times.cc | 2 |
3 files changed, 47 insertions, 46 deletions
@@ -811,8 +811,10 @@ class PrepareBuild(CommandLineApp): % (self.envvars['PYTHON_HOME'], self.envvars['PYTHON_VERSION'].strip()), '/opt/local/lib', + '%s/lib' % self.envvars['BOOST_HOME'], '/sw/lib']: - if exists(path) and isdir(path): + if exists(path) and isdir(path) and \ + path not in self.sys_library_dirs: self.log.info('Noticing library directory => ' + path) self.sys_library_dirs.append(path) @@ -861,7 +863,7 @@ class PrepareBuild(CommandLineApp): self.CXXFLAGS.append('-pthread') elif system == 'Darwin': - if exists('/Users/johnw/Dropbox/Accounts/ledger.dat'): + if exists('/Users/johnw/Projects/ledger/plan/TODO'): self.setup_for_johnw() self.locate_darwin_libraries() @@ -1044,55 +1046,51 @@ class PrepareBuild(CommandLineApp): # The various build flavors # ######################################################################### + def check_for_boost(self, directory = '/opt/local', suffix = '', + boost_dirname = 'boost'): + if exists(join(directory, 'lib', 'libboost_regex' + suffix + '.a')): + self.envvars['BOOST_HOME'] = directory + self.envvars['BOOST_SUFFIX'] = suffix + include_directory = join(directory, 'include', boost_dirname) + if include_directory not in self.sys_include_dirs: + self.sys_include_dirs.append(include_directory) + library_directory = join(directory, 'lib') + if library_directory not in self.sys_library_dirs: + self.sys_library_dirs.append(library_directory) + self.inform_boost_location('is really located', + self.envvars['BOOST_SUFFIX']) + return True + else: + return False + def locate_darwin_libraries(self): if self.current_flavor == 'debug' or self.current_flavor == 'gcov': - self.log.debug('We are using GLIBCXX_DEBUG, so setting up flags') - if self.options.use_glibcxx_debug: + self.log.debug('We are using GLIBCXX_DEBUG, so setting up flags') self.CPPFLAGS.append('-D_GLIBCXX_DEBUG=1') - if exists('/usr/local/lib/libboost_regex-xgcc44-sd-1_41.a'): - self.envvars['BOOST_HOME'] = '/usr/local' - self.envvars['BOOST_SUFFIX'] = '-xgcc44-sd-1_41' - self.sys_include_dirs.append('/usr/local/include/boost-1_41') - self.inform_boost_location('is really located', - self.envvars['BOOST_SUFFIX']) - - elif exists('/usr/local/lib/libboost_regex-xgcc44-d-1_41.a'): - self.envvars['BOOST_HOME'] = '/usr/local' - self.envvars['BOOST_SUFFIX'] = '-xgcc44-d-1_41' - self.sys_include_dirs.append('/usr/local/include/boost-1_41') - self.inform_boost_location('is really located', - self.envvars['BOOST_SUFFIX']) - - elif exists('/opt/local/lib/libboost_regex-d.a'): - self.envvars['BOOST_HOME'] = '/opt/local' - self.envvars['BOOST_SUFFIX'] = '-d' - self.sys_include_dirs.append('/opt/local/include/boost') - self.inform_boost_location('is really located', - self.envvars['BOOST_SUFFIX']) + if self.check_for_boost(directory = '/usr/local/stow/boost_1_41_0', + suffix = '-xgcc44-sd-1_41', + boost_dirname = 'boost-1_41'): + pass + elif self.check_for_boost(directory = '/usr/local/stow/boost_1_41_0', + suffix = '-xgcc44-d-1_41', + boost_dirname = 'boost-1_41'): + pass + elif self.check_for_boost(suffix = '-d'): + pass else: - if exists('/opt/local/lib/libboost_regex.a'): - self.envvars['BOOST_HOME'] = '/opt/local' - self.envvars['BOOST_SUFFIX'] = '' - self.sys_include_dirs.append('/opt/local/include/boost') - self.inform_boost_location('is really located', - self.envvars['BOOST_SUFFIX']) - - elif exists('/usr/local/lib/libboost_regex-xgcc44-s-1_41.a'): - self.envvars['BOOST_HOME'] = '/usr/local' - self.envvars['BOOST_SUFFIX'] = '-xgcc44-s-1_41' - self.sys_include_dirs.append('/usr/local/include/boost-1_41') - self.inform_boost_location('is really located', - self.envvars['BOOST_SUFFIX']) - - elif exists('/usr/local/lib/libboost_regex-xgcc44-1_41.a'): - self.envvars['BOOST_HOME'] = '/usr/local' - self.envvars['BOOST_SUFFIX'] = '-xgcc44-1_41' - self.sys_include_dirs.append('/usr/local/include/boost-1_41') - self.inform_boost_location('is really located', - self.envvars['BOOST_SUFFIX']) + if self.check_for_boost(): + pass + elif self.check_for_boost(directory = '/usr/local/stow/boost_1_41_0', + suffix = '-xgcc44-s-1_41', + boost_dirname = 'boost-1_41'): + pass + elif self.check_for_boost(directory = '/usr/local/stow/boost_1_41_0', + suffix = '-xgcc44-1_41', + boost_dirname = 'boost-1_41'): + pass def setup_flavor_default(self): pass diff --git a/src/item.cc b/src/item.cc index 99d1d835..f86b8ec8 100644 --- a/src/item.cc +++ b/src/item.cc @@ -437,9 +437,12 @@ void print_item(std::ostream& out, const item_t& item, const string& prefix) string item_context(const item_t& item, const string& desc) { + if (! item.pos) + return empty_string; + std::streamoff len = item.pos->end_pos - item.pos->beg_pos; if (! len) - return _("<no item context>"); + return empty_string; assert(len > 0); assert(len < 2048); diff --git a/src/times.cc b/src/times.cc index d4317509..7ea3ae32 100644 --- a/src/times.cc +++ b/src/times.cc @@ -224,7 +224,7 @@ namespace { when = date_t(year ? *year : CURRENT_DATE().year(), when.month(), when.day()); - if (when.month() > CURRENT_DATE().month()) + if (! year && when.month() > CURRENT_DATE().month()) when -= gregorian::years(1); } } |