File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -93,8 +93,8 @@ env.MergeFlags([os.environ.get(n, '') for n in flagnames])
9393good_python_flags = lambda n : (
9494 not isinstance (n , basestring ) or
9595 not re .match (r'(-g|-Wstrict-prototypes|-O\d)$' , n ))
96- pyver = pyoutput ('import sys; print("%i.%i" % sys.version_info[:2])' )
97- pythonconfig = 'python' + pyver + '-config'
96+ pyversion = pyoutput ('import sys; print("%i.%i" % sys.version_info[:2])' )
97+ pythonconfig = 'python' + pyversion + '-config'
9898env .ParseConfig (pythonconfig + " --cflags" )
9999env .Replace (CCFLAGS = filter (good_python_flags , env ['CCFLAGS' ]))
100100env .Replace (CPPDEFINES = '' )
@@ -145,7 +145,7 @@ if env['profile']:
145145
146146builddir = env .Dir ('build/%s-%s' % (env ['build' ], platform .machine ()))
147147
148- Export ('env' , 'pyconfigvar' , 'pyoutput' )
148+ Export ('env' , 'pyconfigvar' , 'pyoutput' , 'pyversion' )
149149
150150if os .path .isfile ('sconscript.local' ):
151151 env .SConscript ('sconscript.local' )
Original file line number Diff line number Diff line change 2828 'include_dirs' : get_numpy_include_dirs (),
2929}
3030
31+ # determine if we run with Python 3.
32+ PY3 = (sys .version_info [0 ] == 3 )
3133
3234# Figure out which boost library to use. This doesn't appear to consult
3335# LD_LIBRARY_PATH.
@@ -38,7 +40,7 @@ def get_boost_libraries():
3840 on the system. If required libraries are not found, an Exception will be
3941 thrown.
4042 """
41- baselib = "boost_python"
43+ baselib = "boost_python3" if PY3 else " boost_python"
4244 boostlibtags = ['' , '-mt' ] + ['' ]
4345 from ctypes .util import find_library
4446 for tag in boostlibtags :
@@ -54,7 +56,7 @@ def get_boost_libraries():
5456 if platform .system () == 'Darwin' :
5557 ldevname = 'DYLD_FALLBACK_LIBRARY_PATH'
5658 wmsg = ("Cannot detect name suffix for the %r library. "
57- "Consider setting %s." ) % (baselib , ldevname )
59+ "Consider setting %s." ) % (baselib , ldevname )
5860 warnings .warn (wmsg )
5961
6062 libs = [lib ]
@@ -93,7 +95,7 @@ def gitinfo():
9395
9496
9597def getversioncfg ():
96- if sys . version_info [ 0 ] >= 3 :
98+ if PY3 :
9799 from configparser import RawConfigParser
98100 else :
99101 from ConfigParser import RawConfigParser
Original file line number Diff line number Diff line change 1- Import ('env' , 'pyconfigvar' )
1+ Import ('env' , 'pyconfigvar' , 'pyversion' )
22
33# Helper functions -----------------------------------------------------------
44
@@ -11,6 +11,9 @@ def configure_boost_library(libname):
1111
1212 Note: CheckLib function automatically adds library to the environment.
1313 '''
14+ # adjust libname for boost_python
15+ if libname == 'boost_python' and pyversion [0 ] == '3' :
16+ libname = 'boost_python3'
1417 # using global conf defined below
1518 for t in boostlibtags :
1619 libnamefull = libname + t
You can’t perform that action at this time.
0 commit comments