]> granicus.if.org Git - python/commitdiff
In the Extension() call, add runtime_library_dirs so that a useful
authorBarry Warsaw <barry@python.org>
Mon, 24 Jun 2002 20:27:33 +0000 (20:27 +0000)
committerBarry Warsaw <barry@python.org>
Mon, 24 Jun 2002 20:27:33 +0000 (20:27 +0000)
-R/--rpath flag gets passed to the linker.  Source builds of
BerkeleyDB do their default installs in locations not normally on
ld.so's search path.

setup.py

index 101264591499ce7ea07c50aa06c26a8f1109675a..d09602e5fadaed5f9b0fed1c2185e2b0ee5a81a6 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -507,15 +507,25 @@ class PyBuildExt(build_ext):
                             dblibs = [dblib]
                             raise found
         except found:
+            # A default source build puts Berkeley DB in something like
+            # /usr/local/Berkeley.3.3 and the lib dir under that isn't
+            # normally on ld.so's search path, unless the sysadmin has hacked
+            # /etc/ld.so.conf.  We add the directory to runtime_library_dirs
+            # so the proper -R/--rpath flags get passed to the linker.  This
+            # is usually correct and most trouble free, but may cause problems
+            # in some unusual system configurations (e.g. the directory is on
+            # an NFS server that goes away).
             if dbinc == 'db_185.h':
                 exts.append(Extension('bsddb', ['bsddbmodule.c'],
                                       library_dirs=[dblib_dir],
+                                      runtime_library_dirs=[dblib_dir],
                                       include_dirs=db_incs,
                                       define_macros=[('HAVE_DB_185_H',1)],
                                       libraries=[dblib]))
             else:
                 exts.append(Extension('bsddb', ['bsddbmodule.c'],
                                       library_dirs=[dblib_dir],
+                                      runtime_library_dirs=[dblib_dir],
                                       include_dirs=db_incs,
                                       libraries=[dblib]))
         else: