summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2001-02-23 16:27:48 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2001-02-23 16:27:48 (GMT)
commite06337a9285ce50ba86dd7dff27df0b56905a8b0 (patch)
tree435c73b6a8039928ea830b863ed2fc30966689b7 /setup.py
parent5edc627f6646f34a1d474d9fbbaf6537cc069a43 (diff)
downloadcpython-e06337a9285ce50ba86dd7dff27df0b56905a8b0.zip
cpython-e06337a9285ce50ba86dd7dff27df0b56905a8b0.tar.gz
cpython-e06337a9285ce50ba86dd7dff27df0b56905a8b0.tar.bz2
Patch #103937: Attempt to get the BSDDB autodetection right (or at least
less wrong)
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/setup.py b/setup.py
index ea4d94f..4e8008b 100644
--- a/setup.py
+++ b/setup.py
@@ -325,17 +325,22 @@ class PyBuildExt(build_ext):
# (See http://electricrain.com/greg/python/bsddb3/ for an interface to
# BSD DB 3.x.)
- db_incs = find_file('db_185.h', inc_dirs, [])
- if (db_incs is not None and
- self.compiler.find_library_file(lib_dirs, 'db') ):
+ dblib = []
+ if self.compiler.find_library_file(lib_dirs, 'db'):
+ dblib = ['db']
+
+ db185_incs = find_file('db_185.h', inc_dirs,
+ ['/usr/include/db3', '/usr/include/db2'])
+ db_inc = find_file('db.h', inc_dirs, ['/usr/include/db1'])
+ if db185_incs is not None:
exts.append( Extension('bsddb', ['bsddbmodule.c'],
- include_dirs = db_incs,
- libraries = ['db'] ) )
- else:
- db_incs = find_file('db.h', inc_dirs, [])
- if db_incs is not None:
- exts.append( Extension('bsddb', ['bsddbmodule.c'],
- include_dirs = db_incs) )
+ include_dirs = db185_incs,
+ define_macros=[('HAVE_DB_185_H',1)],
+ libraries = dblib ) )
+ elif db_inc is not None:
+ exts.append( Extension('bsddb', ['bsddbmodule.c'],
+ include_dirs = db_inc,
+ libraries = dblib) )
# The mpz module interfaces to the GNU Multiple Precision library.
# You need to ftp the GNU MP library.