[Python-checkins] CVS: python/dist/src setup.py,1.81,1.82

M.-A. Lemburg lemburg@users.sourceforge.net
Sat, 16 Feb 2002 10:23:32 -0800


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

Modified Files:
	setup.py 
Log Message:
Break SSL support out of _socket module and place it into a new
helper module _ssl.

The support for the RAND_* APIs in _ssl is now only enabled
for OpenSSL 0.9.5 and up since they were added in that
release.

Note that socketmodule.* should really be renamed to _socket.* --
unfortunately, this seems to lose the CVS history of the file.

Please review and test... I was only able to test the header file 
chaos in socketmodule.c/h on Linux. The test run through fine
and compiles don't give errors or warnings.

WARNING: This patch does *not* include changes to the various 
non-Unix build process files.



Index: setup.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/setup.py,v
retrieving revision 1.81
retrieving revision 1.82
diff -C2 -d -r1.81 -r1.82
*** setup.py	14 Feb 2002 01:25:37 -0000	1.81
--- setup.py	16 Feb 2002 18:23:29 -0000	1.82
***************
*** 174,192 ****
          try:
              imp.load_dynamic(ext.name, ext_filename)
!         except ImportError:
!             self.announce('WARNING: removing "%s" since importing it failed' %
!                           ext.name)
!             assert not self.inplace
!             fullname = self.get_ext_fullname(ext.name)
!             ext_filename = os.path.join(self.build_lib,
!                                         self.get_ext_filename(fullname))
!             os.remove(ext_filename)
  
!             # XXX -- This relies on a Vile HACK in
!             # distutils.command.build_ext.build_extension().  The
!             # _built_objects attribute is stored there strictly for
!             # use here.
!             for filename in self._built_objects:
!                 os.remove(filename)
  
      def get_platform (self):
--- 174,197 ----
          try:
              imp.load_dynamic(ext.name, ext_filename)
!         except ImportError, why:
  
!             if 1:
!                 self.announce('*** WARNING: removing "%s" since importing it'
!                               ' failed: %s' % (ext.name, why))
!                 assert not self.inplace
!                 fullname = self.get_ext_fullname(ext.name)
!                 ext_filename = os.path.join(self.build_lib,
!                                             self.get_ext_filename(fullname))
!                 os.remove(ext_filename)
! 
!                 # XXX -- This relies on a Vile HACK in
!                 # distutils.command.build_ext.build_extension().  The
!                 # _built_objects attribute is stored there strictly for
!                 # use here.
!                 for filename in self._built_objects:
!                     os.remove(filename)
!             else:
!                 self.announce('*** WARNING: importing extension "%s" '
!                               'failed: %s' % (ext.name, why))
  
      def get_platform (self):
***************
*** 360,364 ****
  
          # socket(2)
!         # Detect SSL support for the socket module
          ssl_incs = find_file('openssl/ssl.h', inc_dirs,
                               ['/usr/local/ssl/include',
--- 365,370 ----
  
          # socket(2)
!         exts.append( Extension('_socket', ['socketmodule.c']) )
!         # Detect SSL support for the socket module (via _ssl)
          ssl_incs = find_file('openssl/ssl.h', inc_dirs,
                               ['/usr/local/ssl/include',
***************
*** 373,383 ****
          if (ssl_incs is not None and
              ssl_libs is not None):
!             exts.append( Extension('_socket', ['socketmodule.c'],
                                     include_dirs = ssl_incs,
                                     library_dirs = ssl_libs,
!                                    libraries = ['ssl', 'crypto'],
!                                    define_macros = [('USE_SSL',1)] ) )
!         else:
!             exts.append( Extension('_socket', ['socketmodule.c']) )
  
          # Modules that provide persistent dictionary-like semantics.  You will
--- 379,386 ----
          if (ssl_incs is not None and
              ssl_libs is not None):
!             exts.append( Extension('_ssl', ['_ssl.c'],
                                     include_dirs = ssl_incs,
                                     library_dirs = ssl_libs,
!                                    libraries = ['ssl', 'crypto']) )
  
          # Modules that provide persistent dictionary-like semantics.  You will