[Libreoffice-commits] core.git: external/python3

Stephan Bergmann sbergman at redhat.com
Fri Sep 16 16:03:44 UTC 2016


 external/python3/ExternalProject_python3.mk |    1 
 external/python3/UnpackedTarball_python3.mk |    6 +++
 external/python3/internal-zlib.patch.0      |   46 ++++++++++++++++++++++++++++
 3 files changed, 53 insertions(+)

New commits:
commit 5fb8a050210a7cabf49daac0da8f80b94d60de2c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Sep 16 16:07:47 2016 +0200

    external/python3: Fix building against external/zlib
    
    ...whose (static) library is called "zlib" instead of just "z".
    
    (I ran into this when trying to do a 32-bit Linux build in a 64-bit environment,
    with only very limited 32-bit support installed in the system.)
    
    Change-Id: I9286975917ddf643a22803561677af035e66fb98
    Reviewed-on: https://gerrit.libreoffice.org/28964
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/external/python3/ExternalProject_python3.mk b/external/python3/ExternalProject_python3.mk
index 757d782..ef9246e 100644
--- a/external/python3/ExternalProject_python3.mk
+++ b/external/python3/ExternalProject_python3.mk
@@ -91,6 +91,7 @@ $(call gb_ExternalProject_get_state_target,python3,build) :
 		LDFLAGS="$(strip $(LDFLAGS) \
 			$(if $(SYSTEM_OPENSSL),,-L$(call gb_UnpackedTarball_get_dir,openssl)) \
 			$(if $(SYSTEM_EXPAT),,-L$(gb_StaticLibrary_WORKDIR)) \
+			$(if $(SYSTEM_ZLIB),,-L$(gb_StaticLibrary_WORKDIR)) \
 			$(if $(SYSBASE), -L$(SYSBASE)/usr/lib) \
 			$(if $(filter WNT-GCC,$(OS)-$(COM)), -shared-libgcc \
 				$(if $(MINGW_SHARED_GCCLIB),-Wl$(COMMA)--enable-runtime-pseudo-reloc-v2 -Wl$(COMMA)--export-all-symbols)) \
diff --git a/external/python3/UnpackedTarball_python3.mk b/external/python3/UnpackedTarball_python3.mk
index 0e706d7..0c471f0 100644
--- a/external/python3/UnpackedTarball_python3.mk
+++ b/external/python3/UnpackedTarball_python3.mk
@@ -52,4 +52,10 @@ $(eval $(call gb_UnpackedTarball_add_patches,python3,\
 endif
 endif
 
+ifneq ($(SYSTEM_ZLIB),TRUE)
+$(eval $(call gb_UnpackedTarball_add_patches,python3, \
+    external/python3/internal-zlib.patch.0 \
+))
+endif
+
 # vim: set noet sw=4 ts=4:
diff --git a/external/python3/internal-zlib.patch.0 b/external/python3/internal-zlib.patch.0
new file mode 100644
index 0000000..d045f46
--- /dev/null
+++ b/external/python3/internal-zlib.patch.0
@@ -0,0 +1,46 @@
+--- configure
++++ configure
+@@ -11607,13 +11607,13 @@
+ 	;;
+ esac
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz" >&5
+-$as_echo_n "checking for inflateCopy in -lz... " >&6; }
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lzlib" >&5
++$as_echo_n "checking for inflateCopy in -lzlib... " >&6; }
+ if ${ac_cv_lib_z_inflateCopy+:} false; then :
+   $as_echo_n "(cached) " >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lz  $LIBS"
++LIBS="-lzlib  $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+--- setup.py
++++ setup.py
+@@ -1379,13 +1379,13 @@
+                         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, 'zlib')):
+                     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 = ['zlib'],
+                                            extra_link_args = zlib_extra_link_args))
+                     have_zlib = True
+                 else:
+@@ -1399,7 +1399,7 @@
+         # crc32 if we have it.  Otherwise binascii uses its own.
+         if have_zlib:
+             extra_compile_args = ['-DUSE_ZLIB_CRC32']
+-            libraries = ['z']
++            libraries = ['zlib']
+             extra_link_args = zlib_extra_link_args
+         else:
+             extra_compile_args = []


More information about the Libreoffice-commits mailing list