Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 22dcf66

Browse files
committed
Patch 983206: distutils obeys LDSHARED env var. Removed the code in
Python's own setup.py that did the same thing (and tested on Solaris, where LDSHARED is needed...)
1 parent 8a560de commit 22dcf66

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

Lib/distutils/sysconfig.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ def customize_compiler(compiler):
153153
cc = os.environ['CC']
154154
if os.environ.has_key('CXX'):
155155
cxx = os.environ['CXX']
156+
if os.environ.has_key('LDSHARED'):
157+
ldshared = os.environ['LDSHARED']
156158
if os.environ.has_key('CPP'):
157159
cpp = os.environ['CPP']
158160
else:

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ Just van Rossum
499499
Hugo van Rossum
500500
Saskia van Rossum
501501
Donald Wallace Rouse II
502+
Liam Routt
502503
Audun S. Runde
503504
Jeff Rush
504505
Sam Rushing

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ Extension modules
4747
Library
4848
-------
4949

50+
- Patch 983206: distutils now obeys environment variable LDSHARED, if
51+
it is set.
52+
5053
- Added Peter Astrand's subprocess.py module. See PEP 324 for details.
5154

5255
- time.strptime() now properly escapes timezones and all other locale-specific

setup.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,12 @@ def build_extensions(self):
167167
# those environment variables passed into the setup.py phase. Here's
168168
# a small set of useful ones.
169169
compiler = os.environ.get('CC')
170-
linker_so = os.environ.get('LDSHARED')
171170
args = {}
172171
# unfortunately, distutils doesn't let us provide separate C and C++
173172
# compilers
174173
if compiler is not None:
175174
(ccshared,opt,base) = sysconfig.get_config_vars('CCSHARED','OPT','BASECFLAGS')
176175
args['compiler_so'] = compiler + ' ' + opt + ' ' + ccshared + ' ' + base
177-
if linker_so is not None:
178-
args['linker_so'] = linker_so
179176
self.compiler.set_executables(**args)
180177

181178
build_ext.build_extensions(self)

0 commit comments

Comments
 (0)