Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
67502820
Kaydet (Commit)
67502820
authored
May 28, 2013
tarafından
Ned Deily
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #18080: merge from 3.3
üst
56dfc212
97345680
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
4 deletions
+47
-4
sysconfig.py
Lib/distutils/sysconfig.py
+8
-2
test_unixccompiler.py
Lib/distutils/tests/test_unixccompiler.py
+34
-2
NEWS
Misc/NEWS
+5
-0
No files found.
Lib/distutils/sysconfig.py
Dosyayı görüntüle @
67502820
...
...
@@ -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
:
...
...
Lib/distutils/tests/test_unixccompiler.py
Dosyayı görüntüle @
67502820
"""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
)
...
...
Misc/NEWS
Dosyayı görüntüle @
67502820
...
...
@@ -308,6 +308,11 @@ Library
- Issue #17032: The "global" in the "NameError: global name '
x
' is not defined"
error message has been removed. Patch by Ram Rachum.
- Issue #18080: When building a C extension module on OS X, if the compiler
is overriden with the CC environment variable, use the new compiler as
the default for linking if LDSHARED is not also overriden. This restores
Distutils behavior introduced in 3.2.3 and inadvertently dropped in 3.3.0.
Tests
-----
...
...
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