Your IP : 3.145.44.46


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/_osx_support.cpython-310.opt-2.pyc

o

6��fU�@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�	|dur
tjd}|�tj�}tj�|�\}}tjdkr%|dkr%|d}tj�|�sC|D]}tj�	||�}tj�|�r@|Sq-dS|S)N�PATHZwin32z.exe)
�os�environ�split�pathsep�path�splitext�sys�platform�isfile�join)�
executabler�paths�baseZext�p�f�r�3/opt/alt/python310/lib64/python3.10/_osx_support.py�_find_executables
�rFcCs�	ddl}z
ddl}|��}Wnty"tdt��fd�}Ynw|�|��)}|r3d||jf}nd||jf}t�	|�sH|�
��d���ndWd�S1sTwYdS)Nrz/tmp/_osx_support.%szw+bz
%s >'%s' 2>&1z%s 2>/dev/null >'%s'�utf-8)
�
contextlib�tempfileZNamedTemporaryFile�ImportError�openr�getpid�closing�name�system�read�decode�strip)Z
commandstringZcapture_stderrrr �fp�cmdrrr�_read_output7s$���$�r,cCs	t|�p
td|f�p
dS)Nz/usr/bin/xcrun -find %s�)rr,)Ztoolnamerrr�_find_build_toolMs��r.cCs�	tdurAdaztddd�}Wn
tyYtSwzt�d|���}W|��n|��w|durAd�|�d��	d�dd��atS)	Nr-z0/System/Library/CoreServices/SystemVersion.plistr)�encodingz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>�.��)
�_SYSTEM_VERSIONr"�OSError�re�searchr'�closer�groupr)r�mrrr�_get_system_versionVs"	��r:cCsP	tdur&t�}|r&ztdd�|�d�D��aWtSty%daYtSwtS)Ncs��|]}t|�VqdS�N��int��.0�irrr�	<genexpr>���z,_get_system_version_tuple.<locals>.<genexpr>r0r)�_SYSTEM_VERSION_TUPLEr:�tupler�
ValueError�Zosx_versionrrr�_get_system_version_tupleus��rHcCs$	t|�D]
}|�t�r||=qdSr<)�list�
startswith�_INITPRE)�_config_vars�krrr�_remove_original_values�s
��rNcCs:	|�|d�}||krt||vr||t|<|||<dS)Nr-)�getrK)rL�cvZnewvalueZoldvaluerrr�_save_modified_value�s
rQcCs�	tdurtStd|fd�}d}|��D]*}|�d�rd}q|�d�r'd}q|r?|��}|dkr4daq|�d�r?|dd	�aqtdurFdatS)
Nz%s -c -E -v - </dev/nullTFz#include <...>zEnd of search listz/usr/include�/z.sdk/usr/includei�)�_cache_default_sysrootr,�
splitlinesrJr)�endswith)�cc�contentsZ
in_incdirs�linerrr�_default_sysroot�s(


�rYcCs	t�}|rt|dk�SdS)N��
�F)rH�boolrGrrr�_supports_universal_builds�sr^cCs	t�}|r
|dkSdS)N)�rF)rHrGrrr�_supports_arm64_builds�sr`cCs�	dtjvr|S|d��d}}t|�std�}ntj�|��d�r9td|�	dd�f�}|r9d|vr9td�}|s?t
d	��||krltD]&}||vrk|tjvrk||��}|d
kr\|n|d|d<t||d�
|��qE|S)
Nr	rZclangZgccz'%s' --version�'�'"'"'zllvm-gcczCannot locate working compilerr
z++� )rr
rrr.r�basenamerJr,�replace�SystemError�_COMPILER_CONFIG_VARSrQr)rLrVZoldcc�datarPZcv_splitrrr�_find_appropriate_compiler�s0

���ricCsX	tD]&}||vr)|tjvr)||}tjdd|tjd�}t�dd|�}t|||�q|S)N�
-arch\s+\w+\src)�flagsz-isysroot\s*\S+)�_UNIVERSAL_CONFIG_VARSrr
r5�sub�ASCIIrQ)rLrPrkrrr�_remove_universal_flagss�rocCs�	dtjvr|St�d|d�durAt�d|d�dd�f�}|rAtD]}||vr@|tjvr@||}t�dd|�}t|||�q$|S)	Nr	z-arch\s+ppcrzNecho 'int main{};' | '%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullrarbz-arch\s+ppc\w*\src)	rr
r5r6r&rerlrmrQ)rLZstatusrPrkrrr�_remove_unsupported_archss"
��	�rpcCsf	dtjvr1tjd}tD]#}||vr0d||vr0||}t�dd|�}|d|}t|||�q
|S)N�	ARCHFLAGS�-archrjrc)rr
rlr5rmrQ)rLZarchrPrkrrr�_override_all_archs:s

�rscCsz	|�dd�}t�d|�}|dur;|�d�}tj�|�s;tD]}||vr:|tjvr:||}t�	dd|�}t
|||�q|S)Nrr-z-isysroot\s*(\S+)r1z-isysroot\s*\S+(?:\s|$)rc)rOr5r6r8rr�existsrlr
rmrQ)rL�cflagsr9ZsdkrPrkrrr�_check_for_unavailable_sdkKs
�rvc	Cs�	d}}t|�}t�sd}}n
d|v}tdd�|D��}|s%dtjvr@	z|�d�}|||d�=Wn	ty=Ynwq&n#t�sctt	t
|���D]}||dkrb||dd	krb|||d�=qKdtjvrs|ss|tjd��}|r�	d
d�t|�D�}|s�n|d}||d
kr�|||d�=n|||d�=qvd}|}dd�t|�D�}|s�|}dd�t|�D�}|D]}||d
kr�||d}n||t
d
�d�}|r�tj
�|�s�tj�d|�d��tj�d�tj��|S)NFTrrcss�|]
}|�d�r|VqdS)�	-isysrootN�rJ)r@�argrrrrBys�z!compiler_fixup.<locals>.<genexpr>rqr2r1�arm64cS�g|]\}}|�d�r|�qS�rwrx�r@rA�xrrr�
<listcomp>��z"compiler_fixup.<locals>.<listcomp>rrwcSr{r|rxr}rrrr�r�cSr{r|rxr}rrrr�r�z2Compiling with an SDK that doesn't seem to exist: �
z%Please check your Xcode installation
)rIr^�anyrr
�indexrFr`�reversed�range�lenr�	enumerater�isdirr�stderr�write�flush)	Zcompiler_soZcc_argsZ	stripArchZstripSysrootr��idx�indicesZsysrootZargvarrrrrfsf

����
rcCs$	t�st|�t|�t|�|Sr<)r^rorsrv�rLrrrr�srcCs	t|�t|�t|�|Sr<)rirprsr�rrrr�s
rcCsr	|�dd�}t�p|}|p|}|r�|}d}|�td|�dd��}|rBztdd�|�d�dd	�D��}Wn
tyAd
}Ynwd
}|dkr�d|��vr�d
}t�d|�}tt	t
|���}t|�dkri|d}nK|dkrpd}nD|dkrwd
}n=|dkr~d}n6|dkr�d}n/|dkr�d}n(|dkr�d}n!td|f��|dkr�tj
dkr�d}n|dvr�tj
dkr�d }nd!}|||fS)"NZMACOSX_DEPLOYMENT_TARGETr-Zmacosxrcsr;r<r=r?rrrrB
rCz#get_platform_osx.<locals>.<genexpr>r0rr2)r[�rZrrZfatz
-arch\s+(\S+)r1)rz�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�)rOr:rKrErrFr)r5�findall�sorted�setr�r�maxsize)rLZosname�release�machineZmacverZ
macreleaseruZarchsrrrr�s^	


�$�
�
�

rr<)F)rr5r�__all__rlrgrKrr,r.r3r:rDrHrNrQrSrYr^r`rirorprsrvrrrrrrrr�<module>s<


	

>(P)

?>