[Python-checkins] CVS: python/dist/src setup.py,1.37,1.38

Guido van Rossum gvanrossum@users.sourceforge.net
Sun, 15 Apr 2001 08:16:14 -0700


Update of /cvsroot/python/python/dist/src
In directory usw-pr-cvs1:/tmp/cvs-serv18669

Modified Files:
	setup.py 
Log Message:
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.


Index: setup.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/setup.py,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** setup.py	2001/03/21 07:44:53	1.37
--- setup.py	2001/04/15 15:16:12	1.38
***************
*** 450,456 ****
          # 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
--- 450,470 ----
          # 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