summaryrefslogtreecommitdiff
path: root/python3
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-05-08 14:23:35 +0200
committerMichael Stahl <mstahl@redhat.com>2013-05-08 17:49:57 +0200
commit6afe0e5804f2a23f9fc9842d372fff77fd1023f1 (patch)
tree3220f9e0af0219f123e79164c67be26287e84027 /python3
parent759d02bcdf9d1b6a95b26b483815ce0f4ae38569 (diff)
python3: build against internal zlib when that is requested
Change-Id: I72798f704237f99ed49eeb3633a1e2ef481edeed
Diffstat (limited to 'python3')
-rw-r--r--python3/ExternalProject_python3.mk3
-rw-r--r--python3/UnpackedTarball_python3.mk8
-rw-r--r--python3/python-3.3.0-zlib.patch.143
3 files changed, 53 insertions, 1 deletions
diff --git a/python3/ExternalProject_python3.mk b/python3/ExternalProject_python3.mk
index 72c476d95e1c..f672d71d3c16 100644
--- a/python3/ExternalProject_python3.mk
+++ b/python3/ExternalProject_python3.mk
@@ -12,6 +12,7 @@ $(eval $(call gb_ExternalProject_ExternalProject,python3))
$(eval $(call gb_ExternalProject_use_externals,python3,\
expat \
openssl \
+ zlib \
))
$(eval $(call gb_ExternalProject_register_targets,python3,\
@@ -66,7 +67,7 @@ else
# create a symlink "LO_lib" because the .so are in a directory with platform
# specific name like build/lib.linux-x86_64-3.3
-python3_cflags =
+python3_cflags = $(ZLIB_CFLAGS)
ifeq ($(ENABLE_VALGRIND),TRUE)
python3_cflags += $(VALGRIND_CFLAGS)
endif
diff --git a/python3/UnpackedTarball_python3.mk b/python3/UnpackedTarball_python3.mk
index 0d5fce5e6236..37cf3aa17430 100644
--- a/python3/UnpackedTarball_python3.mk
+++ b/python3/UnpackedTarball_python3.mk
@@ -34,6 +34,14 @@ $(eval $(call gb_UnpackedTarball_add_patches,python3,\
python3/python-3.3.0-pythreadstate.patch.1 \
))
+ifneq ($(COM),MSC)
+ifeq ($(SYSTEM_ZLIB),NO)
+$(eval $(call gb_UnpackedTarball_add_patches,python3,\
+ python3/python-3.3.0-zlib.patch.1 \
+))
+endif
+endif
+
ifneq ($(OS),WNT)
$(eval $(call gb_UnpackedTarball_add_patches,python3,\
python3/python-3.3.0-15833.patch.1 \
diff --git a/python3/python-3.3.0-zlib.patch.1 b/python3/python-3.3.0-zlib.patch.1
new file mode 100644
index 000000000000..a3091ffb79fe
--- /dev/null
+++ b/python3/python-3.3.0-zlib.patch.1
@@ -0,0 +1,43 @@
+sadly python's build system is so awful it needs patching to find internal zlib
+
+--- python3/setup.py 2013-05-08 13:42:03.826304937 +0200
++++ python3/setup.py 2013-05-08 13:57:53.027231320 +0200
+@@ -1332,7 +1332,11 @@
+ #
+ # You can upgrade zlib to version 1.1.4 yourself by going to
+ # http://www.gzip.org/zlib/
+- zlib_inc = find_file('zlib.h', [], inc_dirs)
++ if os.environ.get('SYSTEM_ZLIB') == 'NO':
++ zlib_incdir = os.environ.get('WORKDIR') + '/' + '/UnpackedTarball/zlib/'
++ zlib_inc = find_file('zlib.h', inc_dirs, [zlib_incdir])
++ else:
++ zlib_inc = find_file('zlib.h', [], inc_dirs)
+ have_zlib = False
+ if zlib_inc is not None:
+ zlib_h = zlib_inc[0] + '/zlib.h'
+@@ -1347,13 +1351,23 @@
+ version = line.split()[2]
+ break
+ if version >= version_req:
+- if (self.compiler.find_library_file(lib_dirs, 'z')):
++ if os.environ.get('SYSTEM_ZLIB') == 'NO':
++ zlib_lib = 'zlib'
++ zlib_libdir = os.environ.get('OUTDIR') + '/' + 'lib'
++# zlib_found = find_library_file(self.compiler, zlib_lib, lib_dirs, [zlib_libdir])
++ zlib_found = [zlib_libdir]
++ else:
++ zlib_lib = 'z'
++ zlib_found = self.compiler.find_library_file(lib_dirs, zlib_lib)
++ if zlib_found:
+ 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_lib],
++ include_dirs = zlib_inc,
++ library_dirs = zlib_found,
+ extra_link_args = zlib_extra_link_args))
+ have_zlib = True
+ else: