[Distutils] Absolute path library names

Rene Liebscher R.Liebscher@gmx.de
Wed, 12 Jul 2000 15:37:34 +0200


Bastian Kleineidam wrote:
> 
> The error ist that shared_library_filename is nowhere defined. As I
> can guess from the source this function should look like:
> 
> def shared_library_filename(lib):
>     return 'lib'+lib+'.so'
It is not a missing function, it is only a wrong piece of code.
It should look like this:
---------------------------------------------------------------------------------
diff -BurN --minimal --exclude=*.pyc
distutils.orig/distutils/unixccompiler.py
distutils.patched/distutils/unixccompiler.py
--- distutils.orig/distutils/unixccompiler.py   Wed Jun 28 03:29:09 2000
+++ distutils.patched/distutils/unixccompiler.py        Wed Jul 12
15:29:21 2000
@@ -320,7 +320,7 @@
     def find_library_file (self, dirs, lib):
 
         for dir in dirs:
-            shared = os.path.join (dir, self.shared_library_filename
(lib))
+            shared = os.path.join (dir, self.library_filename
(lib,'shared'))
             static = os.path.join (dir, self.library_filename (lib))
 
             # We're second-guessing the linker here, with not much hard 
----------------------------------------------------------------------------------
library_filename comes from ccompiler.py, its second parameter is by
default 'static'.

> For a workaround use this:
> ...
> 'libraries': ['pgs','ppc','X11'],
> 'library_dirs': ['/usr/X11R6/lib']
> ..
> because you want -L/usr/X11R6/lib -lX11.

Rene Liebscher