Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
38c067b7
Commit
38c067b7
authored
May 28, 2013
by
Ned Deily
Browse files
Options
Browse Files
Download
Plain Diff
Issue #18080: merge from 3.3
parents
19b2b8b5
8e4909b4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
4 deletions
+42
-4
sysconfig.py
sysconfig.py
+8
-2
tests/test_unixccompiler.py
tests/test_unixccompiler.py
+34
-2
No files found.
sysconfig.py
View file @
38c067b7
...
...
@@ -188,9 +188,15 @@ def customize_compiler(compiler):
get_config_vars
(
'CC'
,
'CXX'
,
'OPT'
,
'CFLAGS'
,
'CCSHARED'
,
'LDSHARED'
,
'SHLIB_SUFFIX'
,
'AR'
,
'ARFLAGS'
)
newcc
=
None
if
'CC'
in
os
.
environ
:
cc
=
os
.
environ
[
'CC'
]
newcc
=
os
.
environ
[
'CC'
]
if
(
sys
.
platform
==
'darwin'
and
'LDSHARED'
not
in
os
.
environ
and
ldshared
.
startswith
(
cc
)):
# On OS X, if CC is overridden, use that as the default
# command for LDSHARED as well
ldshared
=
newcc
+
ldshared
[
len
(
cc
):]
cc
=
newcc
if
'CXX'
in
os
.
environ
:
cxx
=
os
.
environ
[
'CXX'
]
if
'LDSHARED'
in
os
.
environ
:
...
...
tests/test_unixccompiler.py
View file @
38c067b7
"""Tests for distutils.unixccompiler."""
import
os
import
sys
import
unittest
from
test.support
import
run_unittest
from
test.support
import
EnvironmentVarGuard
,
run_unittest
from
distutils
import
sysconfig
from
distutils.unixccompiler
import
UnixCCompiler
...
...
@@ -94,7 +95,6 @@ class UnixCCompilerTestCase(unittest.TestCase):
sysconfig
.
get_config_var
=
gcv
self
.
assertEqual
(
self
.
cc
.
rpath_foo
(),
'-Wl,--enable-new-dtags,-R/foo'
)
# non-GCC GNULD
sys
.
platform
=
'bar'
def
gcv
(
v
):
...
...
@@ -115,6 +115,38 @@ class UnixCCompilerTestCase(unittest.TestCase):
sysconfig
.
get_config_var
=
gcv
self
.
assertEqual
(
self
.
cc
.
rpath_foo
(),
'-R/foo'
)
@
unittest
.
skipUnless
(
sys
.
platform
==
'darwin'
,
'test only relevant for OS X'
)
def
test_osx_cc_overrides_ldshared
(
self
):
# Issue #18080:
# ensure that setting CC env variable also changes default linker
def
gcv
(
v
):
if
v
==
'LDSHARED'
:
return
'gcc-4.2 -bundle -undefined dynamic_lookup '
return
'gcc-4.2'
sysconfig
.
get_config_var
=
gcv
with
EnvironmentVarGuard
()
as
env
:
env
[
'CC'
]
=
'my_cc'
del
env
[
'LDSHARED'
]
sysconfig
.
customize_compiler
(
self
.
cc
)
self
.
assertEqual
(
self
.
cc
.
linker_so
[
0
],
'my_cc'
)
@
unittest
.
skipUnless
(
sys
.
platform
==
'darwin'
,
'test only relevant for OS X'
)
def
test_osx_explict_ldshared
(
self
):
# Issue #18080:
# ensure that setting CC env variable does not change
# explicit LDSHARED setting for linker
def
gcv
(
v
):
if
v
==
'LDSHARED'
:
return
'gcc-4.2 -bundle -undefined dynamic_lookup '
return
'gcc-4.2'
sysconfig
.
get_config_var
=
gcv
with
EnvironmentVarGuard
()
as
env
:
env
[
'CC'
]
=
'my_cc'
env
[
'LDSHARED'
]
=
'my_ld -bundle -dynamic'
sysconfig
.
customize_compiler
(
self
.
cc
)
self
.
assertEqual
(
self
.
cc
.
linker_so
[
0
],
'my_ld'
)
def
test_suite
():
return
unittest
.
makeSuite
(
UnixCCompilerTestCase
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment