Your IP : 18.116.24.148


Current Path : /opt/alt/python35/lib64/python3.5/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/__pycache__/_osx_support.cpython-35.opt-2.pyc



���]�J�@sddlZddlZddlZddddgZd/Zd0ZdZddd�Zdd�Zdd�Z	da
dd�Zdd�Zdd�Z
dd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d�Zd,d�Zd-d�Zd.d�ZdS)1�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_CFLAGSZ_OSX_SUPPORT_INITIAL_cCs�|dkrtjd}|jtj�}tjj|�\}}tjdkrh|dkrh|d}tjj|�s�x9|D]1}tjj	||�}tjj|�r�|Sq�WdS|SdS)N�PATH�win32z.exe)
�os�environ�split�pathsep�path�splitext�sys�platform�isfile�join)�
executabler�paths�base�ext�p�f�r$�1/opt/alt/python35/lib64/python3.5/_osx_support.py�_find_executables


r&cCs�ddl}yddl}|j�}Wn.tk
rXtdtj�fd�}YnX|j|��F}d||jf}tj	|�s�|j
�jd�j�SdSWdQRXdS)Nrz/tmp/_osx_support.%szw+bz%s 2>/dev/null >'%s'zutf-8)
�
contextlib�tempfile�NamedTemporaryFile�ImportError�openr�getpid�closing�name�system�read�decode�strip)Z
commandstringr'r(�fp�cmdr$r$r%�_read_output7s
r5cCs#t|�p"td|f�p"dS)Nz/usr/bin/xcrun -find %s�)r&r5)Ztoolnamer$r$r%�_find_build_toolJsr7cCs�tdkr�daytd�}Wntk
r6YnbXztjd|j��}Wd|j�X|dk	r�dj|jd�j	d�dd��atS)Nr6z0/System/Library/CoreServices/SystemVersion.plistz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>�.��)
�_SYSTEM_VERSIONr+�OSError�re�searchr0�closer�groupr)r#�mr$r$r%�_get_system_versionSs

	+rBcCs1x*t|�D]}|jt�r
||=q
WdS)N)�list�
startswith�_INITPRE)�_config_vars�kr$r$r%�_remove_original_valuesqsrHcCsJ|j|d�}||kr<t||kr<||t|<|||<dS)Nr6)�getrE)rF�cvZnewvalueZoldvaluer$r$r%�_save_modified_valuexsrKcCsjt�}|rPy&tdd�|jd�D��}Wntk
rOd}YnX|rft|dk�SdS)	Ncss|]}t|�VqdS)N)�int)�.0�ir$r$r%�	<genexpr>�sz-_supports_universal_builds.<locals>.<genexpr>r8r6�
�F)rPrQ)rB�tupler�
ValueError�bool)Zosx_versionr$r$r%�_supports_universal_builds�s	&
rUcCs5dtjkr|S|dj�d}}t|�sFtd�}nXtjj|�jd�r�td|j	dd�f�}|r�d|kr�td�}|s�t
d	��||kr1xrtD]j}||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&r7r�basenamerDr5�replace�SystemError�_COMPILER_CONFIG_VARSrKr)rFZccZoldcc�datarJZcv_splitr$r$r%�_find_appropriate_compiler�s(	
 r^cCs}xvtD]n}||kr|tjkr||}tjdd|dtj�}tjdd|�}t|||�qW|S)Nz
-arch\s+\w+\srX�flagsz-isysroot [^ 	]*)�_UNIVERSAL_CONFIG_VARSrrr=�sub�ASCIIrK)rFrJr_r$r$r%�_remove_universal_flags�s

rccCs�dtjkr|Stjd|d�dk	r�tjd|djdd�f�}|r�xXtD]P}||krb|tjkrb||}tjdd|�}t|||�qbW|S)	Nrz-arch\s+ppcrzNecho 'int main{};' | '%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullrWz'"'"'z-arch\s+ppc\w*\srX)	rrr=r>r/rZr`rarK)rF�statusrJr_r$r$r%�_remove_unsupported_archs�s	

recCs�dtjkr�tjd}xgtD]_}||kr#d||kr#||}tjdd|�}|d|}t|||�q#W|S)N�	ARCHFLAGSz-archz
-arch\s+\w+\srX)rrr`r=rarK)rFZarchrJr_r$r$r%�_override_all_archss


rgcCs�|jdd�}tjd|�}|dk	r�|jd�}tjj|�s�xXtD]P}||krX|tjkrX||}tj	dd|�}t
|||�qXW|S)Nrr6z-isysroot\s+(\S+)r9z-isysroot\s+\S+(?:\s|$)rX)rIr=r>r@rr�existsr`rrarK)rF�cflagsrAZsdkrJr_r$r$r%�_check_for_unavailable_sdks

rjcCs�d}}t|�}t�s,d}}nd|k}d|k}|sYdtjkr�x>y$|jd�}|||d�=Wq\tk
r�PYq\Xq\Wdtjkr�|r�|tjdj�}|rx>y$|jd�}|||d�=Wq�tk
r	PYq�Xq�Wd}d|kr@|jd�}||d}n)d|kri|jd�}||d}|r�tjj|�r�dd	l	m
}|jd
|�|jd�|S)NFTz-archz	-isysrootrfr:r9r)�logz4Compiling with an SDK that doesn't seem to exist: %sz$Please check your Xcode installation)rCrUrr�indexrSrr�isdirZ	distutilsrk�warn)Zcompiler_soZcc_argsZ	stripArchZstripSysrootrlZsysroot�idxrkr$r$r%r0sF	
	




	
cCs+t�st|�t|�t|�|S)N)rUrcrgrj)rFr$r$r%rps
	


cCs"t|�t|�t|�|S)N)r^rerg)rFr$r$r%r�s	


c
Cs|jdd�}t�p|}|p*|}|r�|}d}|jtd|jdd��}|r�y0tdd�|jd�dd	�D��}Wq�tk
r�d}Yq�Xnd}|dkr�d|j�kr�d
}tjd|�}tt	t
|���}t|�dkr(|d}q�|dkr=d
}q�|d krRd}q�|d!krgd}q�|d"kr|d}q�|d#kr�d}q�td|f��nN|dkr�tj
d$kr�d}n*|d%kr�tj
d&kr�d}nd}|||fS)'N�MACOSX_DEPLOYMENT_TARGETr6Zmacosxrcss|]}t|�VqdS)N)rL)rMrNr$r$r%rO�sz#get_platform_osx.<locals>.<genexpr>r8rr:rPrQz-archZfatz
-arch\s+(\S+)r9�i386�ppc�x86_64ZintelZfat3�ppc64Zfat64�	universalz%Don't know machine value for archs=%r� �PowerPC�Power_Macintosh)rPr)rPr)rPrQ)rqrr)rqrs)rqrrrs)rtrs)rqrrrtrsl)rwrxl)rIrBrErRrrSr2r=�findall�sorted�set�lenr�maxsize)rF�osname�release�machineZmacverZ
macreleaseriZarchsr$r$r%r�sP

0

							)rrrr	r
rrr
rrrr)r
rrr
)rr=r�__all__r`r\rEr&r5r7r;rBrHrKrUr^rcrergrjrrrrr$r$r$r%�<module>s:	>(@)

?>