| @@ -1,326 +1,354 @@ | | | @@ -1,326 +1,354 @@ |
1 | $NetBSD: patch-am,v 1.15 2010/09/16 13:24:47 obache Exp $ | | 1 | $NetBSD: patch-am,v 1.16 2011/10/01 03:11:15 dsainty Exp $ |
2 | | | 2 | |
3 | Disabled modules for normal build: | | 3 | Disabled modules for normal build: |
4 | bsddb | | 4 | bsddb |
5 | curses | | 5 | curses |
6 | curses_panel | | 6 | curses_panel |
7 | elementtree | | 7 | elementtree |
8 | sqlite3 | | 8 | sqlite3 |
9 | tkinter | | 9 | tkinter |
10 | gdbm | | 10 | gdbm |
11 | pyexpat | | 11 | pyexpat |
12 | readline | | 12 | readline |
13 | {linux,oss,sun}audiodev | | 13 | {linux,oss,sun}audiodev |
14 | spwd | | 14 | spwd |
15 | Those have separate packages where needed. | | 15 | Those have separate packages where needed. |
16 | | | 16 | |
17 | Only check the BUILDLINK_DIR for libraries etc, do not pick up random | | 17 | Only check the BUILDLINK_DIR for libraries etc, do not pick up random |
18 | headers and libraries from the system. | | 18 | headers and libraries from the system. |
19 | | | 19 | |
20 | Build the 1.85 compat module all the time against the BDB version of choice. | | 20 | Build the 1.85 compat module all the time against the BDB version of choice. |
21 | | | 21 | |
22 | --- setup.py.orig 2010-07-17 12:31:09.000000000 +0000 | | 22 | Add in Debian multiarch support (retrofitted from Python 2.7.2) to |
23 | +++ setup.py | | 23 | support building the "nis" and "crypt" modules. |
24 | @@ -18,7 +18,7 @@ from distutils.command.install_lib impor | | 24 | |
| | | 25 | --- setup.py 2010-07-18 00:31:09.000000000 +1200 |
| | | 26 | +++ setup.py 2011-09-23 01:51:17.757519638 +1200 |
| | | 27 | @@ -18,7 +18,7 @@ |
25 | from distutils.spawn import find_executable | | 28 | from distutils.spawn import find_executable |
26 | | | 29 | |
27 | # This global variable is used to hold the list of modules to be disabled. | | 30 | # This global variable is used to hold the list of modules to be disabled. |
28 | -disabled_module_list = [] | | 31 | -disabled_module_list = [] |
29 | +disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree", "_sqlite3", "_tkinter", "gdbm", "pyexpat", "readline", "linuxaudiodev", "ossaudiodev", "spwd", "sunaudiodev"] | | 32 | +disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree", "_sqlite3", "_tkinter", "gdbm", "pyexpat", "readline", "linuxaudiodev", "ossaudiodev", "spwd", "sunaudiodev"] |
30 | | | 33 | |
31 | def add_dir_to_list(dirlist, dir): | | 34 | def add_dir_to_list(dirlist, dir): |
32 | """Add the directory 'dir' to the list 'dirlist' (at the front) if | | 35 | """Add the directory 'dir' to the list 'dirlist' (at the front) if |
33 | @@ -355,9 +355,15 @@ class PyBuildExt(build_ext): | | 36 | @@ -354,10 +354,40 @@ |
| | | 37 | return platform |
34 | return sys.platform | | 38 | return sys.platform |
35 | | | 39 | |
| | | 40 | + def add_multiarch_paths(self): |
| | | 41 | + # Debian/Ubuntu multiarch support. |
| | | 42 | + # https://wiki.ubuntu.com/MultiarchSpec |
| | | 43 | + if not find_executable('dpkg-architecture'): |
| | | 44 | + return |
| | | 45 | + tmpfile = os.path.join(self.build_temp, 'multiarch') |
| | | 46 | + if not os.path.exists(self.build_temp): |
| | | 47 | + os.makedirs(self.build_temp) |
| | | 48 | + ret = os.system( |
| | | 49 | + 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' % |
| | | 50 | + tmpfile) |
| | | 51 | + try: |
| | | 52 | + if ret >> 8 == 0: |
| | | 53 | + with open(tmpfile) as fp: |
| | | 54 | + multiarch_path_component = fp.readline().strip() |
| | | 55 | + add_dir_to_list(self.compiler.library_dirs, |
| | | 56 | + '/usr/lib/' + multiarch_path_component) |
| | | 57 | + add_dir_to_list(self.compiler.include_dirs, |
| | | 58 | + '/usr/include/' + multiarch_path_component) |
| | | 59 | + finally: |
| | | 60 | + os.unlink(tmpfile) |
| | | 61 | + |
36 | def detect_modules(self): | | 62 | def detect_modules(self): |
37 | - # Ensure that /usr/local is always used | | 63 | - # Ensure that /usr/local is always used |
38 | - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') | | 64 | - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') |
39 | - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | | 65 | - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') |
40 | + # Add the buildlink directories for pkgsrc | | 66 | + # Add the buildlink directories for pkgsrc |
41 | + if os.environ.has_key('BUILDLINK_DIR'): | | 67 | + if os.environ.has_key('BUILDLINK_DIR'): |
42 | + dir = os.environ['BUILDLINK_DIR'] | | 68 | + dir = os.environ['BUILDLINK_DIR'] |
43 | + libdir = dir + '/lib' | | 69 | + libdir = dir + '/lib' |
44 | + incdir = dir + '/include' | | 70 | + incdir = dir + '/include' |
45 | + if libdir not in self.compiler.library_dirs: | | 71 | + if libdir not in self.compiler.library_dirs: |
46 | + self.compiler.library_dirs.insert(0, libdir) | | 72 | + self.compiler.library_dirs.insert(0, libdir) |
47 | + if incdir not in self.compiler.include_dirs: | | 73 | + if incdir not in self.compiler.include_dirs: |
48 | + self.compiler.include_dirs.insert(0, incdir) | | 74 | + self.compiler.include_dirs.insert(0, incdir) |
| | | 75 | + |
| | | 76 | + self.add_multiarch_paths() |
49 | | | 77 | |
50 | # Add paths specified in the environment variables LDFLAGS and | | 78 | # Add paths specified in the environment variables LDFLAGS and |
51 | # CPPFLAGS for header and library files. | | 79 | # CPPFLAGS for header and library files. |
52 | @@ -703,9 +709,7 @@ class PyBuildExt(build_ext): | | 80 | @@ -703,9 +733,7 @@ |
53 | if krb5_h: | | 81 | if krb5_h: |
54 | ssl_incs += krb5_h | | 82 | ssl_incs += krb5_h |
55 | ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, | | 83 | ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, |
56 | - ['/usr/local/ssl/lib', | | 84 | - ['/usr/local/ssl/lib', |
57 | - '/usr/contrib/ssl/lib/' | | 85 | - '/usr/contrib/ssl/lib/' |
58 | - ] ) | | 86 | - ] ) |
59 | + [] ) | | 87 | + [] ) |
60 | | | 88 | |
61 | if (ssl_incs is not None and | | 89 | if (ssl_incs is not None and |
62 | ssl_libs is not None): | | 90 | ssl_libs is not None): |
63 | @@ -815,172 +819,6 @@ class PyBuildExt(build_ext): | | 91 | @@ -815,172 +843,6 @@ |
64 | else: | | 92 | else: |
65 | raise ValueError("unknown major BerkeleyDB version", major) | | 93 | raise ValueError("unknown major BerkeleyDB version", major) |
66 | | | 94 | |
67 | - # construct a list of paths to look for the header file in on | | 95 | - # construct a list of paths to look for the header file in on |
68 | - # top of the normal inc_dirs. | | 96 | - # top of the normal inc_dirs. |
69 | - db_inc_paths = [ | | 97 | - db_inc_paths = [ |
70 | - '/usr/include/db4', | | 98 | - '/usr/include/db4', |
71 | - '/usr/local/include/db4', | | 99 | - '/usr/local/include/db4', |
72 | - '/opt/sfw/include/db4', | | 100 | - '/opt/sfw/include/db4', |
73 | - '/usr/include/db3', | | 101 | - '/usr/include/db3', |
74 | - '/usr/local/include/db3', | | 102 | - '/usr/local/include/db3', |
75 | - '/opt/sfw/include/db3', | | 103 | - '/opt/sfw/include/db3', |
76 | - # Fink defaults (http://fink.sourceforge.net/) | | 104 | - # Fink defaults (http://fink.sourceforge.net/) |
77 | - '/sw/include/db4', | | 105 | - '/sw/include/db4', |
78 | - '/sw/include/db3', | | 106 | - '/sw/include/db3', |
79 | - ] | | 107 | - ] |
80 | - # 4.x minor number specific paths | | 108 | - # 4.x minor number specific paths |
81 | - for x in gen_db_minor_ver_nums(4): | | 109 | - for x in gen_db_minor_ver_nums(4): |
82 | - db_inc_paths.append('/usr/include/db4%d' % x) | | 110 | - db_inc_paths.append('/usr/include/db4%d' % x) |
83 | - db_inc_paths.append('/usr/include/db4.%d' % x) | | 111 | - db_inc_paths.append('/usr/include/db4.%d' % x) |
84 | - db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x) | | 112 | - db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x) |
85 | - db_inc_paths.append('/usr/local/include/db4%d' % x) | | 113 | - db_inc_paths.append('/usr/local/include/db4%d' % x) |
86 | - db_inc_paths.append('/pkg/db-4.%d/include' % x) | | 114 | - db_inc_paths.append('/pkg/db-4.%d/include' % x) |
87 | - db_inc_paths.append('/opt/db-4.%d/include' % x) | | 115 | - db_inc_paths.append('/opt/db-4.%d/include' % x) |
88 | - # MacPorts default (http://www.macports.org/) | | 116 | - # MacPorts default (http://www.macports.org/) |
89 | - db_inc_paths.append('/opt/local/include/db4%d' % x) | | 117 | - db_inc_paths.append('/opt/local/include/db4%d' % x) |
90 | - # 3.x minor number specific paths | | 118 | - # 3.x minor number specific paths |
91 | - for x in gen_db_minor_ver_nums(3): | | 119 | - for x in gen_db_minor_ver_nums(3): |
92 | - db_inc_paths.append('/usr/include/db3%d' % x) | | 120 | - db_inc_paths.append('/usr/include/db3%d' % x) |
93 | - db_inc_paths.append('/usr/local/BerkeleyDB.3.%d/include' % x) | | 121 | - db_inc_paths.append('/usr/local/BerkeleyDB.3.%d/include' % x) |
94 | - db_inc_paths.append('/usr/local/include/db3%d' % x) | | 122 | - db_inc_paths.append('/usr/local/include/db3%d' % x) |
95 | - db_inc_paths.append('/pkg/db-3.%d/include' % x) | | 123 | - db_inc_paths.append('/pkg/db-3.%d/include' % x) |
96 | - db_inc_paths.append('/opt/db-3.%d/include' % x) | | 124 | - db_inc_paths.append('/opt/db-3.%d/include' % x) |
97 | - | | 125 | - |
98 | - # Add some common subdirectories for Sleepycat DB to the list, | | 126 | - # Add some common subdirectories for Sleepycat DB to the list, |
99 | - # based on the standard include directories. This way DB3/4 gets | | 127 | - # based on the standard include directories. This way DB3/4 gets |
100 | - # picked up when it is installed in a non-standard prefix and | | 128 | - # picked up when it is installed in a non-standard prefix and |
101 | - # the user has added that prefix into inc_dirs. | | 129 | - # the user has added that prefix into inc_dirs. |
102 | - std_variants = [] | | 130 | - std_variants = [] |
103 | - for dn in inc_dirs: | | 131 | - for dn in inc_dirs: |
104 | - std_variants.append(os.path.join(dn, 'db3')) | | 132 | - std_variants.append(os.path.join(dn, 'db3')) |
105 | - std_variants.append(os.path.join(dn, 'db4')) | | 133 | - std_variants.append(os.path.join(dn, 'db4')) |
106 | - for x in gen_db_minor_ver_nums(4): | | 134 | - for x in gen_db_minor_ver_nums(4): |
107 | - std_variants.append(os.path.join(dn, "db4%d"%x)) | | 135 | - std_variants.append(os.path.join(dn, "db4%d"%x)) |
108 | - std_variants.append(os.path.join(dn, "db4.%d"%x)) | | 136 | - std_variants.append(os.path.join(dn, "db4.%d"%x)) |
109 | - for x in gen_db_minor_ver_nums(3): | | 137 | - for x in gen_db_minor_ver_nums(3): |
110 | - std_variants.append(os.path.join(dn, "db3%d"%x)) | | 138 | - std_variants.append(os.path.join(dn, "db3%d"%x)) |
111 | - std_variants.append(os.path.join(dn, "db3.%d"%x)) | | 139 | - std_variants.append(os.path.join(dn, "db3.%d"%x)) |
112 | - | | 140 | - |
113 | - db_inc_paths = std_variants + db_inc_paths | | 141 | - db_inc_paths = std_variants + db_inc_paths |
114 | - db_inc_paths = [p for p in db_inc_paths if os.path.exists(p)] | | 142 | - db_inc_paths = [p for p in db_inc_paths if os.path.exists(p)] |
115 | - | | 143 | - |
116 | - db_ver_inc_map = {} | | 144 | - db_ver_inc_map = {} |
117 | - | | 145 | - |
118 | - if sys.platform == 'darwin': | | 146 | - if sys.platform == 'darwin': |
119 | - sysroot = macosx_sdk_root() | | 147 | - sysroot = macosx_sdk_root() |
120 | - | | 148 | - |
121 | - class db_found(Exception): pass | | 149 | - class db_found(Exception): pass |
122 | - try: | | 150 | - try: |
123 | - # See whether there is a Sleepycat header in the standard | | 151 | - # See whether there is a Sleepycat header in the standard |
124 | - # search path. | | 152 | - # search path. |
125 | - for d in inc_dirs + db_inc_paths: | | 153 | - for d in inc_dirs + db_inc_paths: |
126 | - f = os.path.join(d, "db.h") | | 154 | - f = os.path.join(d, "db.h") |
127 | - | | 155 | - |
128 | - if sys.platform == 'darwin' and is_macosx_sdk_path(d): | | 156 | - if sys.platform == 'darwin' and is_macosx_sdk_path(d): |
129 | - f = os.path.join(sysroot, d[1:], "db.h") | | 157 | - f = os.path.join(sysroot, d[1:], "db.h") |
130 | - | | 158 | - |
131 | - if db_setup_debug: print "db: looking for db.h in", f | | 159 | - if db_setup_debug: print "db: looking for db.h in", f |
132 | - if os.path.exists(f): | | 160 | - if os.path.exists(f): |
133 | - f = open(f).read() | | 161 | - f = open(f).read() |
134 | - m = re.search(r"#define\WDB_VERSION_MAJOR\W(\d+)", f) | | 162 | - m = re.search(r"#define\WDB_VERSION_MAJOR\W(\d+)", f) |
135 | - if m: | | 163 | - if m: |
136 | - db_major = int(m.group(1)) | | 164 | - db_major = int(m.group(1)) |
137 | - m = re.search(r"#define\WDB_VERSION_MINOR\W(\d+)", f) | | 165 | - m = re.search(r"#define\WDB_VERSION_MINOR\W(\d+)", f) |
138 | - db_minor = int(m.group(1)) | | 166 | - db_minor = int(m.group(1)) |
139 | - db_ver = (db_major, db_minor) | | 167 | - db_ver = (db_major, db_minor) |
140 | - | | 168 | - |
141 | - # Avoid 4.6 prior to 4.6.21 due to a BerkeleyDB bug | | 169 | - # Avoid 4.6 prior to 4.6.21 due to a BerkeleyDB bug |
142 | - if db_ver == (4, 6): | | 170 | - if db_ver == (4, 6): |
143 | - m = re.search(r"#define\WDB_VERSION_PATCH\W(\d+)", f) | | 171 | - m = re.search(r"#define\WDB_VERSION_PATCH\W(\d+)", f) |
144 | - db_patch = int(m.group(1)) | | 172 | - db_patch = int(m.group(1)) |
145 | - if db_patch < 21: | | 173 | - if db_patch < 21: |
146 | - print "db.h:", db_ver, "patch", db_patch, | | 174 | - print "db.h:", db_ver, "patch", db_patch, |
147 | - print "being ignored (4.6.x must be >= 4.6.21)" | | 175 | - print "being ignored (4.6.x must be >= 4.6.21)" |
148 | - continue | | 176 | - continue |
149 | - | | 177 | - |
150 | - if ( (db_ver not in db_ver_inc_map) and | | 178 | - if ( (db_ver not in db_ver_inc_map) and |
151 | - allow_db_ver(db_ver) ): | | 179 | - allow_db_ver(db_ver) ): |
152 | - # save the include directory with the db.h version | | 180 | - # save the include directory with the db.h version |
153 | - # (first occurrence only) | | 181 | - # (first occurrence only) |
154 | - db_ver_inc_map[db_ver] = d | | 182 | - db_ver_inc_map[db_ver] = d |
155 | - if db_setup_debug: | | 183 | - if db_setup_debug: |
156 | - print "db.h: found", db_ver, "in", d | | 184 | - print "db.h: found", db_ver, "in", d |
157 | - else: | | 185 | - else: |
158 | - # we already found a header for this library version | | 186 | - # we already found a header for this library version |
159 | - if db_setup_debug: print "db.h: ignoring", d | | 187 | - if db_setup_debug: print "db.h: ignoring", d |
160 | - else: | | 188 | - else: |
161 | - # ignore this header, it didn't contain a version number | | 189 | - # ignore this header, it didn't contain a version number |
162 | - if db_setup_debug: | | 190 | - if db_setup_debug: |
163 | - print "db.h: no version number version in", d | | 191 | - print "db.h: no version number version in", d |
164 | - | | 192 | - |
165 | - db_found_vers = db_ver_inc_map.keys() | | 193 | - db_found_vers = db_ver_inc_map.keys() |
166 | - db_found_vers.sort() | | 194 | - db_found_vers.sort() |
167 | - | | 195 | - |
168 | - while db_found_vers: | | 196 | - while db_found_vers: |
169 | - db_ver = db_found_vers.pop() | | 197 | - db_ver = db_found_vers.pop() |
170 | - db_incdir = db_ver_inc_map[db_ver] | | 198 | - db_incdir = db_ver_inc_map[db_ver] |
171 | - | | 199 | - |
172 | - # check lib directories parallel to the location of the header | | 200 | - # check lib directories parallel to the location of the header |
173 | - db_dirs_to_check = [ | | 201 | - db_dirs_to_check = [ |
174 | - db_incdir.replace("include", 'lib64'), | | 202 | - db_incdir.replace("include", 'lib64'), |
175 | - db_incdir.replace("include", 'lib'), | | 203 | - db_incdir.replace("include", 'lib'), |
176 | - ] | | 204 | - ] |
177 | - | | 205 | - |
178 | - if sys.platform != 'darwin': | | 206 | - if sys.platform != 'darwin': |
179 | - db_dirs_to_check = filter(os.path.isdir, db_dirs_to_check) | | 207 | - db_dirs_to_check = filter(os.path.isdir, db_dirs_to_check) |
180 | - | | 208 | - |
181 | - else: | | 209 | - else: |
182 | - # Same as other branch, but takes OSX SDK into account | | 210 | - # Same as other branch, but takes OSX SDK into account |
183 | - tmp = [] | | 211 | - tmp = [] |
184 | - for dn in db_dirs_to_check: | | 212 | - for dn in db_dirs_to_check: |
185 | - if is_macosx_sdk_path(dn): | | 213 | - if is_macosx_sdk_path(dn): |
186 | - if os.path.isdir(os.path.join(sysroot, dn[1:])): | | 214 | - if os.path.isdir(os.path.join(sysroot, dn[1:])): |
187 | - tmp.append(dn) | | 215 | - tmp.append(dn) |
188 | - else: | | 216 | - else: |
189 | - if os.path.isdir(dn): | | 217 | - if os.path.isdir(dn): |
190 | - tmp.append(dn) | | 218 | - tmp.append(dn) |
191 | - db_dirs_to_check = tmp | | 219 | - db_dirs_to_check = tmp |
192 | - | | 220 | - |
193 | - # Look for a version specific db-X.Y before an ambiguoius dbX | | 221 | - # Look for a version specific db-X.Y before an ambiguoius dbX |
194 | - # XXX should we -ever- look for a dbX name? Do any | | 222 | - # XXX should we -ever- look for a dbX name? Do any |
195 | - # systems really not name their library by version and | | 223 | - # systems really not name their library by version and |
196 | - # symlink to more general names? | | 224 | - # symlink to more general names? |
197 | - for dblib in (('db-%d.%d' % db_ver), | | 225 | - for dblib in (('db-%d.%d' % db_ver), |
198 | - ('db%d%d' % db_ver), | | 226 | - ('db%d%d' % db_ver), |
199 | - ('db%d' % db_ver[0])): | | 227 | - ('db%d' % db_ver[0])): |
200 | - dblib_file = self.compiler.find_library_file( | | 228 | - dblib_file = self.compiler.find_library_file( |
201 | - db_dirs_to_check + lib_dirs, dblib ) | | 229 | - db_dirs_to_check + lib_dirs, dblib ) |
202 | - if dblib_file: | | 230 | - if dblib_file: |
203 | - dblib_dir = [ os.path.abspath(os.path.dirname(dblib_file)) ] | | 231 | - dblib_dir = [ os.path.abspath(os.path.dirname(dblib_file)) ] |
204 | - raise db_found | | 232 | - raise db_found |
205 | - else: | | 233 | - else: |
206 | - if db_setup_debug: print "db lib: ", dblib, "not found" | | 234 | - if db_setup_debug: print "db lib: ", dblib, "not found" |
207 | - | | 235 | - |
208 | - except db_found: | | 236 | - except db_found: |
209 | - if db_setup_debug: | | 237 | - if db_setup_debug: |
210 | - print "bsddb using BerkeleyDB lib:", db_ver, dblib | | 238 | - print "bsddb using BerkeleyDB lib:", db_ver, dblib |
211 | - print "bsddb lib dir:", dblib_dir, " inc dir:", db_incdir | | 239 | - print "bsddb lib dir:", dblib_dir, " inc dir:", db_incdir |
212 | - db_incs = [db_incdir] | | 240 | - db_incs = [db_incdir] |
213 | - dblibs = [dblib] | | 241 | - dblibs = [dblib] |
214 | - # We add the runtime_library_dirs argument because the | | 242 | - # We add the runtime_library_dirs argument because the |
215 | - # BerkeleyDB lib we're linking against often isn't in the | | 243 | - # BerkeleyDB lib we're linking against often isn't in the |
216 | - # system dynamic library search path. This is usually | | 244 | - # system dynamic library search path. This is usually |
217 | - # correct and most trouble free, but may cause problems in | | 245 | - # correct and most trouble free, but may cause problems in |
218 | - # some unusual system configurations (e.g. the directory | | 246 | - # some unusual system configurations (e.g. the directory |
219 | - # is on an NFS server that goes away). | | 247 | - # is on an NFS server that goes away). |
220 | - exts.append(Extension('_bsddb', ['_bsddb.c'], | | 248 | - exts.append(Extension('_bsddb', ['_bsddb.c'], |
221 | - depends = ['bsddb.h'], | | 249 | - depends = ['bsddb.h'], |
222 | - library_dirs=dblib_dir, | | 250 | - library_dirs=dblib_dir, |
223 | - runtime_library_dirs=dblib_dir, | | 251 | - runtime_library_dirs=dblib_dir, |
224 | - include_dirs=db_incs, | | 252 | - include_dirs=db_incs, |
225 | - libraries=dblibs)) | | 253 | - libraries=dblibs)) |
226 | - else: | | 254 | - else: |
227 | - if db_setup_debug: print "db: no appropriate library found" | | 255 | - if db_setup_debug: print "db: no appropriate library found" |
228 | - db_incs = None | | 256 | - db_incs = None |
229 | - dblibs = [] | | 257 | - dblibs = [] |
230 | - dblib_dir = None | | 258 | - dblib_dir = None |
231 | - missing.append('_bsddb') | | 259 | - missing.append('_bsddb') |
232 | - | | 260 | - |
233 | # The sqlite interface | | 261 | # The sqlite interface |
234 | sqlite_setup_debug = False # verbose debug prints from this script? | | 262 | sqlite_setup_debug = False # verbose debug prints from this script? |
235 | | | 263 | |
236 | @@ -1094,31 +932,12 @@ class PyBuildExt(build_ext): | | 264 | @@ -1094,31 +956,12 @@ |
237 | # we do not build this one. Otherwise this build will pick up | | 265 | # we do not build this one. Otherwise this build will pick up |
238 | # the more recent berkeleydb's db.h file first in the include path | | 266 | # the more recent berkeleydb's db.h file first in the include path |
239 | # when attempting to compile and it will fail. | | 267 | # when attempting to compile and it will fail. |
240 | - f = "/usr/include/db.h" | | 268 | - f = "/usr/include/db.h" |
241 | - | | 269 | - |
242 | - if sys.platform == 'darwin': | | 270 | - if sys.platform == 'darwin': |
243 | - if is_macosx_sdk_path(f): | | 271 | - if is_macosx_sdk_path(f): |
244 | - sysroot = macosx_sdk_root() | | 272 | - sysroot = macosx_sdk_root() |
245 | - f = os.path.join(sysroot, f[1:]) | | 273 | - f = os.path.join(sysroot, f[1:]) |
246 | - | | 274 | - |
247 | - if os.path.exists(f) and not db_incs: | | 275 | - if os.path.exists(f) and not db_incs: |
248 | - data = open(f).read() | | 276 | - data = open(f).read() |
249 | - m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) | | 277 | - m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) |
250 | - if m is not None: | | 278 | - if m is not None: |
251 | - # bingo - old version used hash file format version 2 | | 279 | - # bingo - old version used hash file format version 2 |
252 | - ### XXX this should be fixed to not be platform-dependent | | 280 | - ### XXX this should be fixed to not be platform-dependent |
253 | - ### but I don't have direct access to an osf1 platform and | | 281 | - ### but I don't have direct access to an osf1 platform and |
254 | - ### seemed to be muffing the search somehow | | 282 | - ### seemed to be muffing the search somehow |
255 | - libraries = platform == "osf1" and ['db'] or None | | 283 | - libraries = platform == "osf1" and ['db'] or None |
256 | - if libraries is not None: | | 284 | - if libraries is not None: |
257 | - exts.append(Extension('bsddb185', ['bsddbmodule.c'], | | 285 | - exts.append(Extension('bsddb185', ['bsddbmodule.c'], |
258 | - libraries=libraries)) | | 286 | - libraries=libraries)) |
259 | - else: | | 287 | - else: |
260 | - exts.append(Extension('bsddb185', ['bsddbmodule.c'])) | | 288 | - exts.append(Extension('bsddb185', ['bsddbmodule.c'])) |
261 | - else: | | 289 | - else: |
262 | - missing.append('bsddb185') | | 290 | - missing.append('bsddb185') |
263 | + libraries = os.getenv("PY_BDB_TYPE", "") | | 291 | + libraries = os.getenv("PY_BDB_TYPE", "") |
264 | + if libraries: | | 292 | + if libraries: |
265 | + exts.append(Extension('bsddb185', ['bsddbmodule.c'], | | 293 | + exts.append(Extension('bsddb185', ['bsddbmodule.c'], |
266 | + libraries=["db"])) | | 294 | + libraries=["db"])) |
267 | else: | | 295 | else: |
268 | - missing.append('bsddb185') | | 296 | - missing.append('bsddb185') |
269 | + exts.append(Extension('bsddb185', ['bsddbmodule.c'])) | | 297 | + exts.append(Extension('bsddb185', ['bsddbmodule.c'])) |
270 | | | 298 | |
271 | # The standard Unix dbm module: | | 299 | # The standard Unix dbm module: |
272 | if platform not in ['cygwin']: | | 300 | if platform not in ['cygwin']: |
273 | @@ -1131,7 +950,7 @@ class PyBuildExt(build_ext): | | 301 | @@ -1131,7 +974,7 @@ |
274 | exts.append( Extension('dbm', ['dbmmodule.c'], | | 302 | exts.append( Extension('dbm', ['dbmmodule.c'], |
275 | define_macros=[('HAVE_NDBM_H',None)], | | 303 | define_macros=[('HAVE_NDBM_H',None)], |
276 | libraries = ndbm_libs ) ) | | 304 | libraries = ndbm_libs ) ) |
277 | - elif self.compiler.find_library_file(lib_dirs, 'gdbm'): | | 305 | - elif self.compiler.find_library_file(lib_dirs, 'gdbm'): |
278 | + elif 1==0 and self.compiler.find_library_file(lib_dirs, 'gdbm'): | | 306 | + elif 1==0 and self.compiler.find_library_file(lib_dirs, 'gdbm'): |
279 | gdbm_libs = ['gdbm'] | | 307 | gdbm_libs = ['gdbm'] |
280 | if self.compiler.find_library_file(lib_dirs, 'gdbm_compat'): | | 308 | if self.compiler.find_library_file(lib_dirs, 'gdbm_compat'): |
281 | gdbm_libs.append('gdbm_compat') | | 309 | gdbm_libs.append('gdbm_compat') |
282 | @@ -1147,14 +966,11 @@ class PyBuildExt(build_ext): | | 310 | @@ -1147,14 +990,11 @@ |
283 | libraries = gdbm_libs ) ) | | 311 | libraries = gdbm_libs ) ) |
284 | else: | | 312 | else: |
285 | missing.append('dbm') | | 313 | missing.append('dbm') |
286 | - elif db_incs is not None: | | 314 | - elif db_incs is not None: |
287 | + elif 1==1: | | 315 | + elif 1==1: |
288 | exts.append( Extension('dbm', ['dbmmodule.c'], | | 316 | exts.append( Extension('dbm', ['dbmmodule.c'], |
289 | - library_dirs=dblib_dir, | | 317 | - library_dirs=dblib_dir, |
290 | - runtime_library_dirs=dblib_dir, | | 318 | - runtime_library_dirs=dblib_dir, |
291 | - include_dirs=db_incs, | | 319 | - include_dirs=db_incs, |
292 | define_macros=[('HAVE_BERKDB_H',None), | | 320 | define_macros=[('HAVE_BERKDB_H',None), |
293 | ('DB_DBM_HSEARCH',None)], | | 321 | ('DB_DBM_HSEARCH',None)], |
294 | - libraries=dblibs)) | | 322 | - libraries=dblibs)) |
295 | + libraries=["db"])) | | 323 | + libraries=["db"])) |
296 | else: | | 324 | else: |
297 | missing.append('dbm') | | 325 | missing.append('dbm') |
298 | | | 326 | |
299 | @@ -1408,6 +1224,14 @@ class PyBuildExt(build_ext): | | 327 | @@ -1408,6 +1248,14 @@ |
300 | ) | | 328 | ) |
301 | libraries = [] | | 329 | libraries = [] |
302 | | | 330 | |
303 | + elif platform.startswith('dragonfly'): | | 331 | + elif platform.startswith('dragonfly'): |
304 | + macros = dict( | | 332 | + macros = dict( |
305 | + HAVE_SEM_OPEN=0, | | 333 | + HAVE_SEM_OPEN=0, |
306 | + HAVE_SEM_TIMEDWAIT=0, | | 334 | + HAVE_SEM_TIMEDWAIT=0, |
307 | + HAVE_FD_TRANSFER=1, | | 335 | + HAVE_FD_TRANSFER=1, |
308 | + ) | | 336 | + ) |
309 | + libraries = [] | | 337 | + libraries = [] |
310 | + | | 338 | + |
311 | else: # Linux and other unices | | 339 | else: # Linux and other unices |
312 | macros = dict( | | 340 | macros = dict( |
313 | HAVE_SEM_OPEN=1, | | 341 | HAVE_SEM_OPEN=1, |
314 | @@ -2026,9 +1850,9 @@ def main(): | | 342 | @@ -2026,9 +1874,9 @@ |
315 | ext_modules=[Extension('_struct', ['_struct.c'])], | | 343 | ext_modules=[Extension('_struct', ['_struct.c'])], |
316 | | | 344 | |
317 | # Scripts to install | | 345 | # Scripts to install |
318 | - scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle', | | 346 | - scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle', |
319 | - 'Tools/scripts/2to3', | | 347 | - 'Tools/scripts/2to3', |
320 | - 'Lib/smtpd.py'] | | 348 | - 'Lib/smtpd.py'] |
321 | + scripts = ['Tools/scripts/pydoc2.6', | | 349 | + scripts = ['Tools/scripts/pydoc2.6', |
322 | + 'Tools/scripts/2to3-2.6', | | 350 | + 'Tools/scripts/2to3-2.6', |
323 | + 'Lib/smtpd2.6.py'] | | 351 | + 'Lib/smtpd2.6.py'] |
324 | ) | | 352 | ) |
325 | | | 353 | |
326 | # --install-platlib | | 354 | # --install-platlib |