pkgsrc/lang/python22/patches/patch-ae
jlam 5ca0c61cd3 Teach the extension building process about buildlink, and allow passing
LDFLAGS to the linker command when linking a python extension.  This lets
us pass the right flags to correctly find libraries required for certain
extensions, e.g. zlib.so.
2002-04-09 04:33:18 +00:00

23 lines
889 B
Text

$NetBSD: patch-ae,v 1.1 2002/04/09 04:33:21 jlam Exp $
--- Lib/distutils/command/build_ext.py.orig Thu Dec 6 17:59:54 2001
+++ Lib/distutils/command/build_ext.py
@@ -472,8 +472,18 @@
# that go into the mix.
if ext.extra_objects:
objects.extend(ext.extra_objects)
+
+ # Two possible sources for extra linker arguments:
+ # - 'extra_link_args' in Extension object
+ # - LDFLAGS environment variable
+ # The environment variable should take precedence, and
+ # any sensible compiler will give precedence to later
+ # command line args. Hence we combine them in order:
extra_args = ext.extra_link_args or []
+
+ if os.environ.has_key('LDFLAGS'):
+ extra_args.extend(string.split(os.environ['LDFLAGS']))
self.compiler.link_shared_object(
objects, ext_filename,