a better fix for scons finding pyconfig.h in ubuntu 12.10

This commit is contained in:
Antony Riakiotakis
2013-01-22 16:40:40 +00:00
parent 78f5d531a4
commit 10261c4250
2 changed files with 9 additions and 2 deletions

View File

@@ -15,6 +15,11 @@ def FindPython():
abi_flags = cur_flags
break
# Find config.h. In some distros, such as ubuntu 12.10 they are not in standard include dir.
incconf64 = os.path.join(include, "x86_64-linux-gnu", "python" + version + cur_flags, "pyconfig.h")
if os.path.exists(incconf64):
incconf = os.path.join(include, "x86_64-linux-gnu", "python" + version + cur_flags)
# Determine whether python is in /usr/lib or /usr/lib64
lib32 = os.path.join(python, "lib", "python" + version, "sysconfig.py")
lib64 = os.path.join(python, "lib64", "python" + version, "sysconfig.py")
@@ -29,4 +34,5 @@ def FindPython():
return {'PYTHON': python,
"VERSION": version,
'LIBPATH': libpath,
'ABI_FLAGS': abi_flags}
'ABI_FLAGS': abi_flags,
'CONFIG': incconf}

View File

@@ -5,9 +5,10 @@ py = FindPython()
BF_PYTHON_ABI_FLAGS = py['ABI_FLAGS']
BF_PYTHON = py['PYTHON']
BF_PYTHON_LIBPATH = py['LIBPATH']
BF_PYTHON_CONFIG = py['CONFIG']
BF_PYTHON_VERSION = py['VERSION']
WITH_BF_STATICPYTHON = False
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS}'
BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS} ' + BF_PYTHON_CONFIG
BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS}' # BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']