python2.5 (2.5.5-11) distutils-link.dpatch

Summary

 distutils/unixccompiler.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

    
download this patch

Patch contents

#! /bin/sh -e

# DP: Don't add standard library dirs to library_dirs and runtime_library_dirs.

if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
    dir="$3/"
elif [ $# -ne 1 ]; then
    echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
    exit 1
fi
case "$1" in
    -patch)
        patch $pdir -f --no-backup-if-mismatch -p0 < $0
        ;;
    -unpatch)
        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
        ;;
    *)
	echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
        exit 1
esac
exit 0

--- Lib/distutils/unixccompiler.py~	2004-08-29 18:40:55.000000000 +0200
+++ Lib/distutils/unixccompiler.py	2005-03-18 17:54:16.066246856 +0100
@@ -148,7 +148,12 @@
         objects, output_dir = self._fix_object_args(objects, output_dir)
         libraries, library_dirs, runtime_library_dirs = \
             self._fix_lib_args(libraries, library_dirs, runtime_library_dirs)
-
+        # filter out standard library paths, which are not explicitely needed
+        # for linking
+        library_dirs = [dir for dir in library_dirs
+                        if not dir in ('/lib', '/lib64', '/usr/lib', '/usr/lib64')]
+        runtime_library_dirs = [dir for dir in runtime_library_dirs
+                                if not dir in ('/lib', '/lib64', '/usr/lib', '/usr/lib64')]
         lib_opts = gen_lib_options(self, library_dirs, runtime_library_dirs,
                                    libraries)
         if type(output_dir) not in (StringType, NoneType):