From 159dec9aa59746c18fc055f8608401780896ae37 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 16 Dec 2012 12:23:01 -0800 Subject: [PATCH] configure python details if building python plugin as well as bindings --- SConstruct | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/SConstruct b/SConstruct index 45a3e5560..7c035a09f 100644 --- a/SConstruct +++ b/SConstruct @@ -1331,7 +1331,7 @@ if not preconfigured: else: color_print(4,'Not building with cairo support, pass CAIRO=True to enable') - if 'python' in env['BINDINGS']: + if 'python' in env['BINDINGS'] or 'python' in env['REQUESTED_PLUGINS']: if not os.access(env['PYTHON'], os.X_OK): color_print(1,"Cannot run python interpreter at '%s', make sure that you have the permissions to execute it." % env['PYTHON']) Exit(1) @@ -1386,22 +1386,22 @@ if not preconfigured: else: env['PYTHON_IS_64BIT'] = False - if py3 and env['BOOST_PYTHON_LIB'] == 'boost_python': - env['BOOST_PYTHON_LIB'] = 'boost_python3%s' % env['BOOST_APPEND'] - elif env['BOOST_PYTHON_LIB'] == 'boost_python': - env['BOOST_PYTHON_LIB'] = 'boost_python%s' % env['BOOST_APPEND'] + if 'python' in env['BINDINGS']: + if py3 and env['BOOST_PYTHON_LIB'] == 'boost_python': + env['BOOST_PYTHON_LIB'] = 'boost_python3%s' % env['BOOST_APPEND'] + elif env['BOOST_PYTHON_LIB'] == 'boost_python': + env['BOOST_PYTHON_LIB'] = 'boost_python%s' % env['BOOST_APPEND'] + if not conf.CheckHeader(header='boost/python/detail/config.hpp',language='C++'): + color_print(1,'Could not find required header files for boost python') + env['MISSING_DEPS'].append('boost python') - if not conf.CheckHeader(header='boost/python/detail/config.hpp',language='C++'): - color_print(1,'Could not find required header files for boost python') - env['MISSING_DEPS'].append('boost python') - - if env['CAIRO']: - if conf.CheckPKGConfig('0.15.0') and conf.CheckPKG('pycairo'): - env['HAS_PYCAIRO'] = True + if env['CAIRO']: + if conf.CheckPKGConfig('0.15.0') and conf.CheckPKG('pycairo'): + env['HAS_PYCAIRO'] = True + else: + env['SKIPPED_DEPS'].extend(['pycairo']) else: - env['SKIPPED_DEPS'].extend(['pycairo']) - else: - color_print(4,'Not building with pycairo support, pass CAIRO=True to enable') + color_print(4,'Not building with pycairo support, pass CAIRO=True to enable') #### End Config Stage for Required Dependencies #### @@ -1526,7 +1526,7 @@ if not preconfigured: if env['DEBUG_UNDEFINED']: env.Append(CXXFLAGS = '-fcatch-undefined-behavior -ftrapv -fwrapv') - if 'python' in env['BINDINGS']: + if 'python' in env['BINDINGS'] or 'python' in env['REQUESTED_PLUGINS']: majver, minver = env['PYTHON_VERSION'].split('.') # we don't want the includes it in the main environment... # as they are later set in the python build.py @@ -1542,9 +1542,10 @@ if not preconfigured: color_print(1,"Python version 2.2 or greater required") Exit(1) - color_print(4,'Bindings Python version... %s' % env['PYTHON_VERSION']) - color_print(4,'Python %s prefix... %s' % (env['PYTHON_VERSION'], env['PYTHON_SYS_PREFIX'])) - color_print(4,'Python bindings will install in... %s' % os.path.normpath(env['PYTHON_INSTALL_LOCATION'])) + if 'python' in env['BINDINGS']: + color_print(4,'Bindings Python version... %s' % env['PYTHON_VERSION']) + color_print(4,'Python %s prefix... %s' % (env['PYTHON_VERSION'], env['PYTHON_SYS_PREFIX'])) + color_print(4,'Python bindings will install in... %s' % os.path.normpath(env['PYTHON_INSTALL_LOCATION'])) env.Replace(**backup) # if requested, sort LIBPATH and CPPPATH one last time before saving...