Merge branch 'next'

This commit is contained in:
John Wiegley 2010-01-18 12:54:41 -05:00
commit c6873d32aa
3 changed files with 47 additions and 46 deletions

86
acprep
View file

@ -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

View file

@ -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);

View file

@ -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);
}
}