2007-06-08 16:16:15 +02:00
|
|
|
$NetBSD: patch-ab,v 1.2 2007/06/08 14:16:15 wiz Exp $
|
2004-12-06 00:27:28 +01:00
|
|
|
|
2007-06-08 16:16:15 +02:00
|
|
|
--- Lib/distutils/command/build_ext.py.orig 2004-11-10 22:23:15.000000000 +0000
|
|
|
|
+++ Lib/distutils/command/build_ext.py
|
|
|
|
@@ -485,8 +485,18 @@ class build_ext (Command):
|
2004-12-06 00:27:28 +01:00
|
|
|
# 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 []
|
2007-06-08 16:16:15 +02:00
|
|
|
|
2004-12-06 00:27:28 +01:00
|
|
|
+ if os.environ.has_key('LDFLAGS'):
|
|
|
|
+ extra_args.extend(string.split(os.environ['LDFLAGS']))
|
2007-06-08 16:16:15 +02:00
|
|
|
+
|
2004-12-06 00:27:28 +01:00
|
|
|
# Detect target language, if not provided
|
|
|
|
language = ext.language or self.compiler.detect_language(sources)
|
2007-06-08 16:16:15 +02:00
|
|
|
|