--- origsrc/Lib/ctypes/util.py 2007-09-14 15:05:26.000000000 -0500 +++ src/Lib/ctypes/util.py 2008-11-25 17:54:47.319296200 -0600 @@ -41,6 +41,20 @@ continue return None +elif sys.platform == "cygwin": + def find_library(name): + for libdir in ['/usr/lib', '/usr/local/lib']: + for libext in ['lib%s.dll.a' % name, 'lib%s.a' % name]: + implib = os.path.join(libdir, libext) + if not os.path.exists(implib): + continue + cmd = "dlltool -I " + implib + " 2>/dev/null" + res = os.popen(cmd).read().replace("\n","") + if not res: + continue + return res + return None + elif os.name == "posix": # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump import re, tempfile, errno @@ -157,6 +173,10 @@ print cdll.LoadLibrary("libcrypto.dylib") print cdll.LoadLibrary("libSystem.dylib") print cdll.LoadLibrary("System.framework/System") + elif sys.platform == "cygwin": + print cdll.LoadLibrary("cygbz2-1.dll") + print find_library("crypt") + print cdll.LoadLibrary("cygcrypt-0.dll") else: print cdll.LoadLibrary("libm.so") print cdll.LoadLibrary("libcrypt.so")