Cross-Platform build scripts for audio plugins
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
3.3KB

  1. diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py
  2. index 0ea9cfe..1a24d5b 100644
  3. --- a/Lib/distutils/ccompiler.py
  4. +++ b/Lib/distutils/ccompiler.py
  5. @@ -1098,6 +1098,8 @@ def gen_lib_options (compiler, library_dirs, runtime_library_dirs, libraries):
  6. else:
  7. lib_opts.append(opt)
  8. + lib_opts.append("-Wl,-Bdynamic")
  9. +
  10. # XXX it's important that we *not* remove redundant library mentions!
  11. # sometimes you really do have to say "-lfoo -lbar -lfoo" in order to
  12. # resolve all symbols. I just hope we never have to say "-lfoo obj.o
  13. @@ -1115,4 +1117,6 @@ def gen_lib_options (compiler, library_dirs, runtime_library_dirs, libraries):
  14. "'%s' found (skipping)" % lib)
  15. else:
  16. lib_opts.append(compiler.library_option (lib))
  17. +
  18. + lib_opts.append("-Wl,-Bstatic")
  19. return lib_opts
  20. diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py
  21. index dddf412..3edccb6 100644
  22. --- a/Lib/distutils/cygwinccompiler.py
  23. +++ b/Lib/distutils/cygwinccompiler.py
  24. @@ -413,6 +413,9 @@ def _find_exe_version(cmd):
  25. out_string = out.read()
  26. finally:
  27. out.close()
  28. + out_string = out_string.split(b'\n',1)[0].replace(b'-win32',b'')
  29. + if out_string.isdigit():
  30. + return out_string.decode()
  31. result = RE_VERSION.search(out_string)
  32. if result is None:
  33. return None
  34. diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
  35. index f159586..004e89f 100644
  36. --- a/Lib/distutils/unixccompiler.py
  37. +++ b/Lib/distutils/unixccompiler.py
  38. @@ -200,6 +200,9 @@ class UnixCCompiler(CCompiler):
  39. if sys.platform == 'darwin':
  40. linker = _osx_support.compiler_fixup(linker, ld_args)
  41. + else:
  42. + ld_args += linker[i+offset+1:]
  43. + linker = [linker[i+offset]]
  44. self.spawn(linker + ld_args)
  45. except DistutilsExecError as msg:
  46. diff --git a/Misc/python.pc.in b/Misc/python.pc.in
  47. index 3900190..a14e42b 100644
  48. --- a/Misc/python.pc.in
  49. +++ b/Misc/python.pc.in
  50. @@ -9,5 +9,5 @@ Description: Build a C extension for Python
  51. Requires:
  52. Version: @VERSION@
  53. Libs.private: @LIBS@
  54. -Libs: -L${libdir} -lpython@VERSION@@ABIFLAGS@
  55. +Libs: -L${libdir} -L${prefix}/bin -Wl,-Bdynamic -lpython@VERSION@@ABIFLAGS@ -Wl,-Bstatic
  56. Cflags: -I${includedir}/python@VERSION@@ABIFLAGS@
  57. diff --git a/configure.ac b/configure.ac
  58. index 6210e41..51432a8 100644
  59. --- a/configure.ac
  60. +++ b/configure.ac
  61. @@ -1297,7 +1297,7 @@ if test $enable_shared = "yes"; then
  62. *-*-mingw*)
  63. LDLIBRARY='libpython$(LDVERSION).dll.a'
  64. DLLLIBRARY='libpython$(LDVERSION).dll'
  65. - BLDLIBRARY='-L. -lpython$(LDVERSION)'
  66. + BLDLIBRARY='-L. -Wl,-Bdynamic -lpython$(LDVERSION) -Wl,-Bstatic'
  67. ;;
  68. esac
  69. else # shared is disabled
  70. diff --git a/setup.py b/setup.py
  71. index 3a7a2e7..88e116a 100644
  72. --- a/setup.py
  73. +++ b/setup.py
  74. @@ -2289,7 +2289,7 @@ class PyBuildExt(build_ext):
  75. # poor man's shlex, the re module is not available yet.
  76. value = config_vars.get(name)
  77. if not value:
  78. - return ()
  79. + return []
  80. # This trick works because ax_check_openssl uses --libs-only-L,
  81. # --libs-only-l, and --cflags-only-I.
  82. value = ' ' + value