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
ffc9caf9
Commit
ffc9caf9
authored
Apr 07, 2011
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport for Python 2.7 of issue 11715 support for building Python on
multiarch Debian/Ubuntu.
parent
c2b0d76b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
setup.py
setup.py
+23
-0
No files found.
setup.py
View file @
ffc9caf9
...
...
@@ -345,10 +345,33 @@ class PyBuildExt(build_ext):
return
platform
return
sys
.
platform
def
add_multiarch_paths
(
self
):
# Debian/Ubuntu multiarch support.
# https://wiki.ubuntu.com/MultiarchSpec
if
not
find_executable
(
'dpkg-architecture'
):
return
tmpfile
=
os
.
path
.
join
(
self
.
build_temp
,
'multiarch'
)
if
not
os
.
path
.
exists
(
self
.
build_temp
):
os
.
makedirs
(
self
.
build_temp
)
ret
=
os
.
system
(
'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null'
%
tmpfile
)
try
:
if
ret
>>
8
==
0
:
with
open
(
tmpfile
)
as
fp
:
multiarch_path_component
=
fp
.
readline
().
strip
()
add_dir_to_list
(
self
.
compiler
.
library_dirs
,
'/usr/lib/'
+
multiarch_path_component
)
add_dir_to_list
(
self
.
compiler
.
include_dirs
,
'/usr/include/'
+
multiarch_path_component
)
finally
:
os
.
unlink
(
tmpfile
)
def
detect_modules
(
self
):
# Ensure that /usr/local is always used
add_dir_to_list
(
self
.
compiler
.
library_dirs
,
'/usr/local/lib'
)
add_dir_to_list
(
self
.
compiler
.
include_dirs
,
'/usr/local/include'
)
self
.
add_multiarch_paths
()
# Add paths specified in the environment variables LDFLAGS and
# CPPFLAGS for header and library files.
...
...
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