15136
|
1 |
--- Python-2.6.1/Lib/ctypes/util.py.orig 2008-05-17 04:06:31.000000000 +0800
|
15141
|
2 |
+++ Python-2.6.1/Lib/ctypes/util.py 2009-02-18 19:40:19.150260000 +0800
|
15136
|
3 |
@@ -156,6 +156,35 @@
|
|
4 |
res.sort(cmp= lambda x,y: cmp(_num_version(x), _num_version(y)))
|
|
5 |
return res[-1]
|
|
6 |
|
|
7 |
+ elif sys.platform == "sunos5":
|
|
8 |
+
|
15141
|
9 |
+ def _findLib_crle(name, is64):
|
|
10 |
+ if not os.path.exists('/usr/bin/crle'):
|
|
11 |
+ return None
|
15136
|
12 |
+
|
15141
|
13 |
+ if is64:
|
|
14 |
+ cmd = 'env LC_ALL=C /usr/bin/crle -64 2>/dev/null'
|
|
15 |
+ else:
|
|
16 |
+ cmd = 'env LC_ALL=C /usr/bin/crle 2>/dev/null'
|
15136
|
17 |
+
|
15141
|
18 |
+ for line in os.popen(cmd).readlines():
|
|
19 |
+ line = line.strip()
|
|
20 |
+ if (line.startswith('Default Library Path (ELF):')):
|
|
21 |
+ paths = line.split()[4]
|
15136
|
22 |
+
|
15141
|
23 |
+ if not paths:
|
|
24 |
+ return None
|
15136
|
25 |
+
|
15141
|
26 |
+ for dir in paths.split(":"):
|
|
27 |
+ libfile = os.path.join(dir, "lib%s.so" % name)
|
|
28 |
+ if os.path.exists(libfile):
|
|
29 |
+ return libfile
|
15136
|
30 |
+
|
15141
|
31 |
+ return None
|
15136
|
32 |
+
|
|
33 |
+ def find_library(name, is64 = False):
|
15141
|
34 |
+ return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
|
15136
|
35 |
+
|
|
36 |
else:
|
|
37 |
|
|
38 |
def _findLib_ldconfig(name):
|