Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b8da1a4f
Commit
b8da1a4f
authored
Feb 25, 2016
by
Ned Deily
Browse files
Options
Browse Files
Download
Plain Diff
Issue #25136: merge from 3.5
parents
b1188704
020250f9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
2 deletions
+41
-2
Lib/distutils/ccompiler.py
Lib/distutils/ccompiler.py
+2
-2
Lib/distutils/unixccompiler.py
Lib/distutils/unixccompiler.py
+22
-0
Misc/NEWS
Misc/NEWS
+1
-0
setup.py
setup.py
+16
-0
No files found.
Lib/distutils/ccompiler.py
View file @
b8da1a4f
...
...
@@ -875,9 +875,9 @@ main (int argc, char **argv) {
def
library_filename
(
self
,
libname
,
lib_type
=
'static'
,
# or 'shared'
strip_dir
=
0
,
output_dir
=
''
):
assert
output_dir
is
not
None
if
lib_type
not
in
(
"static"
,
"shared"
,
"dylib"
):
if
lib_type
not
in
(
"static"
,
"shared"
,
"dylib"
,
"xcode_stub"
):
raise
ValueError
(
"'lib_type' must be
\
"
static
\
"
,
\
"
shared
\
"
or
\
"
dyli
b
\
"
"
)
"'lib_type' must be
\
"
static
\
"
,
\
"
shared
\
"
,
\
"
dylib
\
"
, or
\
"
xcode_stu
b
\
"
"
)
fmt
=
getattr
(
self
,
lib_type
+
"_lib_format"
)
ext
=
getattr
(
self
,
lib_type
+
"_lib_extension"
)
...
...
Lib/distutils/unixccompiler.py
View file @
b8da1a4f
...
...
@@ -76,7 +76,9 @@ class UnixCCompiler(CCompiler):
static_lib_extension
=
".a"
shared_lib_extension
=
".so"
dylib_lib_extension
=
".dylib"
xcode_stub_lib_extension
=
".tbd"
static_lib_format
=
shared_lib_format
=
dylib_lib_format
=
"lib%s%s"
xcode_stub_lib_format
=
dylib_lib_format
if
sys
.
platform
==
"cygwin"
:
exe_extension
=
".exe"
...
...
@@ -255,12 +257,28 @@ class UnixCCompiler(CCompiler):
def
find_library_file
(
self
,
dirs
,
lib
,
debug
=
0
):
shared_f
=
self
.
library_filename
(
lib
,
lib_type
=
'shared'
)
dylib_f
=
self
.
library_filename
(
lib
,
lib_type
=
'dylib'
)
xcode_stub_f
=
self
.
library_filename
(
lib
,
lib_type
=
'xcode_stub'
)
static_f
=
self
.
library_filename
(
lib
,
lib_type
=
'static'
)
if
sys
.
platform
==
'darwin'
:
# On OSX users can specify an alternate SDK using
# '-isysroot', calculate the SDK root if it is specified
# (and use it further on)
#
# Note that, as of Xcode 7, Apple SDKs may contain textual stub
# libraries with .tbd extensions rather than the normal .dylib
# shared libraries installed in /. The Apple compiler tool
# chain handles this transparently but it can cause problems
# for programs that are being built with an SDK and searching
# for specific libraries. Callers of find_library_file need to
# keep in mind that the base filename of the returned SDK library
# file might have a different extension from that of the library
# file installed on the running system, for example:
# /Applications/Xcode.app/Contents/Developer/Platforms/
# MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/
# usr/lib/libedit.tbd
# vs
# /usr/lib/libedit.dylib
cflags
=
sysconfig
.
get_config_var
(
'CFLAGS'
)
m
=
re
.
search
(
r'-isysroot\
s+(
\S+)'
,
cflags
)
if
m
is
None
:
...
...
@@ -274,6 +292,7 @@ class UnixCCompiler(CCompiler):
shared
=
os
.
path
.
join
(
dir
,
shared_f
)
dylib
=
os
.
path
.
join
(
dir
,
dylib_f
)
static
=
os
.
path
.
join
(
dir
,
static_f
)
xcode_stub
=
os
.
path
.
join
(
dir
,
xcode_stub_f
)
if
sys
.
platform
==
'darwin'
and
(
dir
.
startswith
(
'/System/'
)
or
(
...
...
@@ -282,6 +301,7 @@ class UnixCCompiler(CCompiler):
shared
=
os
.
path
.
join
(
sysroot
,
dir
[
1
:],
shared_f
)
dylib
=
os
.
path
.
join
(
sysroot
,
dir
[
1
:],
dylib_f
)
static
=
os
.
path
.
join
(
sysroot
,
dir
[
1
:],
static_f
)
xcode_stub
=
os
.
path
.
join
(
sysroot
,
dir
[
1
:],
xcode_stub_f
)
# We're second-guessing the linker here, with not much hard
# data to go on: GCC seems to prefer the shared library, so I'm
...
...
@@ -289,6 +309,8 @@ class UnixCCompiler(CCompiler):
# ignoring even GCC's "-static" option. So sue me.
if
os
.
path
.
exists
(
dylib
):
return
dylib
elif
os
.
path
.
exists
(
xcode_stub
):
return
xcode_stub
elif
os
.
path
.
exists
(
shared
):
return
shared
elif
os
.
path
.
exists
(
static
):
...
...
Misc/NEWS
View file @
b8da1a4f
...
...
@@ -763,6 +763,7 @@ Build
- Issue #26268: Update OS X 10.5 installer and Windows builds to use
OpenSSL 1.0.2f.
- Issue #25136: Support Apple Xcode 7'
s
new
textual
SDK
stub
libraries
.
Windows
-------
...
...
setup.py
View file @
b8da1a4f
...
...
@@ -136,6 +136,22 @@ def find_library_file(compiler, libname, std_dirs, paths):
p
=
p
.
rstrip
(
os
.
sep
)
if
host_platform
==
'darwin'
and
is_macosx_sdk_path
(
p
):
# Note that, as of Xcode 7, Apple SDKs may contain textual stub
# libraries with .tbd extensions rather than the normal .dylib
# shared libraries installed in /. The Apple compiler tool
# chain handles this transparently but it can cause problems
# for programs that are being built with an SDK and searching
# for specific libraries. Distutils find_library_file() now
# knows to also search for and return .tbd files. But callers
# of find_library_file need to keep in mind that the base filename
# of the returned SDK library file might have a different extension
# from that of the library file installed on the running system,
# for example:
# /Applications/Xcode.app/Contents/Developer/Platforms/
# MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/
# usr/lib/libedit.tbd
# vs
# /usr/lib/libedit.dylib
if
os
.
path
.
join
(
sysroot
,
p
[
1
:])
==
dirname
:
return
[
]
...
...
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