Making Linux platform testing try both in case processor() returns

something stupid.
This commit is contained in:
user 2013-03-15 04:31:16 +00:00
parent 9e3ca1fdb2
commit 416910dd44

View File

@ -127,16 +127,17 @@ 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"):
platform_ = platform.processor() for platform_ in (platform.processor(),platform.architecture()[0]):
if not platform_: if not platform_: continue
platform_ = platform.architecture()[0]
if platform_ in ["x86_64", "64bit"]: if platform_ in ["x86_64", "64bit"]:
_add_directory(library_dirs, "/lib64") _add_directory(library_dirs, "/lib64")
_add_directory(library_dirs, "/usr/lib64") _add_directory(library_dirs, "/usr/lib64")
_add_directory(library_dirs, "/usr/lib/x86_64-linux-gnu") _add_directory(library_dirs, "/usr/lib/x86_64-linux-gnu")
break
elif platform_ in ["i386", "i686", "32bit"]: elif platform_ in ["i386", "i686", "32bit"]:
_add_directory(library_dirs, "/usr/lib/i386-linux-gnu") _add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
break
else: else:
raise ValueError("Unable to identify Linux platform: `%s`" % platform_) raise ValueError("Unable to identify Linux platform: `%s`" % platform_)