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
59b774b0
Commit
59b774b0
authored
May 18, 2016
by
Cosimo Lupo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build_ext: move block customizing compiler for shared lib into a function
parent
0f476502
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
+22
-14
setuptools/command/build_ext.py
setuptools/command/build_ext.py
+22
-14
No files found.
setuptools/command/build_ext.py
View file @
59b774b0
...
...
@@ -22,6 +22,27 @@ get_config_var("LDSHARED") # make sure _config_vars is initialized
del
get_config_var
from
distutils.sysconfig
import
_config_vars
as
_CONFIG_VARS
def
_customize_compiler_for_shlib
(
compiler
):
if
sys
.
platform
==
"darwin"
:
# building .dylib requires additional compiler flags on OSX; here we
# temporarily substitute the pyconfig.h variables so that distutils'
# 'customize_compiler' uses them before we build the shared libraries.
tmp
=
_CONFIG_VARS
.
copy
()
try
:
# XXX Help! I don't have any idea whether these are right...
_CONFIG_VARS
[
'LDSHARED'
]
=
(
"gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
)
_CONFIG_VARS
[
'CCSHARED'
]
=
" -dynamiclib"
_CONFIG_VARS
[
'SO'
]
=
".dylib"
customize_compiler
(
compiler
)
finally
:
_CONFIG_VARS
.
clear
()
_CONFIG_VARS
.
update
(
tmp
)
else
:
customize_compiler
(
compiler
)
have_rtld
=
False
use_stubs
=
False
libtype
=
'shared'
...
...
@@ -120,20 +141,7 @@ class build_ext(_build_ext):
compiler
=
self
.
shlib_compiler
=
new_compiler
(
compiler
=
self
.
compiler
,
dry_run
=
self
.
dry_run
,
force
=
self
.
force
)
if
sys
.
platform
==
"darwin"
:
tmp
=
_CONFIG_VARS
.
copy
()
try
:
# XXX Help! I don't have any idea whether these are right...
_CONFIG_VARS
[
'LDSHARED'
]
=
(
"gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
)
_CONFIG_VARS
[
'CCSHARED'
]
=
" -dynamiclib"
_CONFIG_VARS
[
'SO'
]
=
".dylib"
customize_compiler
(
compiler
)
finally
:
_CONFIG_VARS
.
clear
()
_CONFIG_VARS
.
update
(
tmp
)
else
:
customize_compiler
(
compiler
)
_customize_compiler_for_shlib
(
compiler
)
if
self
.
include_dirs
is
not
None
:
compiler
.
set_include_dirs
(
self
.
include_dirs
)
...
...
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