summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-04-15 15:16:12 (GMT)
committerGuido van Rossum <guido@python.org>2001-04-15 15:16:12 (GMT)
commite697091c45001a1674434a553d67e15f2c6b13b8 (patch)
tree2b17747d159ff640fe24e1f903a4582cf685dd5c /setup.py
parent2b5ff073ab9c232307f82dfd1cab0589ef293df5 (diff)
downloadcpython-e697091c45001a1674434a553d67e15f2c6b13b8.zip
cpython-e697091c45001a1674434a553d67e15f2c6b13b8.tar.gz
cpython-e697091c45001a1674434a553d67e15f2c6b13b8.tar.bz2
Patch by Mark Favas to ensure that the zlib we find is 1.1.3 or
later. This assumes that zlib.h has a line of the form #define ZLIB_VERSION "1.1.3" This solves the problem where a zlib installation is found but it is an older version -- this would break the build, while a better solution is to simply ignore that zlib installation.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index d99f43d..5fc981c 100644
--- a/setup.py
+++ b/setup.py
@@ -449,9 +449,23 @@ class PyBuildExt(build_ext):
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See http://www.cdrom.com/pub/infozip/zlib/
- if (self.compiler.find_library_file(lib_dirs, 'z')):
- exts.append( Extension('zlib', ['zlibmodule.c'],
- libraries = ['z']) )
+ zlib_inc = find_file('zlib.h', [], inc_dirs)
+ if zlib_inc is not None:
+ zlib_h = zlib_inc[0] + '/zlib.h'
+ version = '"0.0.0"'
+ version_req = '"1.1.3"'
+ fp = open(zlib_h)
+ while 1:
+ line = fp.readline()
+ if not line:
+ break
+ if line.find('#define ZLIB_VERSION', 0) == 0:
+ version = line.split()[2]
+ break
+ if version >= version_req:
+ if (self.compiler.find_library_file(lib_dirs, 'z')):
+ exts.append( Extension('zlib', ['zlibmodule.c'],
+ libraries = ['z']) )
# Interface to the Expat XML parser
#