bpo-31904: Don't build the _crypt extension on VxWorks (GH-12833)

This commit is contained in:
pxinwr 2019-04-15 17:02:20 +08:00 committed by Victor Stinner
parent 2430d532e2
commit 236d0b75c4
3 changed files with 10 additions and 6 deletions

View File

@ -30,6 +30,8 @@ the :manpage:`crypt(3)` routine in the running system. Therefore, any
extensions available on the current implementation will also be available on
this module.
.. availability:: Unix. Not available on VxWorks.
Hashing Methods
---------------

View File

@ -0,0 +1 @@
Don't build the ``_crypt`` extension on VxWorks.

View File

@ -973,16 +973,17 @@ class PyBuildExt(build_ext):
def detect_crypt(self):
# crypt module.
if VXWORKS:
# bpo-31904: crypt() function is not provided by VxWorks.
# DES_crypt() OpenSSL provides is too weak to implement
# the encryption.
return
if self.compiler.find_library_file(self.lib_dirs, 'crypt'):
libs = ['crypt']
else:
libs = []
if not VXWORKS:
self.add(Extension('_crypt', ['_cryptmodule.c'],
libraries=libs))
elif self.compiler.find_library_file(self.lib_dirs, 'OPENSSL'):
libs = ['OPENSSL']
self.add(Extension('_crypt', ['_cryptmodule.c'],
libraries=libs))