Your IP : 3.145.2.6


Current Path : /opt/alt/python39/lib64/python3.9/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/__pycache__/_osx_support.cpython-39.opt-2.pyc

a

R�f
U�@s�ddlZddlZddlZgd�ZdZdZdZd-dd�Zd.d	d
�Zdd�Z	da
d
d�Zdadd�Z
dd�Zdd�Zdadd�Zdd�Zdd�Zdd�Zdd�Zdd �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�|durtjd}|�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�1/opt/alt/python39/lib64/python3.9/_osx_support.py�_find_executables

rFcCs�ddl}zddl}|��}Wn&tyBtdt��fd�}Yn0|�|��R}|rdd||jf}nd||jf}t�	|�s�|�
��d���ndWd�S1s�0YdS)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-cCs~tdurzdaztd�}Wnty*YnP0zt�d|���}W|��n
|��0|durzd�|�d��	d�dd��atS)Nr,z0/System/Library/CoreServices/SystemVersion.plistz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>�.��)
�_SYSTEM_VERSIONr!�OSError�re�searchr&�closer�groupr)r�mrrr�_get_system_versionVs
�r8cCsJtdurFt�}|rFztdd�|�d�D��aWntyDdaYn0tS)Ncss|]}t|�VqdS�N��int��.0�irrr�	<genexpr>��z,_get_system_version_tuple.<locals>.<genexpr>r.r)�_SYSTEM_VERSION_TUPLEr8�tupler�
ValueError�Zosx_versionrrr�_get_system_version_tupleus
rEcCs"t|�D]}|�t�r||=qdSr9)�list�
startswith�_INITPRE)�_config_vars�krrr�_remove_original_values�s
rKcCs8|�|d�}||kr,t||vr,||t|<|||<dS)Nr,)�getrH)rI�cvZnewvalueZoldvaluerrr�_save_modified_value�srNcCs�tdurtStd|fd�}d}|��D]T}|�d�r<d}q(|�d�rLd}q(|r(|��}|dkrfdaq(|�d�r(|dd	�aq(tdur�datS)
Nz%s -c -E -v - </dev/nullTFz#include <...>zEnd of search listz/usr/include�/z.sdk/usr/includei�)�_cache_default_sysrootr+�
splitlinesrGr(�endswith)�cc�contentsZ
in_incdirs�linerrr�_default_sysroot�s$


rVcCst�}|rt|dk�SdS)N��
�F)rE�boolrDrrr�_supports_universal_builds�sr[cCst�}|r|dkSdS)N)�rF)rErDrrr�_supports_arm64_builds�sr]cCs�dtjvr|S|d��d}}t|�s4td�}n<tj�|��d�rptd|�	dd�f�}|rpd|vrptd�}|s|t
d	��||kr�tD]L}||vr�|tjvr�||��}|d
kr�|n|d|d<t||d�
|��q�|S)
Nr	rZclangZgccz'%s' --version�'�'"'"'zllvm-gcczCannot locate working compilerr
z++� )rr
rrr-r�basenamerGr+�replace�SystemError�_COMPILER_CONFIG_VARSrNr)rIrSZoldcc�datarMZcv_splitrrr�_find_appropriate_compiler�s,

��rfcCsVtD]L}||vr|tjvr||}tjdd|tjd�}t�dd|�}t|||�q|S)N�
-arch\s+\w+\sr`)�flagsz-isysroot\s*\S+)�_UNIVERSAL_CONFIG_VARSrr
r3�sub�ASCIIrN)rIrMrhrrr�_remove_universal_flagssrlcCs�dtjvr|St�d|d�dur�t�d|d�dd�f�}|r�tD]8}||vrF|tjvrF||}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
r3r4r%rbrirjrN)rIZstatusrMrhrrr�_remove_unsupported_archss
��	rmcCsddtjvr`tjd}tD]F}||vrd||vr||}t�dd|�}|d|}t|||�q|S)N�	ARCHFLAGS�-archrgr`)rr
rir3rjrN)rIZarchrMrhrrr�_override_all_archs:s

rpcCsx|�dd�}t�d|�}|durt|�d�}tj�|�sttD]8}||vr:|tjvr:||}t�	dd|�}t
|||�q:|S)Nrr,z-isysroot\s*(\S+)r/z-isysroot\s*\S+(?:\s|$)r`)rLr3r4r6rr�existsrir
rjrN)rI�cflagsr7ZsdkrMrhrrr�_check_for_unavailable_sdkKs
rsc
Cs�d}}t|�}t�s d}}nd|v}tdd�|D��}|sHdtjvr�z|�d�}|||d�=WqHtyzYq�YqH0qHnFt�s�tt	t
|���D].}||dkr�||dd	kr�|||d�=q�dtjvr�|s�|tjd��}|�r>d
d�t|�D�}|�s�q>|d}||d
k�r.|||d�=q�|||d�=q�d}|}dd�t|�D�}|�st|}dd�t|�D�}|D]B}||d
k�r�||d}�q�n||t
d
�d�}�q��qx|�r�tj
�|��s�ddlm}	|	�d|�|	�d�|S)NFTrocss|]}|�d�r|VqdS)�	-isysrootN�rG)r=�argrrrr?yr@z!compiler_fixup.<locals>.<genexpr>rnr0r/�arm64cSsg|]\}}|�d�r|�qS�rtru�r=r>�xrrr�
<listcomp>�r@z"compiler_fixup.<locals>.<listcomp>rrtcSsg|]\}}|�d�r|�qSrxruryrrrr{�r@cSsg|]\}}|�d�r|�qSrxruryrrrr{�r@)�logz4Compiling with an SDK that doesn't seem to exist: %sz$Please check your Xcode installation)rFr[�anyrr
�indexrCr]�reversed�range�lenr�	enumerater�isdirZ	distutilsr|�warn)
Zcompiler_soZcc_argsZ	stripArchZstripSysrootr~�idx�indicesZsysrootZargvarr|rrrrfsZ	


�
rcCs"t�st|�t|�t|�|Sr9)r[rlrprs�rIrrrr�s
rcCst|�t|�t|�|Sr9)rfrmrpr�rrrr�s	rcCs�|�dd�}t�p|}|p|}|�r�|}d}|�td|�dd��}|r�z$tdd�|�d�dd	�D��}Wq�ty�d
}Yq�0nd
}|dk�rDd|��v�rDd
}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�r4d}ntd|f��n<|dk�r`tj
dk�r�d}n |dv�r�tj
dk�r|d }nd!}|||fS)"NZMACOSX_DEPLOYMENT_TARGETr,Zmacosxrcss|]}t|�VqdSr9r:r<rrrr?r@z#get_platform_osx.<locals>.<genexpr>r.rr0)rXrrWroZfatz
-arch\s+(\S+)r/)rw�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�)rLr8rHrBrrCr(r3�findall�sorted�setr�r�maxsize)rIZosname�release�machineZmacverZ
macreleaserrZarchsrrrr�sX



�$




�

r)N)F)rr3r�__all__rirdrHrr+r-r1r8rArErKrNrPrVr[r]rfrlrmrprsrrrrrrrr�<module>s8


	

>(Q)

?>