Your IP : 18.117.184.236


Current Path : /opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/__pycache__/_osx_support.cpython-311.opt-2.pyc

�

c��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�ZdS)�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}|�tj��}tj�|��\}}tjdkr|dkr|dz}tj�|��sJ|D]E}tj�	||��}tj�|��r|cS�FdS|S)N�PATH�win32z.exe)
�os�environ�split�pathsep�path�splitext�sys�platform�isfile�join)�
executabler�paths�base�ext�p�fs       �3/opt/alt/python311/lib64/python3.11/_osx_support.py�_find_executabler)s����
�|��z�&�!���J�J�r�z�"�"�E��� � ��,�,�I�D�#������c�V�m�m��&�(�
�
�7�>�>�*�%�%���	�	�A�����Q�
�+�+�A��w�~�~�a� � �
�����
��t���Fc���	ddl}	ddl}|���}n4#t$r't	dtj����d��}YnwxYw|�|��5}|r|�d|j�d�}n
|�d|j�d�}tj	|��s9|�
���d�����ndcddd��S#1swxYwYdS)	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>7sk��:�
����"�����
�
(�
(�
*�
*�����"�"�"�
�T��I�K�K�K�� �"�"����"����
�	�	�B�	�	�Q�2��	D�%2�]�]�B�G�G�G�<�C�C�,9�M�M�2�7�7�7�C�C�8:�	�#���P�r�w�w�y�y����(�(�.�.�0�0�0�D�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q����Q�Q�Q�Q�Q�Qs"� �.A�A�)A,C"�"C&�)C&c�J�	t|��ptd|����pdS)Nz/usr/bin/xcrun -find �)r)r>)�toolnames r(�_find_build_toolrBMs4��:��X�&�&�
��<�X�X� G�H�H�
��r*c��	t��da	tdd���}	tjd|�����}|���n#|���wxYw|�Cd�|�d���d��dd���an#t$rYnwxYwtS)	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�Z�Z�A�
��I�8�9:�����C�C�����	�	�	�	�����	�	�	�	�����}�"%�(�(�1�7�7�1�:�:�+;�+;�C�+@�+@��!��+D�"E�"E�����	�	�	�
�D�	�����s�B9�'A�A0�9
C�Cc��	t�Pt��}|r@	td�|�d��D����an#t$rdaYnwxYwtS)Nc3�4K�|]}t|��V��dS�N��int��.0�is  r(�	<genexpr>z,_get_system_version_tuple.<locals>.<genexpr>�s(����-U�-U��c�!�f�f�-U�-U�-U�-U�-U�-Ur*rE�)�_SYSTEM_VERSION_TUPLErO�tupler�
ValueError��osx_versions r(�_get_system_version_tupler_us�����$�)�+�+���	+�
+�(-�-U�-U�k�>O�>O�PS�>T�>T�-U�-U�-U�(U�(U�%�%���
+�
+�
+�(*�%�%�%�
+����!� s�,A�A�Ac�f�	t|��D]}|�t��r||=� dSrR)�list�
startswith�_INITPRE)�_config_vars�ks  r(�_remove_original_valuesrf�sB��7�
�,�
�
� � ���<�<��!�!�	 ��Q��� � r*c�|�	|�|d��}||krt|z|vr
||t|z<|||<dS)Nr@)�getrc)rd�cv�newvalue�oldvalues    r(�_save_modified_valuerl�sQ��J�����B�'�'�H��H���8�b�=��#D�#D�&.��X��]�#��L����r*c�t�	t�tSt|�d�d��}d}|���D]p}|�d��rd}�|�d��rd}�2|r<|���}|dkrda�Q|�d��r
|dd	�a�qt�datS)
Nz -c -E -v - </dev/nullTFz#include <...>zEnd of search listz/usr/include�/z.sdk/usr/includei�)�_cache_default_sysrootr>�
splitlinesrbr9�endswith)�cc�contents�
in_incdirs�lines    r(�_default_sysrootrv�s���G��)�%�%��"�"�"�>��E�E�H��J��#�#�%�%�
4�
4���?�?�+�,�,�		4��J�J�
�_�_�1�
2�
2�	4��J�J�
�	4��:�:�<�<�D��~�%�%�),�&�&����1�2�2�
4�)-�d�s�d��&���%�!$��!�!r*c�N�	t��}|rt|dk��ndS)N��
�F)r_�boolr]s r(�_supports_universal_buildsr|�s/��G�,�-�-�K�+6�A�4��w�&�'�'�'�E�Ar*c�4�	t��}|r|dkndS)N)�rF)r_r]s r(�_supports_arm64_buildsr�s'��C�
,�-�-�K�%0�;�;�'�!�!�e�;r*c��	dtjvr|S|d���dx}}t|��st	d��}nntj�|���d��r<td|�	dd���d���}|rd|vrt	d��}|std	���||krjtD]b}||vr\|tjvrN||���}|d
kr|n|dz|d<t||d�
|�����c|S)
Nr
r�clang�gccr,�'"'"'z' --versionzllvm-gcczCannot locate working compilerrz++� )rrrr)rBr�basenamerbr>�replace�SystemError�_COMPILER_CONFIG_VARSrlr!)rdrr�oldcc�datari�cv_splits      r(�_find_appropriate_compilerr��su��A� �r�z������d�#�)�)�+�+�A�.�.�B���B���+��g�
&�
&���	��	�	�"�	�	�	(�	(��	/�	/�+��|� "�
�
�3�	� :� :� :� :�=�>�>���	+�J�$�&�&�!�'�*�*�B�
�1��/�1�1�	1�
�U�{�{�(�	K�	K�B��\�!�!�b��
�&:�&:�'��+�1�1�3�3��$&�%�K�K�b�b�R�$�Y����$�\�2�s�x�x��7I�7I�J�J�J���r*c���	tD]e}||vr_|tjvrQ||}tjdd|tj���}tjdd|��}t
|||���f|S)N�
-arch\s+\w+\sr�)�flagsz-isysroot\s*\S+)�_UNIVERSAL_CONFIG_VARSrrrI�sub�ASCIIrl)rdrir�s   r(�_remove_universal_flagsr�s}��?�$�:�:��
����"�B�J�"6�"6� ��$�E��F�+�S�%�r�x�H�H�H�E��F�-�s�E�:�:�E� ��r�5�9�9�9���r*c�\�	dtjvr|Stjd|d���tjd|d�dd���d���}|rKtD]C}||vr=|tjvr/||}tjdd	|��}t|||���D|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�rl)rd�statusrir�s    r(�_remove_unsupported_archsr�s���7��r�z�����	�y���h�!7�8�8�D�����4� �(�(��i�8�8�8�8�
;�<�<���
	B�-�
B�
B����%�%�"�B�J�*>�*>�(��,�E��F�#6��U�C�C�E�(��r�5�A�A�A���r*c���	dtjvratjd}tD]G}||vrAd||vr7||}tjdd|��}|dz|z}t|||���H|S)N�	ARCHFLAGS�-archr�r�)rrr�rIr�rl)rd�archrir�s    r(�_override_all_archsr�:s���<��b�j� � ��z�+�&��(�	>�	>�B��\�!�!�g��b�1A�&A�&A�$�R�(����/��e�<�<�����d�*��$�\�2�u�=�=�=���r*c�`�	|�dd��}tjd|��}|�|�d��}tj�|��sKtD]C}||vr=|tjvr/||}tj	dd|��}t|||���D|S)Nrr@z-isysroot\s*(\S+)rFz-isysroot\s*\S+(?:\s|$)r�)rhrIrJrLrr�existsr�rr�rl)rd�cflagsrN�sdkrir�s      r(�_check_for_unavailable_sdkr�Ks���5��
�
�h��
+�
+�F�
�	�&��/�/�A��}��g�g�a�j�j���w�~�~�c�"�"�	B�,�
B�
B����%�%�"�B�J�*>�*>�(��,�E��F�#=�s�E�J�J�E�(��r�5�A�A�A���r*c��	dx}}t|��}t��sdx}}nd|v}td�|D����}|sdtjvr2		|�d��}|||dz�=n#t$rYnwxYw�0n]t��sOttt|������D]%}||dkr||dzdkr|||dz�=�&dtjvr)|s'|tjd���z}|rC	d	�t|��D��}|sn&|d
}||dkr	|||dz�=n|||dz�=�Bd}|}d�t|��D��}|s|}d
�t|��D��}|D]8}||dkr
||dz}n||td��d�}|rtj
�|��s`tj�d|�d���tj�d��tj���|S)NFTr�c3�DK�|]}|�d���|V��dS)�	-isysrootN�rb)rV�args  r(rXz!compiler_fixup.<locals>.<genexpr>ys3����Q�Q�3�S�^�^�K�5P�5P�Q�3�Q�Q�Q�Q�Q�Qr*r�rGrF�arm64c�B�g|]\}}|�d���|��S�r�r��rVrW�xs   r(�
<listcomp>z"compiler_fixup.<locals>.<listcomp>�s-��X�X�X�S�Q�q�a�l�l�;�>W�>W�X�q�X�X�Xr*rr�c�B�g|]\}}|�d���|��Sr�r�r�s   r(r�z"compiler_fixup.<locals>.<listcomp>�s-��L�L�L�S�Q�q�!�,�,�{�2K�2K�L�q�L�L�Lr*c�B�g|]\}}|�d���|��Sr�r�r�s   r(r�z"compiler_fixup.<locals>.<listcomp>�s-��T�T�T���1�!�,�,�{�:S�:S�T�1�T�T�Tr*z2Compiling with an SDK that doesn't seem to exist: �
z%Please check your Xcode installation
)rar|�anyrr�indexr\r�reversed�range�lenr�	enumerater�isdirr�stderr�write�flush)	�compiler_so�cc_args�	stripArch�stripSysrootr��idx�indices�sysroot�argvars	         r(rrfs���� %�$�I���{�#�#�K�%�'�'�R�$(�'�	�L�L��w�&�	��Q�Q�'�Q�Q�Q�Q�Q���
+�K�2�:�-�-�	�
�#�)�)�'�2�2����e�A�g�
�.�.���
�
�
���
����	��
#�
%�
%�+��E�#�k�"2�"2�3�3�4�4�	+�	+�C��3��7�*�*�{�3�q�5�/A�W�/L�/L���C��E�	�*���b�j� � �� �"�B�J�{�$;�$A�$A�$C�$C�C���/�
	/�X�X�I�k�$:�$:�X�X�X�G��
���A�J�E��5�!�[�0�0���e�A�g�
�.�.� ��e�A�g�
�.�
	/��G�
�F�L�L�I�g�.�.�L�L�L�G��U���T�T�	�+� 6� 6�T�T�T�������#�;�+�%�%��S��U�m�G��E��S�k�#�k�"2�"2�"3�"3�4�G����r�w�}�}�W�-�-���
���Y�g�Y�Y�Y�Z�Z�Z��
���A�B�B�B��
�������s�A5�5
B�Bc�~�	t��st|��t|��t|��|SrR)r|r�r�r��rds r(rr�sM���0&�'�'�.�
	 ��-�-�-���%�%�%��|�,�,�,��r*c�b�	t|��t|��t|��|SrR)r�r�r�r�s r(rr�s=����|�,�,�,��l�+�+�+���%�%�%��r*c�f�	|�dd��}|r	d|vr|dz
}t��p|}|p|}|�rt|}d}|�tdz|�dd����}|rH	td�|�d��dd	�D����}n#t
$rd
}YnwxYwd
}|dkr�d|���vr�d
}tjd|��}ttt|������}t|��dkr	|d}nz|dkrd}nq|dkrd
}nh|dkrd}n_|dkrd}nV|dkrd}nM|dkrd}nDtd|�����|dkrtj
dkrd}n|dvrtj
dkrd }nd!}|||fS)"N�MACOSX_DEPLOYMENT_TARGETr@rEz.0�macosxrc3�4K�|]}t|��V��dSrRrSrUs  r(rXz#get_platform_osx.<locals>.<genexpr>s(����"N�"N�a�3�q�6�6�"N�"N�"N�"N�"N�"Nr*rrG)ry�rxr��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�)rhrOrcr[rr\r9rI�findall�sorted�setr�r�maxsize)rd�osname�release�machine�macver�
macreleaser��archss        r(rr�sW��*��
�
�8�"�
=�
=�F�
��#�V�#�#�	�$���$�&�&�0�&�J�
�
!�z�F�
�; ������!�!�(�8�"3�$0�$4�$4�X�r�$B�$B�D�D���	!�
%�"�"N�"N�:�3C�3C�C�3H�3H��1��3M�"N�"N�"N�N�N�
�
���
%�
%�
%�$�
�
�
�
%����!�J��'�!�!�w�&�,�,�.�.�'@�'@��G��J�/��8�8�E��&��U���,�,�-�-�E��5�z�z�Q�����(����-�-�-�&����/�)�)�����,�,�,�!����3�3�3� ����-�-�-�!����<�<�<�%��� �j�>C�e�E�G�G�G���
�
��{�e�#�#�"���
�6�
6�
6��{�e�#�#�!������G�W�%�%s�34B(�(B7�6B7rR)F)rrIr�__all__r�r�rcr)r>rBrHrOrZr_rfrlrorvr|rr�r�r�r�r�rrrrrYr*r(�<module>r�s���$�	�	�	�	�	�	�	�	�
�
�
�
�����A��?��#������4Q�Q�Q�Q�,��������<��!�!�!�& � � � � � ���"�"�"�2B�B�B�<�<�<�;�;�;�|���%�%�%�P���"���6M�M�M�`&�&�&�R���(P&�P&�P&�P&�P&r*

?>