Statically linking OpenSSL with M2Crypto
M2Crypto uses the standard
python setup.py [build|install]
step to build and install the module. distutils/setuptools allows for some tweaking, but I can't seem to find a way to statically link OpenSSL into the module - there doesn't appear to be any facility to make this change.
Is there any way to build M2Crypto with a statically linked OpenSSL? (I am willing to bail on setup.py
and do it by hand if that's the only way, would just like to query if anyone has 开发者_Go百科tackled this before I go and spend hours solving an already solved problem).
You need the static link libraries for OpenSSL (ssleay32, libeay32), which you might have to build yourself. On Windows you'll have to change setup.py to include some more libraries, e.g.:
-self.libraries = ['ssleay32', 'libeay32']
+self.libraries = ['ssleay32', 'libeay32', 'crypt32', 'user32', 'gdi32', 'kernel32', 'ws2_32', 'advapi32']
Works for me.
精彩评论