1 diff --git Python-2.6.4/Modules/_multiprocessing/multiprocessing.h Python-2.6.4/Modules/_multiprocessing/multiprocessing.h
2 --- Python-2.6.4/Modules/_multiprocessing/multiprocessing.h
3 +++ Python-2.6.4/Modules/_multiprocessing/multiprocessing.h
4 @@ -3,6 +3,11 @@
5
6 #define PY_SSIZE_T_CLEAN
7
8 +/* needed on Solaris for the definition of CMSG_SPACE and friends */
9 +#define _XOPEN_SOURCE
10 +#define _XOPEN_SOURCE_EXTENDED 1
11 +#define _XPG6 /* Total ugly hack */
12 +
13 #include "Python.h"
14 #include "structmember.h"
15 #include "pythread.h"
16 diff --git Python-2.6.7-orig/setup.py Python-2.6.7/setup.py
17 --- Python-2.6.7-orig/setup.py 2010-07-17 12:31:09.000000000 +0000
18 +++ Python-2.6.7/setup.py 2012-02-15 19:36:29.282697563 +0000
19 @@ -355,10 +355,10 @@
20 return sys.platform
21
22 def detect_modules(self):
23 - # Ensure that /usr/local is always used
24 - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
25 - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
26 -
27 + if sys.platform != 'sunos5':
28 + # Ensure that /usr/local is always used
29 + add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
30 + add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
31 # Add paths specified in the environment variables LDFLAGS and
32 # CPPFLAGS for header and library files.
33 # We must get the values from the Makefile and not the environment
34 @@ -687,11 +687,22 @@
35 exts.append( Extension('_csv', ['_csv.c']) )
36
37 # socket(2)
38 + socket_libs = []
39 + if self.compiler.find_library_file(lib_dirs,
40 + 'socket'):
41 + socket_libs.append('socket')
42 + if self.compiler.find_library_file(lib_dirs,
43 + 'nsl'):
44 + socket_libs.append('nsl')
45 + if self.compiler.find_library_file(lib_dirs,
46 + 'resolv'):
47 + socket_libs.append('resolv')
48 exts.append( Extension('_socket', ['socketmodule.c'],
49 - depends = ['socketmodule.h']) )
50 + depends = ['socketmodule.h'],
51 + libraries = socket_libs) )
52 # Detect SSL support for the socket module (via _ssl)
53 search_for_ssl_incs_in = [
54 - '/usr/local/ssl/include',
55 + '/usr/sfw/include',
56 '/usr/contrib/ssl/include/'
57 ]
58 ssl_incs = find_file('openssl/ssl.h', inc_dirs,
59 @@ -702,8 +713,12 @@
60 ['/usr/kerberos/include'])
61 if krb5_h:
62 ssl_incs += krb5_h
63 + if sys.maxint == 2147483647L:
64 + sfw_libdir = '/usr/sfw/lib';
65 + else:
66 + sfw_libdir = '/usr/sfw/lib/64';
67 ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
68 - ['/usr/local/ssl/lib',
69 + [sfw_libdir,
70 '/usr/contrib/ssl/lib/'
71 ] )
72
73 @@ -712,6 +727,7 @@
74 exts.append( Extension('_ssl', ['_ssl.c'],
75 include_dirs = ssl_incs,
76 library_dirs = ssl_libs,
77 + runtime_library_dirs = ssl_libs,
78 libraries = ['ssl', 'crypto'],
79 depends = ['socketmodule.h']), )
80 else:
81 @@ -1191,6 +1207,16 @@
82
83 # Curses support, requiring the System V version of curses, often
84 # provided by the ncurses library.
85 + curses_lib_dirs = []
86 + curses_inc_dirs = []
87 + if platform == 'sunos5':
88 + # look for ncurses in /usr/gnu on Solaris
89 + curses_inc_dirs.append('/usr/include/ncurses')
90 + curses_lib_dirs.append('/usr/gnu/lib')
91 + if os.path.exists('/usr/gnu/lib/sparcv9'):
92 + curses_lib_dirs.append('/usr/gnu/lib/sparcv9')
93 + else:
94 + curses_lib_dirs.append('/usr/gnu/lib/amd64')
95 panel_library = 'panel'
96 if curses_library.startswith('ncurses'):
97 if curses_library == 'ncursesw':
98 @@ -1217,9 +1243,12 @@
99
100 # If the curses module is enabled, check for the panel module
101 if (module_enabled(exts, '_curses') and
102 - self.compiler.find_library_file(lib_dirs, panel_library)):
103 + self.compiler.find_library_file(lib_dirs + curses_lib_dirs, panel_library)):
104 exts.append( Extension('_curses_panel', ['_curses_panel.c'],
105 - libraries = [panel_library] + curses_libs) )
106 + libraries = [panel_library] + curses_libs,
107 + include_dirs = curses_inc_dirs,
108 + library_dirs = curses_lib_dirs,
109 + runtime_library_dirs = curses_lib_dirs ) )
110 else:
111 missing.append('_curses_panel')
112
113 @@ -1433,8 +1462,13 @@
114 multiprocessing_srcs.append('_multiprocessing/semaphore.c')
115
116 if sysconfig.get_config_var('WITH_THREAD'):
117 + multiproc_libs = []
118 + if platform == 'sunos5':
119 + multiproc_libs = [ "xnet" ]
120 +
121 exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
122 define_macros=macros.items(),
123 + libraries=multiproc_libs,
124 include_dirs=["Modules/_multiprocessing"]))
125 else:
126 missing.append('_multiprocessing')
127 @@ -1674,12 +1708,23 @@
128 # Assume we haven't found any of the libraries or include files
129 # The versions with dots are used on Unix, and the versions without
130 # dots on Windows, for detection by cygwin.
131 + added_lib_dirs = []
132 + tcl_tk_lib_dirs = ['/usr/sfw/lib']
133 + tcl_tk_inc_dirs = ['/usr/sfw/include']
134 tcllib = tklib = tcl_includes = tk_includes = None
135 for version in ['8.5', '85', '8.4', '84', '8.3', '83', '8.2',
136 '82', '8.1', '81', '8.0', '80']:
137 - tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version)
138 - tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version)
139 + tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version, tcl_tk_lib_dirs)
140 + tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version, tcl_tk_lib_dirs)
141 + if tklib and tcllib:
142 + # Exit the loop when we've found the Tcl/Tk libraries
143 + break
144 +
145 + tklib = self.compiler.find_library_file(tcl_tk_lib_dirs, 'tk' + version)
146 + tcllib = self.compiler.find_library_file(tcl_tk_lib_dirs, 'tcl' + version)
147 if tklib and tcllib:
148 + # found the libs in a non-standard dir
149 + added_lib_dirs.append(os.path.dirname(tcllib))
150 # Exit the loop when we've found the Tcl/Tk libraries
151 break
152
153 @@ -1697,6 +1742,7 @@
154 for dir in inc_dirs:
155 tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
156 tk_include_sub += [dir + os.sep + "tk" + dotversion]
157 + tcl_include_sub += tcl_tk_inc_dirs
158 tk_include_sub += tcl_include_sub
159 tcl_includes = find_file('tcl.h', inc_dirs, tcl_include_sub)
160 tk_includes = find_file('tk.h', inc_dirs, tk_include_sub)
161 @@ -1761,6 +1807,7 @@
162 include_dirs = include_dirs,
163 libraries = libs,
164 library_dirs = added_lib_dirs,
165 + runtime_library_dirs = added_lib_dirs
166 )
167 self.extensions.append(ext)
168
169 diff --git Python-2.6.4/Lib/site-packages/vendor-packages.pth Python2.6.4/Lib/site-packages/vendor-packages.pth
170 --- /dev/null Sat Feb 12 00:21:26 2011
171 +++ Python-2.6.4/Lib/site-packages/vendor-packages.pth Sat Feb 12 00:47:05 2011
172 @@ -0,0 +1,1 @@
173 +import site; site.addsitedir('/usr/lib/python2.6/vendor-packages')