Your IP : 18.222.161.245


Current Path : /proc/self/root/opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python37/lib64/python3.7/__pycache__/_osx_support.cpython-37.opt-2.pyc

B

YI~d�L�@s�ddlZddlZddlZddddgZdZdZdZd%d	d
�Zdd�Zd
d�Z	da
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �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�x*|D]"}tj�	||�}tj�|�rZ|SqZWdS|SdS)N�PATH�win32z.exe)
�os�environ�split�pathsep�path�splitext�sys�platform�isfile�join)�
executabler�paths�baseZext�p�f�r�1/opt/alt/python37/lib64/python3.7/_osx_support.py�_find_executables

rc	Cs�ddl}yddl}|��}Wn(tk
rDtdt��fd�}YnX|�|��0}d||jf}t�	|�s||�
��d���SdSQRXdS)Nrz/tmp/_osx_support.%szw+bz%s 2>/dev/null >'%s'zutf-8)
�
contextlib�tempfileZNamedTemporaryFile�ImportError�openr
�getpid�closing�name�system�read�decode�strip)Z
commandstringrr �fp�cmdrrr�_read_output7sr,cCst|�ptd|f�pdS)Nz/usr/bin/xcrun -find %s�)rr,)Ztoolnamerrr�_find_build_toolJsr.cCsxtdkrtdaytd�}Wntk
r,YnHXzt�d|���}Wd|��X|dk	rtd�|�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_versionSs

r9cCs&x t|�D]}|�t�r
||=q
WdS)N)�list�
startswith�_INITPRE)�_config_vars�krrr�_remove_original_valuesqs
r?cCs8|�|d�}||kr,t||kr,||t|<|||<dS)Nr-)�getr<)r=�cvZnewvalueZoldvaluerrr�_save_modified_valuexsrBcCsTt�}|r@ytdd�|�d�D��}Wntk
r>d}YnX|rPt|dk�SdS)Ncss|]}t|�VqdS)N)�int)�.0�irrr�	<genexpr>�sz-_supports_universal_builds.<locals>.<genexpr>r/r-)�
�F)r9�tupler�
ValueError�bool)Zosx_versionrrr�_supports_universal_builds�s
rLcCs�dtjkr|S|d��d}}t|�s4td�}n<tj�|��d�rptd|�	dd�f�}|rpd|krptd�}|s|t
d	��||kr�xTtD]L}||kr�|tjkr�||��}|d
kr�|n|d|d<t||d�
|��q�W|S)
Nr	rZclangZgccz'%s' --version�'z'"'"'zllvm-gcczCannot locate working compilerr
z++� )r
rrrr.r�basenamer;r,�replace�SystemError�_COMPILER_CONFIG_VARSrBr)r=ZccZoldcc�datarAZcv_splitrrr�_find_appropriate_compiler�s(


rTcCsZxTtD]L}||kr|tjkr||}tjdd|tjd�}t�dd|�}t|||�qW|S)Nz
-arch\s+\w+\srN)�flagsz-isysroot\s*\S+)�_UNIVERSAL_CONFIG_VARSr
rr4�sub�ASCIIrB)r=rArUrrr�_remove_universal_flags�s
rYcCs�dtjkr|St�d|d�dk	r�t�d|d�dd�f�}|r�x@tD]8}||krH|tjkrH||}t�dd|�}t|||�qHW|S)	Nr	z-arch\s+ppcrzNecho 'int main{};' | '%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullrMz'"'"'z-arch\s+ppc\w*\srN)	r
rr4r5r&rPrVrWrB)r=�statusrArUrrr�_remove_unsupported_archs�s
	
r[cCshdtjkrdtjd}xNtD]F}||krd||kr||}t�dd|�}|d|}t|||�qW|S)N�	ARCHFLAGSz-archz
-arch\s+\w+\srN)r
rrVr4rWrB)r=ZarchrArUrrr�_override_all_archss


r]cCs||�dd�}t�d|�}|dk	rx|�d�}tj�|�sxx@tD]8}||kr<|tjkr<||}t�	dd|�}t
|||�q<W|S)Nrr-z-isysroot\s*(\S+)r0z-isysroot\s*\S+(?:\s|$)rN)r@r4r5r7r
r�existsrVrrWrB)r=�cflagsr8ZsdkrArUrrr�_check_for_unavailable_sdks

r`c
Cs�d}}t|�}t�s d}}nd|k}tdd�|D��}|sHdtjkr�x8y|�d�}|||d�=WqJtk
r|PYqJXqJWdtjkr�|s�|tjd��}|r�xNdd	�t|�D�}|s�P|d
}||dkr�|||d�=q�|||d�=q�Wd}|}d
d	�t|�D�}|�s,|}dd	�t|�D�}xB|D]:}||dk�rT||d}Pn||t	d�d�}P�q2W|�r�tj
�|��s�d
dlm
}	|	�d|�|	�d�|S)NFTz-archcss|]}|�d�r|VqdS)z	-isysrootN)r;)rD�argrrrrFCsz!compiler_fixup.<locals>.<genexpr>r\r1cSsg|]\}}|�d�r|�qS)z	-isysroot)r;)rDrE�xrrr�
<listcomp>Usz"compiler_fixup.<locals>.<listcomp>rz	-isysrootr0cSsg|]\}}|�d�r|�qS)z	-isysroot)r;)rDrErbrrrrcescSsg|]\}}|�d�r|�qS)z	-isysroot)r;)rDrErbrrrrchs)�logz4Compiling with an SDK that doesn't seem to exist: %sz$Please check your Xcode installation)r:rL�anyr
r�indexrJr�	enumerate�lenr�isdirZ	distutilsrd�warn)
Zcompiler_soZcc_argsZ	stripArchZstripSysrootrf�indicesZsysrootZargvar�idxrdrrrr0sT	



cCs"t�st|�t|�t|�|S)N)rLrYr]r`)r=rrrr{s
cCst|�t|�t|�|S)N)rTr[r])r=rrrr�s	cCs||�dd�}t�p|}|p|}|�rr|}d}|�td|�dd��}|r�y$tdd�|�d�dd	�D��}Wq�tk
r�d
}Yq�Xnd
}|dk�r6d|��k�r6d
}t�d|�}tt	t
|���}t|�dkr�|d}nZ|dkr�d
}nL|dkr�d}n>|dk�rd}n.|dk�rd}n|dk�r&d}ntd|f��n<|dk�rRtj
dk�rrd}n |dk�rrtj
dk�rnd}nd}|||fS) NZMACOSX_DEPLOYMENT_TARGETr-Zmacosxrcss|]}t|�VqdS)N)rC)rDrErrrrF�sz#get_platform_osx.<locals>.<genexpr>r/rr1)rGr)rGrHz-archZfatz
-arch\s+(\S+)r0)�i386�ppc)rm�x86_64Zintel)rmrnroZfat3)�ppc64roZfat64)rmrnrpro�	universalz%Don't know machine value for archs=%rrmlro)ZPowerPCZPower_Macintoshrprn)r@r9r<rIrrJr)r4�findall�sorted�setrhr�maxsize)r=Zosname�release�machineZmacverZ
macreleaser_Zarchsrrrr�sP


$





)N)r
r4r�__all__rVrRr<rr,r.r2r9r?rBrLrTrYr[r]r`rrrrrrrr�<module>s4
>(K)

?>