From a37d61f1d64fb5e35c0d4c658b2f97caf673c171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Sat, 7 Dec 2002 14:41:17 +0000 Subject: 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. --- setup.py | 20 ++++++++++---------- 1 file 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)], -- cgit v0.12