Your IP : 18.117.232.108


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/_osx_support.cpython-312.opt-2.pyc

�

�Q�fV���	ddlZddlZddlZgd�ZdZdZdZdd�Zdd�Zd�Z	da
d	�Zdad
�Z
d�Zd�Zdad
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�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_LDFLAGS)rrr
r�_OSX_SUPPORT_INITIAL_c���	|�tjd}|jtj�}tjj|�\}}tjdk(r
|dk7r|dz}tjj|�sK|D]E}tjj||�}tjj|�s�C|cSy|S)N�PATH�win32z.exe)
�os�environ�split�pathsep�path�splitext�sys�platform�isfile�join)�
executabler�paths�base�ext�p�fs       �3/opt/alt/python312/lib64/python3.12/_osx_support.py�_find_executabler)s����
�|��z�z�&�!���J�J�r�z�z�"�E���� � ��,�I�D�#������c�V�m��&�(�
�
�7�7�>�>�*�%��A������Q�
�+�A��w�w�~�~�a� ���	�
���c��	ddl}	ddl}|j�}|j|�5}|r|�d|j�d�}n|�d|j�d�}tj|�s-|j�jd�j�ndcddd�S#t$r$t	dtj���d�}Y��wxYw#1swYyxYw)	Nrz/tmp/_osx_support.zw+bz >'z' 2>&1z 2>/dev/null >'�'�utf-8)
�
contextlib�tempfile�NamedTemporaryFile�ImportError�openr�getpid�closing�name�system�read�decode�strip)�
commandstring�capture_stderrr.r/�fp�cmds      r(�_read_outputr>7s���:�
�"��
�
(�
(�
*��

�	�	�B�	�2��%2�B�G�G�<�C�,9�2�7�7�C�C�8:�	�	�#��r�w�w�y����(�.�.�0�D�Q�Q��	�"�
��I�I�K�� �"��"��
 �	�s�B!�A+C�!*C�
C�Cc�B�	t|�xstd|���xsdS)Nz/usr/bin/xcrun -find �)r)r>)�toolnames r(�_find_build_toolrBMs*��:��X�&�
��X� G�H�
��r*c�l�	t�da	tdd��}	tjd|j	��}|j�|�2dj
|jd�jd�dd�atStS#|j�wxYw#t$rYtSwxYw)	Nr@z0/System/Library/CoreServices/SystemVersion.plistr-)�encodingz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>�.��)
�_SYSTEM_VERSIONr2�re�searchr7�closer!�groupr�OSError)r'�ms  r(�_get_system_versionrOVs���4�����
	F��G�RY�Z�A�
��I�I�8�9:����C�����	��}�"%�(�(�1�7�7�1�:�+;�+;�C�+@��!�+D�"E����?������	���	�
���	�s�
B"�$B
�
B�"	B3�2B3c��	t�4t�}|r(	td�|jd�D��atStS#t$r
daYtSwxYw)Nc3�2K�|]}t|����y�w�N��int��.0�is  r(�	<genexpr>z,_get_system_version_tuple.<locals>.<genexpr>�s����-U�>T��c�!�f�>T���rE�)�_SYSTEM_VERSION_TUPLErO�tupler�
ValueError��osx_versions r(�_get_system_version_tupler`usg����$�)�+���
+�(-�-U�k�>O�>O�PS�>T�-U�(U�%�!� � � ���
+�(*�%� � �
+�s�!A�A�Ac�X�	t|�D]}|jt�s�||=�yrR)�list�
startswith�_INITPRE)�_config_vars�ks  r(�_remove_original_valuesrg�s'��7�
�,�
���<�<��!��Q�� r*c�l�	|j|d�}||k7rt|z|vr||t|z<|||<y)Nr@)�getrd)re�cv�newvalue�oldvalues    r(�_save_modified_valuerm�sB��J�����B�'�H��H��8�b�=��#D�&.��X��]�#��L��r*c�8�	t�tSt|�d�d�}d}|j�D]\}|jd�rd}�|jd�rd}�+|s�.|j	�}|dk(rda�F|jd�s�X|dd	a�^t�datS)
Nz -c -E -v - </dev/nullTFz#include <...>zEnd of search listz/usr/include�/z.sdk/usr/includei�)�_cache_default_sysrootr>�
splitlinesrcr9�endswith)�cc�contents�
in_incdirs�lines    r(�_default_sysrootrw�s���G��)�%�%��"�>��E�H��J��#�#�%���?�?�+�,��J�
�_�_�1�
2��J�
��:�:�<�D��~�%�),�&����1�2�)-�d�s��&�&��%�!$��!�!r*c�<�	t�}|rt|dk\�SdS)N��
�F)r`�boolr^s r(�_supports_universal_buildsr}�s&��G�,�-�K�+6�4��w�&�'�A�E�Ar*c�*�	t�}|r|dk\SdS)N)�rF)r`r^s r(�_supports_arm64_buildsr��s!��C�
,�-�K�%0�;�'�!�;�e�;r*c�0�	dtjvr|S|dj�dx}}t|�st	d�}n^tj
j
|�jd�r0td|jdd��d��}|rd|vrt	d�}|std	��||k7ratD]X}||vs�|tjvs�||j�}|d
k7r|n|dz|d<t||dj|���Z|S)
Nr
r�clang�gccr,�'"'"'z' --versionzllvm-gcczCannot locate working compilerrz++� )rrrr)rBr�basenamercr>�replace�SystemError�_COMPILER_CONFIG_VARSrmr!)rers�oldcc�datarj�cv_splits      r(�_find_appropriate_compilerr��s��A� �r�z�z�����d�#�)�)�+�A�.�.�B���B���g�
&��	���	�	�"�	�	(�	(��	/�� "�
�
�3�	� :�=�>���J�$�&�!�'�*�B�
��/�1�	1�
�U�{�(�B��\�!�b��
�
�&:�'��+�1�1�3��$&�%�K�b�R�$�Y����$�\�2�s�x�x��7I�J�	(��r*c���	tD]j}||vs�|tjvs�||}tjdd|tj
��}tjdd|�}t
|||��l|S)N�
-arch\s+\w+\sr�)�flagsz-isysroot\s*\S+)�_UNIVERSAL_CONFIG_VARSrrrI�sub�ASCIIrm)rerjr�s   r(�_remove_universal_flagsr�sl��?�$��
���"�B�J�J�"6� ��$�E��F�F�+�S�%�r�x�x�H�E��F�F�-�s�E�:�E� ��r�5�9�
%��r*c�V�	dtjvr|Stjd|d��ztjd|djdd��d��}|rLtD]C}||vs�|tjvs�||}tjdd	|�}t|||��E|S)
Nr
z-arch\s+ppcrzecho 'int main{};' | 'r,r�z6' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullz-arch\s+ppc\w*\sr�)	rrrIrJr6r�r�r�rm)re�statusrjr�s    r(�_remove_unsupported_archsr�s���7��r�z�z����	�y�y���h�!7�8�D�����4� �(�(��i�8�
;�<���-����%�"�B�J�J�*>�(��,�E��F�F�#6��U�C�E�(��r�5�A�	-��r*c���	dtjvr\tjd}tD]@}||vs�d||vs�||}tjdd|�}|dz|z}t|||��B|S)N�	ARCHFLAGS�-archr�r�)rrr�rIr�rm)re�archrjr�s    r(�_override_all_archsr�:s~��<��b�j�j� ��z�z�+�&��(�B��\�!�g��b�1A�&A�$�R�(�����/��e�<�����d�*��$�\�2�u�=�)��r*c�T�	|jdd�}tjd|�}|�||jd�}tj
j
|�sLtD]C}||vs�|tjvs�||}tjdd|�}t|||��E|S)Nrr@z-isysroot\s*(\S+)rFz-isysroot\s*\S+(?:\s|$)r�)rirIrJrLrr�existsr�rr�rm)re�cflagsrN�sdkrjr�s      r(�_check_for_unavailable_sdkr�Ks���5��
�
�h��
+�F�
�	�	�&��/�A��}��g�g�a�j���w�w�~�~�c�"�,����%�"�B�J�J�*>�(��,�E��F�F�#=�s�E�J�E�(��r�5�A�-��r*c���	dx}}t|�}t�sdx}}nd|v}td�|D��}|sdtjvr		|jd�}|||dz�=�t�s?ttt|���D]}||dk(s�||dzdk(s�|||dz�=�!dtjvr&|s$|tjdj�z}|rR	t|�D��cgc]\}}|jd	�s�|��}}}|sn|d
}||d	k(r	|||dz�=n|||dz�=�Qd}	|}
t|�D��cgc]\}}|jd	�s�|��}}}|s1|}
t|�D��cgc]\}}|jd	�s�|��}}}|D]&}|
|d	k(r
|
|dz}	n|
|td	�d}	n|	rtjj|	�s`t j"j%d|	�d��t j"j%d
�t j"j'�|S#t$rY���wxYwcc}}wcc}}wcc}}w)NFTr�c3�DK�|]}|jd�s�|���y�w)�	-isysrootN)rc)rV�args  r(rXz!compiler_fixup.<locals>.<genexpr>ys����Q�'�3�S�^�^�K�5P�3�'�s� � r�rGrF�arm64r�rz2Compiling with an SDK that doesn't seem to exist: �
z%Please check your Xcode installation
)rbr}�anyrr�indexr]r��reversed�range�lenr�	enumeratercr�isdirr�stderr�write�flush)�compiler_so�cc_args�	stripArch�stripSysrootr��idxrW�x�indices�sysroot�argvars           r(rrfs���� %�$�I���{�#�K�%�'�$(�'�	�L��w�&�	��Q�'�Q�Q���K�2�:�:�-��
�#�)�)�'�2����e�A�g�
�.�	�$�
%��E�#�k�"2�3�4�C��3��7�*�{�3�q�5�/A�W�/L���C��E�	�*�5��b�j�j� ��"�B�J�J�{�$;�$A�$A�$C�C����$-�k�$:�X�$:�S�Q�q�a�l�l�;�>W�q�$:�G�X����A�J�E��5�!�[�0���e�A�g�
�.� ��e�A�g�
�.���G�
�F�%�g�.�L�.�S�Q�q�!�,�,�{�2K�q�.�G�L���� )�+� 6�T� 6���1�!�,�,�{�:S�1� 6��T����#�;�+�%��S��U�m�G���S�k�#�k�"2�"3�4�G��
��r�w�w�}�}�W�-��
�
���M�g�Y�VX�Y�Z��
�
���A�B��
�
�������e�
��
�� Y�� M��Us6�I�8I�I�
I%�'I%�I+�I+�	I�Ic�^�	t�st|�t|�t|�|SrR)r}r�r�r��res r(rr�s3���0&�'�
	 ��-���%��|�,��r*c�J�	t|�t|�t|�|SrR)r�r�r�r�s r(rr�s+����|�,��l�+���%��r*c���	|jdd�}|r	d|vr|dz
}t�xs|}|xs|}|�r,|}d}|jtdz|jdd��}|r&	td�|j	d�dd	D��}nd
}|dk\r�d|j
�vr�d
}tjd|�}ttt|���}t|�dk(r|d}nu|dk(rd}nm|dk(rd
}ne|dk(rd}n]|dk(rd}nU|dk(rd}nM|dk(rd}nEtd|����|dk(rtjdk\rd}n|dvrtjdk\rd }nd!}|||fS#t
$rd
}Y��wxYw)"N�MACOSX_DEPLOYMENT_TARGETr@rEz.0�macosxrc3�2K�|]}t|����y�wrRrSrUs  r(rXz#get_platform_osx.<locals>.<genexpr>s����"N�3M�a�3�q�6�3M�rYrrG)rz�ryr��fatz
-arch\s+(\S+)rF)r��x86_64�
universal2)�i386�ppc)r�r��intel)r�r�r��fat3)�ppc64r��fat64)r�r�r�r��	universalz#Don't know machine value for archs=r�lr�)�PowerPC�Power_Macintoshr�r�)rirOrdr\rr]r9rI�findall�sorted�setr�r�maxsize)re�osname�release�machine�macver�
macreleaser��archss        r(rr�s���*��
�
�8�"�
=�F�
�#�V�#�	�$���$�&�0�&�J�
�
!�z�F�
������!�!�(�8�"3�$0�$4�$4�X�r�$B�D���
%�"�"N�:�3C�3C�C�3H��1�3M�"N�N�
�
!�J��'�!�w�&�,�,�.�'@��G��J�J�/��8�E��&��U��,�-�E��5�z�Q����(���-�-�&���/�)����,�,�!���3�3� ���-�-�!���<�<�%�� �>C�E�G�G���
��{�{�e�#�"��
�6�
6��{�{�e�#�!�����G�W�%�%��a�
%�$�
�
%�s�&$E'�'E5�4E5rR)F)rrIr�__all__r�r�rdr)r>rBrHrOr[r`rgrmrprwr}r�r�r�r�r�r�rrrrrZr*r(�<module>r�s���$�	�	�
���A��?��#���4Q�,����<��!�& � ���"�2B�<�;�|�%�P�"�6M�`&�R�(P&r*

?>