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
0288dd6a
Unverified
Kaydet (Commit)
0288dd6a
authored
Haz 03, 2019
tarafından
Ned Deily
Kaydeden (comit)
GitHub
Haz 03, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-36231: Support building on macOS without /usr/include (GH-13773)
üst
8565f6b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
7 deletions
+48
-7
2019-06-03-05-49-49.bpo-36231.RfmW_p.rst
...EWS.d/next/macOS/2019-06-03-05-49-49.bpo-36231.RfmW_p.rst
+3
-0
setup.py
setup.py
+45
-7
No files found.
Misc/NEWS.d/next/macOS/2019-06-03-05-49-49.bpo-36231.RfmW_p.rst
0 → 100644
Dosyayı görüntüle @
0288dd6a
Support building Python on macOS without /usr/include installed. As of macOS
10.14, system header files are only available within an SDK provided by
either the Command Line Tools or the Xcode app.
setup.py
Dosyayı görüntüle @
0288dd6a
...
@@ -125,19 +125,57 @@ def sysroot_paths(make_vars, subdirs):
...
@@ -125,19 +125,57 @@ def sysroot_paths(make_vars, subdirs):
break
break
return
dirs
return
dirs
MACOS_SDK_ROOT
=
None
def
macosx_sdk_root
():
def
macosx_sdk_root
():
"""Return the directory of the current macOS SDK.
If no SDK was explicitly configured, call the compiler to find which
include files paths are being searched by default. Use '/' if the
compiler is searching /usr/include (meaning system header files are
installed) or use the root of an SDK if that is being searched.
(The SDK may be supplied via Xcode or via the Command Line Tools).
The SDK paths used by Apple-supplied tool chains depend on the
setting of various variables; see the xcrun man page for more info.
"""
"""
Return the directory of the current OSX SDK,
global
MACOS_SDK_ROOT
or '/' if no SDK was specified.
"""
# If already called, return cached result.
if
MACOS_SDK_ROOT
:
return
MACOS_SDK_ROOT
cflags
=
sysconfig
.
get_config_var
(
'CFLAGS'
)
cflags
=
sysconfig
.
get_config_var
(
'CFLAGS'
)
m
=
re
.
search
(
r'-isysroot\s+(\S+)'
,
cflags
)
m
=
re
.
search
(
r'-isysroot\s+(\S+)'
,
cflags
)
if
m
is
None
:
if
m
is
not
None
:
sysroot
=
'/'
MACOS_SDK_ROOT
=
m
.
group
(
1
)
else
:
else
:
sysroot
=
m
.
group
(
1
)
MACOS_SDK_ROOT
=
'/'
return
sysroot
cc
=
sysconfig
.
get_config_var
(
'CC'
)
tmpfile
=
'/tmp/setup_sdk_root.
%
d'
%
os
.
getpid
()
try
:
os
.
unlink
(
tmpfile
)
except
:
pass
ret
=
os
.
system
(
'
%
s -E -v - </dev/null 2>
%
s 1>/dev/null'
%
(
cc
,
tmpfile
))
in_incdirs
=
False
try
:
if
ret
>>
8
==
0
:
with
open
(
tmpfile
)
as
fp
:
for
line
in
fp
.
readlines
():
if
line
.
startswith
(
"#include <...>"
):
in_incdirs
=
True
elif
line
.
startswith
(
"End of search list"
):
in_incdirs
=
False
elif
in_incdirs
:
line
=
line
.
strip
()
if
line
==
'/usr/include'
:
MACOS_SDK_ROOT
=
'/'
elif
line
.
endswith
(
".sdk/usr/include"
):
MACOS_SDK_ROOT
=
line
[:
-
12
]
finally
:
os
.
unlink
(
tmpfile
)
return
MACOS_SDK_ROOT
def
is_macosx_sdk_path
(
path
):
def
is_macosx_sdk_path
(
path
):
...
...
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