[4suite-checkins] In 4Suite/Ft/Lib/DistExt, files BuildExt.py

Jeremy Kloth jkloth at 4suite.org
Sat Dec 16 01:36:08 MST 2006


Modified Files:
    BuildExt.py

Log Message:
Fix build error when Python is configured with `--enable-shared`

ViewCVS diff:
  http://cvs.4suite.org/viewcvs/4Suite/Ft/Lib/DistExt/BuildExt.py.diff?r1=1.22&r2=1.23
ViewCVS view:
  http://cvs.4suite.org/viewcvs/4Suite/Ft/Lib/DistExt/BuildExt.py?rev=1.23&content-type=text/vnd.viewcvs-markup

Index: BuildExt.py
===================================================================
RCS file: /var/local/cvsroot/4Suite/Ft/Lib/DistExt/BuildExt.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -U2 -r1.22 -r1.23
--- BuildExt.py	25 Nov 2006 23:23:09 -0000	1.22
+++ BuildExt.py	16 Dec 2006 08:36:08 -0000	1.23
@@ -56,4 +56,14 @@
                 self.define.extend(macros)
 
+        # If built as shared, remove the library dir if the shared library
+        # is not installed there (which Python does not do by default).
+        # This fixes the errors building on openSUSE 10.2 w/Python 2.5.
+        if (sys.platform.startswith('linux') and
+            sysconfig.get_config_var('Py_ENABLE_SHARED')):
+            libpl, ldlibrary = sysconfig.get_config_vars('LIBPL', 'LDLIBRARY')
+            if libpl in self.library_dirs:
+                if not os.path.exists(os.path.join(libpl, ldlibrary)):
+                    self.library_dirs.remove(libpl)
+
         # OpenBSD and NetBSD dlsyms have a leading underscore if the object
         # format is not ELF.  (from src/Python/dynload_shlib.c).


More information about the 4suite-checkins mailing list