Build environment: Make sure Python is linkign against static Zlib
There is system-wide libz development package installed by default, needed for some other dependencies. This patch ensures Python will use our own self-compiled Zlib.
This commit is contained in:
29
build_files/build_environment/patches/python_linux.diff
Normal file
29
build_files/build_environment/patches/python_linux.diff
Normal file
@@ -0,0 +1,29 @@
|
||||
diff --git a/setup.py.orig b/setup.py
|
||||
index a97a755..ee2bfad 100644
|
||||
--- a/setup.py.orig
|
||||
+++ b/setup.py
|
||||
@@ -1422,13 +1422,13 @@ class PyBuildExt(build_ext):
|
||||
version = line.split()[2]
|
||||
break
|
||||
if version >= version_req:
|
||||
- if (self.compiler.find_library_file(lib_dirs, 'z')):
|
||||
+ if (self.compiler.find_library_file(lib_dirs, 'z_pic')):
|
||||
if host_platform == "darwin":
|
||||
zlib_extra_link_args = ('-Wl,-search_paths_first',)
|
||||
else:
|
||||
zlib_extra_link_args = ()
|
||||
exts.append( Extension('zlib', ['zlibmodule.c'],
|
||||
- libraries = ['z'],
|
||||
+ libraries = ['z_pic'],
|
||||
extra_link_args = zlib_extra_link_args))
|
||||
have_zlib = True
|
||||
else:
|
||||
@@ -1442,7 +1442,7 @@ class PyBuildExt(build_ext):
|
||||
# crc32 if we have it. Otherwise binascii uses its own.
|
||||
if have_zlib:
|
||||
extra_compile_args = ['-DUSE_ZLIB_CRC32']
|
||||
- libraries = ['z']
|
||||
+ libraries = ['z_pic']
|
||||
extra_link_args = zlib_extra_link_args
|
||||
else:
|
||||
extra_compile_args = []
|
||||
Reference in New Issue
Block a user