[Patches] [ python-Patches-416262 ] 2.1c1: make setup.py check zlib version

noreply@sourceforge.net noreply@sourceforge.net
Sun, 15 Apr 2001 06:14:24 -0700


Patches item #416262, was updated on 2001-04-15 06:14
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=416262&group_id=5470

Category: Build
Group: None
Status: Open
Priority: 5
Submitted By: Mark Favas (mfavas)
Assigned to: Nobody/Anonymous (nobody)
Summary: 2.1c1: make setup.py check zlib version

Initial Comment:
Currently, setup.py will build the zlib module without
checking whether the version of zlib on the target
system is up to date (or at least 1.1.3). The module
will thus be built on a stock SGI system where the zlib
version is 1.0.4. WHen the zlib test is run, a core
dump results. The patch below checks the version of
zlib, and only builds if >= 1.1.3

*** setup.py.orig       Sun Apr 15 20:59:34 2001
--- setup.py    Sun Apr 15 21:00:53 2001
***************
*** 449,457 ****
          # 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'])
)
  
          # Interface to the Expat XML parser
          #
--- 449,471 ----
          # Andrew Kuchling's zlib module.
          # This require zlib 1.1.3 (or later).
          # See http://www.cdrom.com/pub/infozip/zlib/
!         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
          #


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=416262&group_id=5470