Permalink
Browse files

Improved the way that acprep finds Python

If Boost.Python comes from /opt, then Python must too.
  • Loading branch information...
1 parent 4190240 commit 0fb6bf4189c57802fafb611f18f419cd6b588ac4 @jwiegley jwiegley committed Jun 12, 2010
Showing with 12 additions and 4 deletions.
  1. +12 −4 acprep
View
@@ -113,10 +113,11 @@ class BoostInfo(object):
def inform_boost_details(self):
self.log.info('Boost was found here:')
+ self.log.info('Boost home path => ' + self.home_path)
self.log.info('Boost include path => ' + self.include_directory())
self.log.info('Boost library path => ' + self.library_directory())
- self.log.info('Boost suffix => ' + self.suffix)
- self.log.info('Boost file suffix => ' + self.file_suffix)
+ self.log.info('Boost suffix => ' + self.suffix)
+ self.log.info('Boost file suffix => ' + self.file_suffix)
def find_boost_in_directory(self, path):
if exists(path) and isdir(path):
@@ -913,9 +914,16 @@ class PrepareBuild(CommandLineApp):
#########################################################################
def setup_system_directories(self):
+ boost_include = self.boost_info.include_directory()
+ boost_library = self.boost_info.library_directory()
+
+ if re.match('/opt/local', self.boost_info.home_path):
+ self.log.debug("Setting Python home to /opt/local based on Boost's location")
+ self.envvars['PYTHON_HOME'] = '/opt/local'
+
# Each of these becomes '-isystem <name>'
for path in ['/usr/local/include',
- self.boost_info.include_directory(),
+ boost_include,
'%s/include/python%s' %
(self.envvars['PYTHON_HOME'],
self.envvars['PYTHON_VERSION'].strip()),
@@ -933,7 +941,7 @@ class PrepareBuild(CommandLineApp):
% (self.envvars['PYTHON_HOME'],
self.envvars['PYTHON_VERSION'].strip()),
'/opt/local/lib',
- self.boost_info.library_directory(),
+ boost_library,
'/sw/lib']:
if exists(path) and isdir(path) and \
path not in self.sys_library_dirs:

0 comments on commit 0fb6bf4

Please sign in to comment.