Your IP : 3.144.99.39


Current Path : /opt/alt/python36/lib64/python3.6/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/__pycache__/_osx_support.cpython-36.opt-2.pyc

3

��2a�J�
@s�ddlZddlZddlZddddgZd0Zd1ZdZd2dd�Zdd�Zdd�Z	da
dd�Zdd�Zdd�Z
d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d�Zd-d�Zd.d�Zd/d�ZdS)3�N�compiler_fixup�customize_config_vars�customize_compiler�get_platform_osx�CFLAGS�LDFLAGS�CPPFLAGS�
BASECFLAGS�	BLDSHARED�LDSHARED�CC�CXX�	PY_CFLAGS�
PY_LDFLAGS�PY_CPPFLAGS�PY_CORE_CFLAGS�PY_CORE_LDFLAGSZ_OSX_SUPPORT_INITIAL_cCs�|dkrtjd}|jtj�}tjj|�\}}tjdkrH|dkrH|d}tjj|�s�x*|D]"}tjj	||�}tjj|�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/python36/lib64/python3.6/_osx_support.py�_find_executables

r&cCs�ddl}yddl}|j�}Wn(tk
rDtdtj�fd�}YnX|j|��0}d||jf}tj	|�s||j
�jd�j�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
commandstringr'r(�fp�cmdr$r$r%�_read_output7sr4cCst|�ptd|f�pdS)Nz/usr/bin/xcrun -find %s�)r&r4)Ztoolnamer$r$r%�_find_build_toolJsr6cCsxtdkrtdaytd�}Wntk
r,YnHXztjd|j��}Wd|j�X|dk	rtdj|jd�j	d�dd��atS)Nr5z0/System/Library/CoreServices/SystemVersion.plistz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>�.��)
�_SYSTEM_VERSIONr*�OSError�re�searchr/�closer�groupr)r#�mr$r$r%�_get_system_versionSs

rAcCs&x t|�D]}|jt�r
||=q
WdS)N)�list�
startswith�_INITPRE)�_config_vars�kr$r$r%�_remove_original_valuesqs
rGcCs8|j|d�}||kr,t||kr,||t|<|||<dS)Nr5)�getrD)rE�cvZnewvalueZoldvaluer$r$r%�_save_modified_valuexsrJcCsTt�}|r@ytdd�|jd�D��}Wntk
r>d}YnX|rPt|dk�SdS)	Ncss|]}t|�VqdS)N)�int)�.0�ir$r$r%�	<genexpr>�sz-_supports_universal_builds.<locals>.<genexpr>r7r5�
�F)rOrP)rA�tupler�
ValueError�bool)Zosx_versionr$r$r%�_supports_universal_builds�s
rTcCs�dtjkr|S|dj�d}}t|�s4td�}n<tjj|�jd�rptd|j	dd�f�}|rpd|krptd�}|s|t
d	��||kr�xTtD]L}||kr�|tjkr�||j�}|d
kr�|n|d|d<t||dj
|��q�W|S)
NrrZclang�gccz'%s' --version�'z'"'"'zllvm-gcczCannot locate working compilerr
z++� )rrrr&r6r�basenamerCr4�replace�SystemError�_COMPILER_CONFIG_VARSrJr)rEZccZoldcc�datarIZcv_splitr$r$r%�_find_appropriate_compiler�s(


r]cCsZxTtD]L}||kr|tjkr||}tjdd|tjd�}tjdd|�}t|||�qW|S)Nz
-arch\s+\w+\srW)�flagsz-isysroot [^ 	]*)�_UNIVERSAL_CONFIG_VARSrrr<�sub�ASCIIrJ)rErIr^r$r$r%�_remove_universal_flags�s
rbcCs�dtjkr|Stjd|d�dk	r�tjd|djdd�f�}|r�x@tD]8}||krH|tjkrH||}tjdd|�}t|||�qHW|S)	Nrz-arch\s+ppcrzNecho 'int main{};' | '%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullrVz'"'"'z-arch\s+ppc\w*\srW)	rrr<r=r.rYr_r`rJ)rE�statusrIr^r$r$r%�_remove_unsupported_archs�s
	
rdcCshdtjkrdtjd}xNtD]F}||krd||kr||}tjdd|�}|d|}t|||�qW|S)N�	ARCHFLAGSz-archz
-arch\s+\w+\srW)rrr_r<r`rJ)rEZarchrIr^r$r$r%�_override_all_archss


rfcCs||jdd�}tjd|�}|dk	rx|jd�}tjj|�sxx@tD]8}||kr<|tjkr<||}tj	dd|�}t
|||�q<W|S)Nrr5z-isysroot\s+(\S+)r8z-isysroot\s+\S+(?:\s|$)rW)rHr<r=r?rr�existsr_rr`rJ)rE�cflagsr@ZsdkrIr^r$r$r%�_check_for_unavailable_sdks

ricCsXd}}t|�}t�s d}}nd|k}d|k}|s>dtjkrxx8y|jd�}|||d�=Wq@tk
rrPYq@Xq@Wdtjkr�|r�|tjdj�}|r�x8y|jd�}|||d�=Wq�tk
r�PYq�Xq�Wd}d|kr�|jd�}||d}n d|k�r|jd�}||d}|�rTtjj|��rTdd	l	m
}|jd
|�|jd�|S)NFTz-archz	-isysrootrer9r8r)�logz4Compiling with an SDK that doesn't seem to exist: %sz$Please check your Xcode installation)rBrTrr�indexrRrr�isdirZ	distutilsrj�warn)Zcompiler_soZcc_argsZ	stripArchZstripSysrootrkZsysroot�idxrjr$r$r%r0sF	






cCs"t�st|�t|�t|�|S)N)rTrbrfri)rEr$r$r%rps
cCst|�t|�t|�|S)N)r]rdrf)rEr$r$r%r�s	c
Cs||jdd�}t�p|}|p|}|�rr|}d}|jtd|jdd��}|r�y$tdd�|jd�dd	�D��}Wq�tk
r�d}Yq�Xnd}|dko�d|j�k�r6d
}tjd|�}tt	t
|���}t|�dkr�|d}n\|dkr�d
}nN|d k�r�d}n>|d!k�rd}n.|d"k�rd}n|d#k�r&d}ntd|f��n<|dk�rRtj
d$k�rrd}n |d%k�rrtj
d&k�rnd}nd}|||fS)'N�MACOSX_DEPLOYMENT_TARGETr5Zmacosxrcss|]}t|�VqdS)N)rK)rLrMr$r$r%rN�sz#get_platform_osx.<locals>.<genexpr>r7rr9rOrPz-archZfatz
-arch\s+(\S+)r8�i386�ppc�x86_64ZintelZfat3�ppc64Zfat64�	universalz%Don't know machine value for archs=%r� �PowerPC�Power_Macintosh)rOr)rOr)rOrP)rprq)rprr)rprqrr)rsrr)rprqrsrrl)rvrwl)rHrArDrQrrRr1r<�findall�sorted�set�lenr�maxsize)rE�osname�release�machineZmacverZ
macreleaserhZarchsr$r$r%r�sP


$






)
rrrr	r
rrr
rrrrr)r
rrr
)N)rr<r�__all__r_r[rDr&r4r6r:rArGrJrTr]rbrdrfrirrrrr$r$r$r%�<module>s:
>(@)

?>