summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-12-07 14:41:17 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-12-07 14:41:17 (GMT)
commita37d61f1d64fb5e35c0d4c658b2f97caf673c171 (patch)
tree8d602dcd9d9b09b110701d4a2142ac371d0cc02c
parent065c06a6227d1c3f0a7cfa636c8e69b94a0e10d0 (diff)
downloadcpython-a37d61f1d64fb5e35c0d4c658b2f97caf673c171.zip
cpython-a37d61f1d64fb5e35c0d4c658b2f97caf673c171.tar.gz
cpython-a37d61f1d64fb5e35c0d4c658b2f97caf673c171.tar.bz2
Correct db3 /opt/sfw library path. Link ndbm with libc only if ndbm.h
is present and libndbm is not. Add runtime libs to dbm if linked against Berkeley DB.
-rw-r--r--setup.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/setup.py b/setup.py
index a733bb0..ff7318e 100644
--- a/setup.py
+++ b/setup.py
@@ -476,7 +476,7 @@ class PyBuildExt(build_ext):
'/usr/local/BerkeleyDB.3.1/lib',
'/usr/local/BerkeleyDB.3.0/lib',
'/usr/local/lib',
- '/opt/sfw',
+ '/opt/sfw/lib',
'/sw/lib',
),
'incdirs': ('/usr/local/BerkeleyDB.3.3/include',
@@ -542,16 +542,15 @@ class PyBuildExt(build_ext):
# The standard Unix dbm module:
if platform not in ['cygwin']:
- if (self.compiler.find_library_file(lib_dirs, 'ndbm')
- and find_file("ndbm.h", inc_dirs, []) is not None):
+ if find_file("ndbm.h", inc_dirs, []) is not None:
+ # Some systems have -lndbm, others don't
+ if self.compiler.find_library_file(lib_dirs, 'ndbm'):
+ ndbm_libs = ['ndbm']
+ else:
+ ndbm_libs = []
exts.append( Extension('dbm', ['dbmmodule.c'],
define_macros=[('HAVE_NDBM_H',None)],
- libraries = ['ndbm'] ) )
- elif (platform in ['darwin']
- and find_file("ndbm.h", inc_dirs, []) is not None):
- # Darwin has ndbm in libc
- exts.append( Extension('dbm', ['dbmmodule.c'],
- define_macros=[('HAVE_NDBM_H',None)]) )
+ libraries = ndbm_libs ) )
elif (self.compiler.find_library_file(lib_dirs, 'gdbm')
and find_file("gdbm/ndbm.h", inc_dirs, []) is not None):
exts.append( Extension('dbm', ['dbmmodule.c'],
@@ -559,7 +558,8 @@ class PyBuildExt(build_ext):
libraries = ['gdbm'] ) )
elif db_incs is not None:
exts.append( Extension('dbm', ['dbmmodule.c'],
- library_dirs=[dblib_dir],
+ library_dirs=dblib_dir,
+ runtime_library_dirs=dblib_dir,
include_dirs=db_incs,
define_macros=[('HAVE_BERKDB_H',None),
('DB_DBM_HSEARCH',None)],