patch-setup_py 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. --- Python-2.7.5.orig/setup.py 2013-05-12 05:32:54.000000000 +0200
  2. +++ Python-2.7.5/setup.py 2013-10-29 07:33:37.000000000 +0100
  3. @@ -74,7 +74,7 @@ def find_file(filename, std_dirs, paths)
  4. 'paths' is a list of additional locations to check; if the file is
  5. found in one of them, the resulting list will contain the directory.
  6. """
  7. - if host_platform == 'darwin':
  8. + if host_platform == 'darwin' and not cross_compiling:
  9. # Honor the MacOSX SDK setting when one was specified.
  10. # An SDK is a directory with the same structure as a real
  11. # system, but with only header files and libraries.
  12. @@ -84,7 +84,7 @@ def find_file(filename, std_dirs, paths)
  13. for dir in std_dirs:
  14. f = os.path.join(dir, filename)
  15. - if host_platform == 'darwin' and is_macosx_sdk_path(dir):
  16. + if host_platform == 'darwin' and is_macosx_sdk_path(dir) and not cross_compiling:
  17. f = os.path.join(sysroot, dir[1:], filename)
  18. if os.path.exists(f): return []
  19. @@ -93,7 +93,7 @@ def find_file(filename, std_dirs, paths)
  20. for dir in paths:
  21. f = os.path.join(dir, filename)
  22. - if host_platform == 'darwin' and is_macosx_sdk_path(dir):
  23. + if host_platform == 'darwin' and is_macosx_sdk_path(dir) and not cross_compiling:
  24. f = os.path.join(sysroot, dir[1:], filename)
  25. if os.path.exists(f):
  26. @@ -107,7 +107,7 @@ def find_library_file(compiler, libname,
  27. if result is None:
  28. return None
  29. - if host_platform == 'darwin':
  30. + if host_platform == 'darwin' and not cross_compiling:
  31. sysroot = macosx_sdk_root()
  32. # Check whether the found file is in one of the standard directories
  33. @@ -116,7 +116,7 @@ def find_library_file(compiler, libname,
  34. # Ensure path doesn't end with path separator
  35. p = p.rstrip(os.sep)
  36. - if host_platform == 'darwin' and is_macosx_sdk_path(p):
  37. + if host_platform == 'darwin' and is_macosx_sdk_path(p) and not cross_compiling:
  38. if os.path.join(sysroot, p[1:]) == dirname:
  39. return [ ]
  40. @@ -129,7 +129,7 @@ def find_library_file(compiler, libname,
  41. # Ensure path doesn't end with path separator
  42. p = p.rstrip(os.sep)
  43. - if host_platform == 'darwin' and is_macosx_sdk_path(p):
  44. + if host_platform == 'darwin' and is_macosx_sdk_path(p) and not cross_compiling:
  45. if os.path.join(sysroot, p[1:]) == dirname:
  46. return [ p ]
  47. @@ -437,10 +437,12 @@ class PyBuildExt(build_ext):
  48. def detect_modules(self):
  49. # Ensure that /usr/local is always used
  50. - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
  51. - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
  52. + if not cross_compiling:
  53. + add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
  54. + add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
  55. self.add_gcc_paths()
  56. - self.add_multiarch_paths()
  57. + if not cross_compiling:
  58. + self.add_multiarch_paths()
  59. # Add paths specified in the environment variables LDFLAGS and
  60. # CPPFLAGS for header and library files.
  61. @@ -477,7 +479,8 @@ class PyBuildExt(build_ext):
  62. add_dir_to_list(dir_list, directory)
  63. if os.path.normpath(sys.prefix) != '/usr' \
  64. - and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
  65. + and not sysconfig.get_config_var('PYTHONFRAMEWORK') \
  66. + and not cross_compiling:
  67. # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
  68. # (PYTHONFRAMEWORK is set) to avoid # linking problems when
  69. # building a framework with different architectures than
  70. @@ -530,7 +533,7 @@ class PyBuildExt(build_ext):
  71. if host_platform == 'hp-ux11':
  72. lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32']
  73. - if host_platform == 'darwin':
  74. + if host_platform == 'darwin' and not cross_compiling:
  75. # This should work on any unixy platform ;-)
  76. # If the user has bothered specifying additional -I and -L flags
  77. # in OPT and LDFLAGS we might as well use them here.