File tree 3 files changed +12
-7
lines changed
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])
93
93
good_python_flags = lambda n : (
94
94
not isinstance (n , basestring ) or
95
95
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'
98
98
env .ParseConfig (pythonconfig + " --cflags" )
99
99
env .Replace (CCFLAGS = filter (good_python_flags , env ['CCFLAGS' ]))
100
100
env .Replace (CPPDEFINES = '' )
@@ -145,7 +145,7 @@ if env['profile']:
145
145
146
146
builddir = env .Dir ('build/%s-%s' % (env ['build' ], platform .machine ()))
147
147
148
- Export ('env' , 'pyconfigvar' , 'pyoutput' )
148
+ Export ('env' , 'pyconfigvar' , 'pyoutput' , 'pyversion' )
149
149
150
150
if os .path .isfile ('sconscript.local' ):
151
151
env .SConscript ('sconscript.local' )
Original file line number Diff line number Diff line change 28
28
'include_dirs' : get_numpy_include_dirs (),
29
29
}
30
30
31
+ # determine if we run with Python 3.
32
+ PY3 = (sys .version_info [0 ] == 3 )
31
33
32
34
# Figure out which boost library to use. This doesn't appear to consult
33
35
# LD_LIBRARY_PATH.
@@ -38,7 +40,7 @@ def get_boost_libraries():
38
40
on the system. If required libraries are not found, an Exception will be
39
41
thrown.
40
42
"""
41
- baselib = "boost_python"
43
+ baselib = "boost_python3" if PY3 else " boost_python"
42
44
boostlibtags = ['' , '-mt' ] + ['' ]
43
45
from ctypes .util import find_library
44
46
for tag in boostlibtags :
@@ -54,7 +56,7 @@ def get_boost_libraries():
54
56
if platform .system () == 'Darwin' :
55
57
ldevname = 'DYLD_FALLBACK_LIBRARY_PATH'
56
58
wmsg = ("Cannot detect name suffix for the %r library. "
57
- "Consider setting %s." ) % (baselib , ldevname )
59
+ "Consider setting %s." ) % (baselib , ldevname )
58
60
warnings .warn (wmsg )
59
61
60
62
libs = [lib ]
@@ -93,7 +95,7 @@ def gitinfo():
93
95
94
96
95
97
def getversioncfg ():
96
- if sys . version_info [ 0 ] >= 3 :
98
+ if PY3 :
97
99
from configparser import RawConfigParser
98
100
else :
99
101
from ConfigParser import RawConfigParser
Original file line number Diff line number Diff line change 1
- Import ('env' , 'pyconfigvar' )
1
+ Import ('env' , 'pyconfigvar' , 'pyversion' )
2
2
3
3
# Helper functions -----------------------------------------------------------
4
4
@@ -11,6 +11,9 @@ def configure_boost_library(libname):
11
11
12
12
Note: CheckLib function automatically adds library to the environment.
13
13
'''
14
+ # adjust libname for boost_python
15
+ if libname == 'boost_python' and pyversion [0 ] == '3' :
16
+ libname = 'boost_python3'
14
17
# using global conf defined below
15
18
for t in boostlibtags :
16
19
libnamefull = libname + t
You can’t perform that action at this time.
0 commit comments