Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e06337a

Browse files
committed
Patch #103937: Attempt to get the BSDDB autodetection right (or at least
less wrong)
1 parent 5edc627 commit e06337a

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

setup.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -325,17 +325,22 @@ def detect_modules(self):
325325
# (See http://electricrain.com/greg/python/bsddb3/ for an interface to
326326
# BSD DB 3.x.)
327327

328-
db_incs = find_file('db_185.h', inc_dirs, [])
329-
if (db_incs is not None and
330-
self.compiler.find_library_file(lib_dirs, 'db') ):
328+
dblib = []
329+
if self.compiler.find_library_file(lib_dirs, 'db'):
330+
dblib = ['db']
331+
332+
db185_incs = find_file('db_185.h', inc_dirs,
333+
['/usr/include/db3', '/usr/include/db2'])
334+
db_inc = find_file('db.h', inc_dirs, ['/usr/include/db1'])
335+
if db185_incs is not None:
331336
exts.append( Extension('bsddb', ['bsddbmodule.c'],
332-
include_dirs = db_incs,
333-
libraries = ['db'] ) )
334-
else:
335-
db_incs = find_file('db.h', inc_dirs, [])
336-
if db_incs is not None:
337-
exts.append( Extension('bsddb', ['bsddbmodule.c'],
338-
include_dirs = db_incs) )
337+
include_dirs = db185_incs,
338+
define_macros=[('HAVE_DB_185_H',1)],
339+
libraries = dblib ) )
340+
elif db_inc is not None:
341+
exts.append( Extension('bsddb', ['bsddbmodule.c'],
342+
include_dirs = db_inc,
343+
libraries = dblib) )
339344

340345
# The mpz module interfaces to the GNU Multiple Precision library.
341346
# You need to ftp the GNU MP library.

0 commit comments

Comments
 (0)