diff options
author | doko@ubuntu.com <doko@ubuntu.com> | 2014-04-17 15:52:48 (GMT) |
---|---|---|
committer | doko@ubuntu.com <doko@ubuntu.com> | 2014-04-17 15:52:48 (GMT) |
commit | a3818a304327d31b4360dc9b545f2655d27c626e (patch) | |
tree | 63574b363964a13c9b71469816d42c53d2a27083 /setup.py | |
parent | aad7cc9dba9e2a1ad0b1977da3133a8435b212d9 (diff) | |
download | cpython-a3818a304327d31b4360dc9b545f2655d27c626e.zip cpython-a3818a304327d31b4360dc9b545f2655d27c626e.tar.gz cpython-a3818a304327d31b4360dc9b545f2655d27c626e.tar.bz2 |
- Issue #15234: For BerkelyDB and Sqlite, only add the found library and
include directories if they aren't already being searched. This avoids
an explicit runtime library dependency.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -1022,8 +1022,16 @@ class PyBuildExt(build_ext): if db_setup_debug: print("bsddb using BerkeleyDB lib:", db_ver, dblib) print("bsddb lib dir:", dblib_dir, " inc dir:", db_incdir) - db_incs = [db_incdir] dblibs = [dblib] + # Only add the found library and include directories if they aren't + # already being searched. This avoids an explicit runtime library + # dependency. + if db_incdir in inc_dirs: + db_incs = None + else: + db_incs = [db_incdir] + if dblib_dir[0] in lib_dirs: + dblib_dir = None else: if db_setup_debug: print("db: no appropriate library found") db_incs = None @@ -1134,6 +1142,9 @@ class PyBuildExt(build_ext): # can end up with a bad search path order. if sqlite_incdir not in self.compiler.include_dirs: include_dirs.append(sqlite_incdir) + # avoid a runtime library path for a system library dir + if sqlite_libdir and sqlite_libdir[0] in lib_dirs: + sqlite_libdir = None exts.append(Extension('_sqlite3', sqlite_srcs, define_macros=sqlite_defines, include_dirs=include_dirs, @@ -1202,7 +1213,7 @@ class PyBuildExt(build_ext): libraries = gdbm_libs) break elif cand == "bdb": - if db_incs is not None: + if dblibs: if dbm_setup_debug: print("building dbm using bdb") dbmext = Extension('_dbm', ['_dbmmodule.c'], library_dirs=dblib_dir, |