mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-16 18:24:45 +03:00
Merge ce2bb05a2b
into be11bd0afe
This commit is contained in:
commit
1f486eaa8a
11
setup.py
11
setup.py
|
@ -146,9 +146,13 @@ class pil_build_ext(build_ext):
|
||||||
('disable-%s' % x, None, 'Disable support for %s' % x) for x in feature
|
('disable-%s' % x, None, 'Disable support for %s' % x) for x in feature
|
||||||
] + [
|
] + [
|
||||||
('enable-%s' % x, None, 'Enable support for %s' % x) for x in feature
|
('enable-%s' % x, None, 'Enable support for %s' % x) for x in feature
|
||||||
] + [('debug', None, 'Debug logging')]
|
] + [
|
||||||
|
('disable-platform-guessing', None, 'Disable platform guessing on Linux'),
|
||||||
|
('debug', None, 'Debug logging')
|
||||||
|
]
|
||||||
|
|
||||||
def initialize_options(self):
|
def initialize_options(self):
|
||||||
|
self.disable_platform_guessing = None
|
||||||
build_ext.initialize_options(self)
|
build_ext.initialize_options(self)
|
||||||
for x in self.feature:
|
for x in self.feature:
|
||||||
setattr(self, 'disable_%s' % x, None)
|
setattr(self, 'disable_%s' % x, None)
|
||||||
|
@ -266,6 +270,9 @@ class pil_build_ext(build_ext):
|
||||||
_add_directory(include_dirs, "/usr/X11/include")
|
_add_directory(include_dirs, "/usr/X11/include")
|
||||||
|
|
||||||
elif sys.platform.startswith("linux"):
|
elif sys.platform.startswith("linux"):
|
||||||
|
if self.disable_platform_guessing:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
arch_tp = (plat.processor(), plat.architecture()[0])
|
arch_tp = (plat.processor(), plat.architecture()[0])
|
||||||
if arch_tp == ("x86_64", "32bit"):
|
if arch_tp == ("x86_64", "32bit"):
|
||||||
# 32-bit build on 64-bit machine.
|
# 32-bit build on 64-bit machine.
|
||||||
|
@ -382,11 +389,13 @@ class pil_build_ext(build_ext):
|
||||||
|
|
||||||
# look for tcl specific subdirectory (e.g debian)
|
# look for tcl specific subdirectory (e.g debian)
|
||||||
if _tkinter:
|
if _tkinter:
|
||||||
|
if not self.disable_platform_guessing:
|
||||||
tcl_dir = "/usr/include/tcl" + TCL_VERSION
|
tcl_dir = "/usr/include/tcl" + TCL_VERSION
|
||||||
if os.path.isfile(os.path.join(tcl_dir, "tk.h")):
|
if os.path.isfile(os.path.join(tcl_dir, "tk.h")):
|
||||||
_add_directory(include_dirs, tcl_dir)
|
_add_directory(include_dirs, tcl_dir)
|
||||||
|
|
||||||
# standard locations
|
# standard locations
|
||||||
|
if not self.disable_platform_guessing:
|
||||||
_add_directory(library_dirs, "/usr/local/lib")
|
_add_directory(library_dirs, "/usr/local/lib")
|
||||||
_add_directory(include_dirs, "/usr/local/include")
|
_add_directory(include_dirs, "/usr/local/include")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user