提交 6465f22c authored 作者: Frederic's avatar Frederic

Move the addition of python lib dir to the common place for later reuse.

上级 80197cf5
......@@ -1627,6 +1627,16 @@ def std_lib_dirs_and_libs():
# Typical include directory: /usr/include/python2.6
libname = os.path.basename(python_inc)
std_lib_dirs_and_libs.data = [libname], []
# sometimes, the linker cannot find -lpython so we need to tell it
# explicitly where it is located this returns
# somepath/lib/python2.x
python_lib = distutils.sysconfig.get_python_lib(plat_specific=1,
standard_lib=1)
python_lib = os.path.dirname(python_lib)
if python_lib not in std_lib_dirs_and_libs.data[1]:
std_lib_dirs_and_libs.data[1].append(python_lib)
return std_lib_dirs_and_libs.data
std_lib_dirs_and_libs.data = None
......@@ -2107,15 +2117,6 @@ class GCC_compiler(Compiler):
libs = std_libs() + libs
lib_dirs = std_lib_dirs() + lib_dirs
# sometimes, the linker cannot find -lpython so we need to tell it
# explicitly where it is located
# this returns somepath/lib/python2.x
python_lib = distutils.sysconfig.get_python_lib(plat_specific=1,
standard_lib=1)
python_lib = os.path.dirname(python_lib)
if python_lib not in lib_dirs:
lib_dirs.append(python_lib)
cppfilename = os.path.join(location, 'mod.cpp')
cppfile = open(cppfilename, 'w')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论