summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2002-02-16 18:23:30 (GMT)
committerMarc-André Lemburg <mal@egenix.com>2002-02-16 18:23:30 (GMT)
commita5d2b4cb180ec87d006d63f838860fba785bcad0 (patch)
treef1ddd4ab82b92077aa8a316639cbdce9ff3370b5 /setup.py
parente4418609f79b94b91bda2621b5e6f067fb6a31d5 (diff)
downloadcpython-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.py45
1 files changed, 24 insertions, 21 deletions
diff --git a/setup.py b/setup.py
index e9758e3..c467ec7 100644
--- a/setup.py
+++ b/setup.py
@@ -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