pkgsrc/lang/python25/patches/patch-ab
tron 43d316c6ae Apply patch by Brian de Alwis to fix build problems under Mac OS X Leopard.
Tested under Leopard and NetBSD-i386 4.0_STABLE.

This fixes PR pkg/39042 by myself.
2008-06-27 19:57:49 +00:00

24 lines
1,017 B
Text

$NetBSD: patch-ab,v 1.2 2008/06/27 19:57:49 tron Exp $
--- Lib/distutils/command/build_ext.py.orig 2007-04-24 09:27:25.000000000 -0600
+++ Lib/distutils/command/build_ext.py
@@ -496,8 +496,19 @@ class build_ext (Command):
# 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 = list(extra_args)
+ extra_args.extend(string.split(os.environ['LDFLAGS']))
+
# Detect target language, if not provided
language = ext.language or self.compiler.detect_language(sources)