提交 31e87ecf authored 作者: eckdoug@waits.local's avatar eckdoug@waits.local

Fix for OS X compilation to avoid conflict with frameworks

上级 a6ea5b1e
...@@ -501,6 +501,10 @@ def gcc_module_compile_str(module_name, src_code, location=None, include_dirs=[] ...@@ -501,6 +501,10 @@ def gcc_module_compile_str(module_name, src_code, location=None, include_dirs=[]
#backport #backport
#preargs= [] if preargs is None else list(preargs) #preargs= [] if preargs is None else list(preargs)
preargs.append('-fPIC') preargs.append('-fPIC')
if sys.platform=='darwin' :
preargs.extend(['-undefined','dynamic_lookup'])
no_opt = False no_opt = False
include_dirs = [distutils.sysconfig.get_python_inc()] + \ include_dirs = [distutils.sysconfig.get_python_inc()] + \
...@@ -517,7 +521,11 @@ def gcc_module_compile_str(module_name, src_code, location=None, include_dirs=[] ...@@ -517,7 +521,11 @@ def gcc_module_compile_str(module_name, src_code, location=None, include_dirs=[]
else: else:
# Typical include directory: /usr/include/python2.6 # Typical include directory: /usr/include/python2.6
libname = os.path.basename(python_inc) libname = os.path.basename(python_inc)
libs = [libname] + libs if sys.platform=='darwin' :
#we will not link against -lpython2.5. Instead we will use -undefined dynamic_lookup. This makes it easier to avoid problems with frameworks
pass
else :
libs = [libname] + libs
workdir = location workdir = location
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论