diff options
author | Marc-André Lemburg <mal@egenix.com> | 2002-02-16 18:23:30 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2002-02-16 18:23:30 (GMT) |
commit | a5d2b4cb180ec87d006d63f838860fba785bcad0 (patch) | |
tree | f1ddd4ab82b92077aa8a316639cbdce9ff3370b5 /setup.py | |
parent | e4418609f79b94b91bda2621b5e6f067fb6a31d5 (diff) | |
download | cpython-a5d2b4cb180ec87d006d63f838860fba785bcad0.zip cpython-a5d2b4cb180ec87d006d63f838860fba785bcad0.tar.gz cpython-a5d2b4cb180ec87d006d63f838860fba785bcad0.tar.bz2 |
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.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 45 |
1 files changed, 24 insertions, 21 deletions
@@ -173,21 +173,26 @@ class PyBuildExt(build_ext): self.get_ext_filename(self.get_ext_fullname(ext.name))) 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) + 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): # Get value of sys.platform @@ -359,7 +364,8 @@ class PyBuildExt(build_ext): exts.append( Extension('crypt', ['cryptmodule.c'], libraries=libs) ) # socket(2) - # Detect SSL support for the socket module + 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', '/usr/contrib/ssl/include/' @@ -372,13 +378,10 @@ class PyBuildExt(build_ext): if (ssl_incs is not None and ssl_libs is not None): - exts.append( Extension('_socket', ['socketmodule.c'], + exts.append( Extension('_ssl', ['_ssl.c'], include_dirs = ssl_incs, library_dirs = ssl_libs, - libraries = ['ssl', 'crypto'], - define_macros = [('USE_SSL',1)] ) ) - else: - exts.append( Extension('_socket', ['socketmodule.c']) ) + libraries = ['ssl', 'crypto']) ) # Modules that provide persistent dictionary-like semantics. You will # probably want to arrange for at least one of them to be available on |