diff -r cb9a3985df00 Lib/distutils/command/build_ext.py --- a/Lib/distutils/command/build_ext.py Thu May 08 17:43:25 2014 -0500 +++ b/Lib/distutils/command/build_ext.py Fri May 09 11:09:42 2014 +0200 @@ -527,8 +527,19 @@ # 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.get('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)