mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Don't try to build ctypes when configuration of libffi fails.
This commit is contained in:
parent
eba43c157b
commit
795246cf99
1 changed files with 4 additions and 2 deletions
6
setup.py
6
setup.py
|
|
@ -181,7 +181,8 @@ class PyBuildExt(build_ext):
|
||||||
def build_extension(self, ext):
|
def build_extension(self, ext):
|
||||||
|
|
||||||
if ext.name == '_ctypes':
|
if ext.name == '_ctypes':
|
||||||
self.configure_ctypes(ext)
|
if not self.configure_ctypes(ext):
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
build_ext.build_extension(self, ext)
|
build_ext.build_extension(self, ext)
|
||||||
|
|
@ -1287,7 +1288,7 @@ class PyBuildExt(build_ext):
|
||||||
res = os.system(cmd)
|
res = os.system(cmd)
|
||||||
if res or not os.path.exists(ffi_configfile):
|
if res or not os.path.exists(ffi_configfile):
|
||||||
print "Failed to configure _ctypes module"
|
print "Failed to configure _ctypes module"
|
||||||
return
|
return False
|
||||||
|
|
||||||
fficonfig = {}
|
fficonfig = {}
|
||||||
execfile(ffi_configfile, globals(), fficonfig)
|
execfile(ffi_configfile, globals(), fficonfig)
|
||||||
|
|
@ -1303,6 +1304,7 @@ class PyBuildExt(build_ext):
|
||||||
ext.sources.extend(fficonfig['ffi_sources'])
|
ext.sources.extend(fficonfig['ffi_sources'])
|
||||||
ext.include_dirs.extend(include_dirs)
|
ext.include_dirs.extend(include_dirs)
|
||||||
ext.extra_compile_args.extend(extra_compile_args)
|
ext.extra_compile_args.extend(extra_compile_args)
|
||||||
|
return True
|
||||||
|
|
||||||
def detect_ctypes(self):
|
def detect_ctypes(self):
|
||||||
include_dirs = []
|
include_dirs = []
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue