Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(120425)

Side by Side Diff: Lib/ctypes/util.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/ctypes/test/test_win32.py ('k') | Lib/distutils/tests/test_build_ext.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import sys, os 1 import sys, os
2 import contextlib 2 import contextlib
3 import subprocess 3 import subprocess
4 4
5 # find_library(name) returns the pathname of a library, or None. 5 # find_library(name) returns the pathname of a library, or None.
6 if os.name == "nt": 6 if os.name == "nt":
7 7
8 def _get_build_version(): 8 def _get_build_version():
9 """Return the version of MSVC that was used to build Python. 9 """Return the version of MSVC that was used to build Python.
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 if os.name == "ce": 69 if os.name == "ce":
70 # search path according to MSDN: 70 # search path according to MSDN:
71 # - absolute path specified by filename 71 # - absolute path specified by filename
72 # - The .exe launch directory 72 # - The .exe launch directory
73 # - the Windows directory 73 # - the Windows directory
74 # - ROM dll files (where are they?) 74 # - ROM dll files (where are they?)
75 # - OEM specified search path: HKLM\Loader\SystemPath 75 # - OEM specified search path: HKLM\Loader\SystemPath
76 def find_library(name): 76 def find_library(name):
77 return name 77 return name
78 78
79 if os.name == "posix" and sys.platform == "darwin": 79 if os.name == "posix" and sys.platform in ("darwin", "ios"):
80 from ctypes.macholib.dyld import dyld_find as _dyld_find 80 from ctypes.macholib.dyld import dyld_find as _dyld_find
81 def find_library(name): 81 def find_library(name):
82 possible = ['lib%s.dylib' % name, 82 possible = ['lib%s.dylib' % name,
83 '%s.dylib' % name, 83 '%s.dylib' % name,
84 '%s.framework/%s' % (name, name)] 84 '%s.framework/%s' % (name, name)]
85 for name in possible: 85 for name in possible:
86 try: 86 try:
87 return _dyld_find(name) 87 return _dyld_find(name)
88 except ValueError: 88 except ValueError:
89 continue 89 continue
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 print(cdll.LoadLibrary("libcrypto.dylib")) 264 print(cdll.LoadLibrary("libcrypto.dylib"))
265 print(cdll.LoadLibrary("libSystem.dylib")) 265 print(cdll.LoadLibrary("libSystem.dylib"))
266 print(cdll.LoadLibrary("System.framework/System")) 266 print(cdll.LoadLibrary("System.framework/System"))
267 else: 267 else:
268 print(cdll.LoadLibrary("libm.so")) 268 print(cdll.LoadLibrary("libm.so"))
269 print(cdll.LoadLibrary("libcrypt.so")) 269 print(cdll.LoadLibrary("libcrypt.so"))
270 print(find_library("crypt")) 270 print(find_library("crypt"))
271 271
272 if __name__ == "__main__": 272 if __name__ == "__main__":
273 test() 273 test()
OLDNEW
« no previous file with comments | « Lib/ctypes/test/test_win32.py ('k') | Lib/distutils/tests/test_build_ext.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+