diff options
author | Brendan McCollam <brendan@mccoll.am> | 2015-09-07 19:55:09 -0500 |
---|---|---|
committer | Brendan McCollam <brendan@mccoll.am> | 2015-09-07 19:55:09 -0500 |
commit | ae454130b0bbdbb60e9d2081eca6d181eb6fa686 (patch) | |
tree | 70004a36b926fa4f187bc02d185aab27e4cbc17c /src/_cffi_src/build_openssl.py | |
parent | 1b3b3ce19d76ef3d1d492db6d85fd2df52781e2c (diff) | |
parent | 786ded65fd2f7a2ef851e9f6f132f5fc5bc962d9 (diff) | |
download | cryptography-ae454130b0bbdbb60e9d2081eca6d181eb6fa686.tar.gz cryptography-ae454130b0bbdbb60e9d2081eca6d181eb6fa686.tar.bz2 cryptography-ae454130b0bbdbb60e9d2081eca6d181eb6fa686.zip |
Merge branch 'master' into add_name_to_oids
Diffstat (limited to 'src/_cffi_src/build_openssl.py')
-rw-r--r-- | src/_cffi_src/build_openssl.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/_cffi_src/build_openssl.py b/src/_cffi_src/build_openssl.py index 6a5bf2da..defa69d3 100644 --- a/src/_cffi_src/build_openssl.py +++ b/src/_cffi_src/build_openssl.py @@ -4,6 +4,7 @@ from __future__ import absolute_import, division, print_function +import os import sys from _cffi_src.utils import build_ffi_for_binding, extra_link_args @@ -11,15 +12,27 @@ from _cffi_src.utils import build_ffi_for_binding, extra_link_args def _get_openssl_libraries(platform): # OpenSSL goes by a different library name on different operating systems. - if platform != "win32": + if platform == "darwin": + return _osx_libraries( + os.environ.get("CRYPTOGRAPHY_OSX_NO_LINK_FLAGS") + ) + elif platform == "win32": + return ["libeay32", "ssleay32", "advapi32", + "crypt32", "gdi32", "user32", "ws2_32"] + else: # In some circumstances, the order in which these libs are # specified on the linker command-line is significant; # libssl must come before libcrypto # (http://marc.info/?l=openssl-users&m=135361825921871) return ["ssl", "crypto"] + + +def _osx_libraries(build_static): + # For building statically we don't want to pass the -lssl or -lcrypto flags + if build_static == "1": + return [] else: - return ["libeay32", "ssleay32", "advapi32", - "crypt32", "gdi32", "user32", "ws2_32"] + return ["ssl", "crypto"] _OSX_PRE_INCLUDE = """ |