@@ -1633,56 +1633,27 @@ def detect_platform_specific_exts(self):
1633
1633
'-framework' , 'CoreFoundation' ]))
1634
1634
1635
1635
def detect_compress_exts (self ):
1636
- # Andrew Kuchling's zlib module. Note that some versions of zlib
1637
- # 1.1.3 have security problems. See CERT Advisory CA-2002-07:
1638
- # http://www.cert.org/advisories/CA-2002-07.html
1639
- #
1640
- # zlib 1.1.4 is fixed, but at least one vendor (RedHat) has decided to
1641
- # patch its zlib 1.1.3 package instead of upgrading to 1.1.4. For
1642
- # now, we still accept 1.1.3, because we think it's difficult to
1643
- # exploit this in Python, and we'd rather make it RedHat's problem
1644
- # than our problem <wink>.
1645
- #
1646
- # You can upgrade zlib to version 1.1.4 yourself by going to
1647
- # http://www.gzip.org/zlib/
1648
- zlib_inc = find_file ('zlib.h' , [], self .inc_dirs )
1649
- have_zlib = False
1650
- if zlib_inc is not None :
1651
- zlib_h = zlib_inc [0 ] + '/zlib.h'
1652
- version = '"0.0.0"'
1653
- version_req = '"1.1.3"'
1654
- if MACOS and is_macosx_sdk_path (zlib_h ):
1655
- zlib_h = os .path .join (macosx_sdk_root (), zlib_h [1 :])
1656
- with open (zlib_h ) as fp :
1657
- while 1 :
1658
- line = fp .readline ()
1659
- if not line :
1660
- break
1661
- if line .startswith ('#define ZLIB_VERSION' ):
1662
- version = line .split ()[2 ]
1663
- break
1664
- if version >= version_req :
1665
- if (self .compiler .find_library_file (self .lib_dirs , 'z' )):
1666
- self .add (Extension ('zlib' , ['zlibmodule.c' ],
1667
- libraries = ['z' ]))
1668
- have_zlib = True
1669
- else :
1670
- self .missing .append ('zlib' )
1671
- else :
1672
- self .missing .append ('zlib' )
1636
+ # Andrew Kuchling's zlib module.
1637
+ have_zlib = (
1638
+ find_file ('zlib.h' , self .inc_dirs , []) is not None and
1639
+ self .compiler .find_library_file (self .lib_dirs , 'z' )
1640
+ )
1641
+ if have_zlib :
1642
+ self .add (Extension ('zlib' , ['zlibmodule.c' ],
1643
+ libraries = ['z' ]))
1673
1644
else :
1674
1645
self .missing .append ('zlib' )
1675
1646
1676
1647
# Helper module for various ascii-encoders. Uses zlib for an optimized
1677
1648
# crc32 if we have it. Otherwise binascii uses its own.
1678
- extra_compile_args = []
1679
1649
if have_zlib :
1680
- extra_compile_args . append ( '-DUSE_ZLIB_CRC32' )
1650
+ define_macros = [( 'USE_ZLIB_CRC32' , None )]
1681
1651
libraries = ['z' ]
1682
1652
else :
1653
+ define_macros = None
1683
1654
libraries = []
1684
1655
self .add (Extension ('binascii' , ['binascii.c' ],
1685
- extra_compile_args = extra_compile_args ,
1656
+ define_macros = define_macros ,
1686
1657
libraries = libraries ))
1687
1658
1688
1659
# Gustavo Niemeyer's bz2 module.
0 commit comments