[pypy-svn] r39223 - pypy/dist/pypy/module/crypt

mwh at codespeak.net mwh at codespeak.net
Tue Feb 20 11:46:28 CET 2007


Author: mwh
Date: Tue Feb 20 11:46:27 2007
New Revision: 39223

Modified:
   pypy/dist/pypy/module/crypt/interp_crypt.py
Log:
you don't want -lcrypt to end up in the linker command on darwin.
this is probably needlessly tortuous, but hey, it works.


Modified: pypy/dist/pypy/module/crypt/interp_crypt.py
==============================================================================
--- pypy/dist/pypy/module/crypt/interp_crypt.py	(original)
+++ pypy/dist/pypy/module/crypt/interp_crypt.py	Tue Feb 20 11:46:27 2007
@@ -8,10 +8,16 @@
 
 class CConfig:
     _includes_ = ('unistd.h',)
-    cryptlib = ctypes_platform.Library('crypt')
+    if sys.platform != 'darwin':
+        cryptlib = ctypes_platform.Library('crypt')
 
 globals().update(ctypes_platform.configure(CConfig))
 
+if sys.platform == 'darwin':
+    dllname = find_library('c')
+    assert dllname is not None
+    cryptlib = cdll.LoadLibrary(dllname)
+
 c_crypt = cryptlib.crypt 
 c_crypt.argtypes = [c_char_p, c_char_p]
 c_crypt.restype = c_char_p 



More information about the Pypy-commit mailing list