Your IP : 3.142.251.204


Current Path : /lib64/python3.8/__pycache__/
Upload File :
Current File : //lib64/python3.8/__pycache__/_osx_support.cpython-38.opt-2.pyc

U

e5dU�@s�ddlZddlZddlZddddgZdZdZdZd,d	d
�Zd-dd
�Zdd�Z	da
dd�Zdadd�Z
dd�Zdd�Zdadd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d�Zd)d�Zd*d�Zd+d�ZdS).�N�compiler_fixup�customize_config_vars�customize_compiler�get_platform_osx)
�CFLAGSZLDFLAGSZCPPFLAGSZ
BASECFLAGS�	BLDSHARED�LDSHARED�CC�CXXZ	PY_CFLAGSZ
PY_LDFLAGSZPY_CPPFLAGSZPY_CORE_CFLAGSZPY_CORE_LDFLAGS)rrr	r
Z_OSX_SUPPORT_INITIAL_cCs�|dkrtjd}|�tj�}tj�|�\}}tjdkrH|dkrH|d}tj�|�s�|D]&}tj�	||�}tj�|�rX|SqXdS|SdS)N�PATHZwin32z.exe)
�os�environ�split�pathsep�path�splitext�sys�platform�isfile�join)�
executabler�paths�baseZext�p�f�r�$/usr/lib64/python3.8/_osx_support.py�_find_executables

rFc
Cs�ddl}zddl}|��}Wn(tk
rDtdt��fd�}YnX|�|��P}|rfd||jf}nd||jf}t�	|�s�|�
��d���ndW5QR�SQRXdS)Nrz/tmp/_osx_support.%szw+bz
%s >'%s' 2>&1z%s 2>/dev/null >'%s'zutf-8)
�
contextlib�tempfileZNamedTemporaryFile�ImportError�openr�getpid�closing�name�system�read�decode�strip)Z
commandstringZcapture_stderrrr�fp�cmdrrr�_read_output7s��
r+cCst|�ptd|f�pdS)Nz/usr/bin/xcrun -find %s�)rr+)Ztoolnamerrr�_find_build_toolMs
��r-cCsxtdkrtdaztd�}Wntk
r,YnHXzt�d|���}W5|��X|dk	rtd�|�d��	d�dd��atS)Nr,z0/System/Library/CoreServices/SystemVersion.plistz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>�.��)
�_SYSTEM_VERSIONr!�OSError�close�re�searchr&r�groupr)r�mrrr�_get_system_versionVs
�
r8cCsLtdkrHt�}|rHztdd�|�d�D��aWntk
rFdaYnXtS)Ncss|]}t|�VqdS�N��int��.0�irrr�	<genexpr>�sz,_get_system_version_tuple.<locals>.<genexpr>r.r)�_SYSTEM_VERSION_TUPLEr8�tupler�
ValueError�Zosx_versionrrr�_get_system_version_tupleus
rDcCs"t|�D]}|�t�r||=qdSr9)�list�
startswith�_INITPRE)�_config_vars�krrr�_remove_original_values�s
rJcCs8|�|d�}||kr,t||kr,||t|<|||<dS)Nr,)�getrG)rH�cvZnewvalueZoldvaluerrr�_save_modified_value�srMcCs�tdk	rtStd|fd�}d}|��D]T}|�d�r<d}q(|�d�rLd}q(|r(|��}|dkrfdaq(|�d�r(|dd	�aq(tdkr�datS)
Nz%s -c -E -v - </dev/nullTFz#include <...>zEnd of search listz/usr/include�/z.sdk/usr/includei�)�_cache_default_sysrootr+�
splitlinesrFr(�endswith)�cc�contentsZ
in_incdirs�linerrr�_default_sysroot�s$


rUcCst�}|rt|dk�SdS)N��
�F)rD�boolrCrrr�_supports_universal_builds�srZcCst�}|r|dkSdS)N)�rF)rDrCrrr�_supports_arm64_builds�sr\cCs�dtjkr|S|d��d}}t|�s4td�}n<tj�|��d�rptd|�	dd�f�}|rpd|krptd�}|s|t
d	��||kr�tD]L}||kr�|tjkr�||��}|d
kr�|n|d|d<t||d�
|��q�|S)
Nr	rZclangZgccz'%s' --version�'�'"'"'zllvm-gcczCannot locate working compilerr
z++� )rr
rrr-r�basenamerFr+�replace�SystemError�_COMPILER_CONFIG_VARSrMr)rHrRZoldcc�datarLZcv_splitrrr�_find_appropriate_compiler�s,

��recCsVtD]L}||kr|tjkr||}tjdd|tjd�}t�dd|�}t|||�q|S)N�
-arch\s+\w+\sr_)�flagsz-isysroot\s*\S+)�_UNIVERSAL_CONFIG_VARSrr
r4�sub�ASCIIrM)rHrLrgrrr�_remove_universal_flagssrkcCs�dtjkr|St�d|d�dk	r�t�d|d�dd�f�}|r�tD]8}||krF|tjkrF||}t�dd|�}t|||�qF|S)	Nr	z-arch\s+ppcrzNecho 'int main{};' | '%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullr]r^z-arch\s+ppc\w*\sr_)	rr
r4r5r%rarhrirM)rHZstatusrLrgrrr�_remove_unsupported_archss
��	rlcCsddtjkr`tjd}tD]F}||krd||kr||}t�dd|�}|d|}t|||�q|S)N�	ARCHFLAGS�-archrfr_)rr
rhr4rirM)rHZarchrLrgrrr�_override_all_archs:s

rocCsx|�dd�}t�d|�}|dk	rt|�d�}tj�|�sttD]8}||kr:|tjkr:||}t�	dd|�}t
|||�q:|S)Nrr,z-isysroot\s*(\S+)r/z-isysroot\s*\S+(?:\s|$)r_)rKr4r5r6rr�existsrhr
rirM)rH�cflagsr7ZsdkrLrgrrr�_check_for_unavailable_sdkKs
rrc
Cs�d}}t|�}t�s d}}nd|k}tdd�|D��}|sHdtjkr�z|�d�}|||d�=WqHtk
r|Yq�YqHXqHnFt�s�tt	t
|���D].}||dkr�||dd	kr�|||d�=q�dtjkr�|s�|tjd��}|�r@d
d�t|�D�}|�s
�q@|d}||d
k�r0|||d�=q�|||d�=q�d}|}dd�t|�D�}|�sv|}dd�t|�D�}|D]B}||d
k�r�||d}�q�n||t
d
�d�}�q��qz|�r�tj
�|��s�ddlm}	|	�d|�|	�d�|S)NFTrncss|]}|�d�r|VqdS)�	-isysrootN�rF)r=�argrrrr?ys
z!compiler_fixup.<locals>.<genexpr>rmr0r/�arm64cSsg|]\}}|�d�r|�qS�rsrt�r=r>�xrrr�
<listcomp>�s
z"compiler_fixup.<locals>.<listcomp>rrscSsg|]\}}|�d�r|�qSrwrtrxrrrrz�s
cSsg|]\}}|�d�r|�qSrwrtrxrrrrz�s
)�logz4Compiling with an SDK that doesn't seem to exist: %sz$Please check your Xcode installation)rErZ�anyrr
�indexrBr\�reversed�range�lenr�	enumerater�isdirZ	distutilsr{�warn)
Zcompiler_soZcc_argsZ	stripArchZstripSysrootr}�idx�indicesZsysrootZargvarr{rrrrfsZ	


�
cCs"t�st|�t|�t|�|Sr9)rZrkrorr�rHrrrr�s
cCst|�t|�t|�|Sr9)rerlror�rrrr�s	cCs�|�dd�}t�p|}|p|}|�r�|}d}|�td|�dd��}|r�z$tdd�|�d�dd	�D��}Wq�tk
r�d
}Yq�Xnd
}|dk�rFd|��k�rFd
}t�d|�}tt	t
|���}t|�dkr�|d}nj|dkr�d}n\|dkr�d
}nN|dk�rd}n>|dk�rd}n.|dk�r&d}n|dk�r6d}ntd|f��n<|dk�rbtj
dk�r�d}n |dk�r�tj
dk�r~d }nd!}|||fS)"NZMACOSX_DEPLOYMENT_TARGETr,Zmacosxrcss|]}t|�VqdSr9r:r<rrrr?sz#get_platform_osx.<locals>.<genexpr>r.rr0)rWrrVrnZfatz
-arch\s+(\S+)r/)rv�x86_64Z
universal2)�i386�ppc)r�r�Zintel)r�r�r�Zfat3)�ppc64r�Zfat64)r�r�r�r�Z	universalz%Don't know machine value for archs=%rr�lr�)ZPowerPCZPower_Macintoshr�r�)rKr8rGrArrBr(r4�findall�sorted�setr�r�maxsize)rHZosname�release�machineZmacverZ
macreleaserqZarchsrrrr�sX



�$




�

)N)F)rr4r�__all__rhrcrGrr+r-r1r8r@rDrJrMrOrUrZr\rerkrlrorrrrrrrrrr�<module>s@�


	

>(Q)

?>