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
1fa5a38e
Commit
1fa5a38e
authored
Apr 19, 2016
by
Victor Stinner
Browse files
Options
Browse Files
Download
Plain Diff
Merge 3.5: Issue #21668
parents
daac5f9f
def8072c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
9 deletions
+25
-9
Misc/NEWS
Misc/NEWS
+4
-1
setup.py
setup.py
+21
-8
No files found.
Misc/NEWS
View file @
1fa5a38e
...
@@ -990,6 +990,9 @@ Tests
...
@@ -990,6 +990,9 @@ Tests
Build
Build
-----
-----
- Issue #21668: Link audioop, _datetime, _ctypes_test modules to libm,
except on Mac OS X. Patch written by Xavier de Gaye.
- Issue #25702: A --with-lto configure option has been added that will
- Issue #25702: A --with-lto configure option has been added that will
enable link time optimizations at build time during a make profile-opt.
enable link time optimizations at build time during a make profile-opt.
Some compilers and toolchains are known to not produce stable code when
Some compilers and toolchains are known to not produce stable code when
...
...
setup.py
View file @
1fa5a38e
...
@@ -480,6 +480,13 @@ class PyBuildExt(build_ext):
...
@@ -480,6 +480,13 @@ class PyBuildExt(build_ext):
finally
:
finally
:
os
.
unlink
(
tmpfile
)
os
.
unlink
(
tmpfile
)
def
detect_math_libs
(
self
):
# Check for MacOS X, which doesn't need libm.a at all
if
host_platform
==
'darwin'
:
return
[]
else
:
return
[
'm'
]
def
detect_modules
(
self
):
def
detect_modules
(
self
):
# Ensure that /usr/local is always used, but the local build
# Ensure that /usr/local is always used, but the local build
# directories (i.e. '.' and 'Include') must be first. See issue
# directories (i.e. '.' and 'Include') must be first. See issue
...
@@ -584,10 +591,7 @@ class PyBuildExt(build_ext):
...
@@ -584,10 +591,7 @@ class PyBuildExt(build_ext):
if
item
.
startswith
(
'-L'
):
if
item
.
startswith
(
'-L'
):
lib_dirs
.
append
(
item
[
2
:])
lib_dirs
.
append
(
item
[
2
:])
# Check for MacOS X, which doesn't need libm.a at all
math_libs
=
self
.
detect_math_libs
()
math_libs
=
[
'm'
]
if
host_platform
==
'darwin'
:
math_libs
=
[]
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
...
@@ -620,7 +624,10 @@ class PyBuildExt(build_ext):
...
@@ -620,7 +624,10 @@ class PyBuildExt(build_ext):
# time operations and variables
# time operations and variables
exts
.
append
(
Extension
(
'time'
,
[
'timemodule.c'
],
exts
.
append
(
Extension
(
'time'
,
[
'timemodule.c'
],
libraries
=
time_libs
)
)
libraries
=
time_libs
)
)
exts
.
append
(
Extension
(
'_datetime'
,
[
'_datetimemodule.c'
])
)
# math_libs is needed by delta_new() that uses round() and by accum()
# that uses modf().
exts
.
append
(
Extension
(
'_datetime'
,
[
'_datetimemodule.c'
],
libraries
=
math_libs
)
)
# random number generator implemented in C
# random number generator implemented in C
exts
.
append
(
Extension
(
"_random"
,
[
"_randommodule.c"
])
)
exts
.
append
(
Extension
(
"_random"
,
[
"_randommodule.c"
])
)
# bisect
# bisect
...
@@ -691,11 +698,14 @@ class PyBuildExt(build_ext):
...
@@ -691,11 +698,14 @@ class PyBuildExt(build_ext):
# Multimedia modules
# Multimedia modules
# These don't work for 64-bit platforms!!!
# These don't work for 64-bit platforms!!!
# These represent audio samples or images as strings:
# These represent audio samples or images as strings:
#
# Operations on audio samples
# Operations on audio samples
# According to #993173, this one should actually work fine on
# According to #993173, this one should actually work fine on
# 64-bit platforms.
# 64-bit platforms.
exts
.
append
(
Extension
(
'audioop'
,
[
'audioop.c'
])
)
#
# audioop needs math_libs for floor() in multiple functions.
exts
.
append
(
Extension
(
'audioop'
,
[
'audioop.c'
],
libraries
=
math_libs
)
)
# readline
# readline
do_readline
=
self
.
compiler
.
find_library_file
(
lib_dirs
,
'readline'
)
do_readline
=
self
.
compiler
.
find_library_file
(
lib_dirs
,
'readline'
)
...
@@ -1937,6 +1947,7 @@ class PyBuildExt(build_ext):
...
@@ -1937,6 +1947,7 @@ class PyBuildExt(build_ext):
'_ctypes/stgdict.c'
,
'_ctypes/stgdict.c'
,
'_ctypes/cfield.c'
]
'_ctypes/cfield.c'
]
depends
=
[
'_ctypes/ctypes.h'
]
depends
=
[
'_ctypes/ctypes.h'
]
math_libs
=
self
.
detect_math_libs
()
if
host_platform
==
'darwin'
:
if
host_platform
==
'darwin'
:
sources
.
append
(
'_ctypes/malloc_closure.c'
)
sources
.
append
(
'_ctypes/malloc_closure.c'
)
...
@@ -1967,8 +1978,10 @@ class PyBuildExt(build_ext):
...
@@ -1967,8 +1978,10 @@ class PyBuildExt(build_ext):
libraries
=
[],
libraries
=
[],
sources
=
sources
,
sources
=
sources
,
depends
=
depends
)
depends
=
depends
)
# function my_sqrt() needs math library for sqrt()
ext_test
=
Extension
(
'_ctypes_test'
,
ext_test
=
Extension
(
'_ctypes_test'
,
sources
=
[
'_ctypes/_ctypes_test.c'
])
sources
=
[
'_ctypes/_ctypes_test.c'
],
libraries
=
math_libs
)
self
.
extensions
.
extend
([
ext
,
ext_test
])
self
.
extensions
.
extend
([
ext
,
ext_test
])
if
not
'--with-system-ffi'
in
sysconfig
.
get_config_var
(
"CONFIG_ARGS"
):
if
not
'--with-system-ffi'
in
sysconfig
.
get_config_var
(
"CONFIG_ARGS"
):
...
...
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