%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.12/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.12/__pycache__/_osx_support.cpython-312.pyc

�

���fV���dZddlZddlZddlZgd�ZdZdZdZdd�Zdd�Z	d	�Z
dad
�Zda
d�Zd�Zd
�Zdad�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)zShared OS X support functions.�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)z�Tries to find 'executable' in the directories listed in 'path'.

    A string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH'].  Returns the complete filename or None if not found.
    N�PATH�win32z.exe)
�os�environ�split�pathsep�path�splitext�sys�platform�isfile�join)�
executabler�paths�base�ext�p�fs       �#/usr/lib/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)
z0Output from successful command execution or NonerNz/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�	�Q�2��%2�B�G�G�<�C�,9�2�7�7�C�C�8:�	�	�#��r�w�w�y����(�.�.�0�D�Q�Q��	�"�
��I�I�K�� �"��"��Q�Q�s�B �A+C� *C
�C
�Cc�@�t|�xstd|���xsdS)z0Find a build tool on current path or using xcrunz/usr/bin/xcrun -find �)r)r>)�toolnames r(�_find_build_toolrBMs'���X�&�
��X� G�H�
��r*c�j�t�da	tdd��}	tjd|j	��}|j�|�2dj
|jd�jd�dd	�atStS#|j�wxYw#t$rYtSwxYw)
z*Return the OS X system version as a stringNr@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�������
	F��G�RY�Z�A�
��I�I�8�9:����C�����	��}�"%�(�(�1�7�7�1�:�+;�+;�C�+@��!�+D�"E����?������	���	�
���	�s�
B!�$B�B�!	B2�1B2c��t�4t�}|r(	td�|jd�D��atStS#t$r
daYtSwxYw)z}
    Return the macOS system version as a tuple

    The return value is safe to use to compare
    two version numbers.
    c3�2K�|]}t|����y�w�N��int��.0�is  r(�	<genexpr>z,_get_system_version_tuple.<locals>.<genexpr>�s����-U��c�!�f�-U���rE�)�_SYSTEM_VERSION_TUPLErO�tupler�
ValueError��osx_versions r(�_get_system_version_tupler`usb���$�)�+���
+�(-�-U�k�>O�>O�PS�>T�-U�(U�%�!� � � ���
+�(*�%� � �
+�s�!A�A�Ac�V�t|�D]}|jt�s�||=�y)z-Remove original unmodified values for testingN)�list�
startswith�_INITPRE)�_config_vars�ks  r(�_remove_original_valuesrg�s+���,�
� ���<�<��!��Q�� r*c�j�|j|d�}||k7rt|z|vr||t|z<|||<y)z@Save modified and original unmodified value of configuration varr@N)�getrd)re�cv�newvalue�oldvalues    r(�_save_modified_valuerm�sA������B�'�H��H��8�b�=��#D�&.��X��]�#��L��r*c�6�t�tSt|�d�d�}d}|j�D]\}|jd�rd}�|jd�rd}�+|s�.|j	�}|dk(rda�F|jd	�s�X|dd
a�^t�datS)z= Returns the root of the default SDK for this system, or '/' 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����)�%�%��"�>��E�H��J��#�#�%�
4���?�?�+�,��J�
�_�_�1�
2��J�
��:�:�<�D��~�%�),�&����1�2�)-�d�s��&�
4��%�!$��!�!r*c�:�t�}|rt|dk\�SdS)z=Returns True if universal builds are supported on this system��
�F)r`�boolr^s r(�_supports_universal_buildsr}�s#��,�-�K�+6�4��w�&�'�A�E�Ar*c�(�t�}|r|dk\SdS)z9Returns True if arm64 builds are supported on this system)�rF)r`r^s r(�_supports_arm64_buildsr��s��,�-�K�%0�;�'�!�;�e�;r*c�.�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)
z7Find appropriate C compiler for extension module buildsr
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��"�r�z�z�����d�#�)�)�+�A�.�.�B���B���g�
&��	���	�	�"�	�	(�	(��	/�� "�
�
�3�	� :�=�>���J�$�&�!�'�*�B�
��/�1�	1�
�U�{�(�	K�B��\�!�b��
�
�&:�'��+�1�1�3��$&�%�K�b�R�$�Y����$�\�2�s�x�x��7I�J�		K��r*c���tD]j}||vs�|tjvs�||}tjdd|tj
��}tjdd|�}t
|||��l|S)z5Remove all universal build arguments from config vars�
-arch\s+\w+\sr�)�flagsz-isysroot\s*\S+)�_UNIVERSAL_CONFIG_VARSrrrI�sub�ASCIIrm)rerjr�s   r(�_remove_universal_flagsr�sp��%�:��
���"�B�J�J�"6� ��$�E��F�F�+�S�%�r�x�x�H�E��F�F�-�s�E�:�E� ��r�5�9�
:��r*c�T�dtjvr|Stjd|d��ztjd|djdd��d��}|rLtD]C}||vs�|tjvs�||}tjdd	|�}t|||��E|S)
z-Remove any unsupported archs from config varsr
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����r�z�z����	�y�y���h�!7�8�D�����4� �(�(��i�8�
;�<���-�
B����%�"�B�J�J�*>�(��,�E��F�F�#6��U�C�E�(��r�5�A�	
B��r*c���dtjvr\tjd}tD]@}||vs�d||vs�||}tjdd|�}|dz|z}t|||��B|S)z2Allow override of all archs with ARCHFLAGS env var�	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�R�|jdd�}tjd|�}|�||jd�}tj
j
|�sLtD]C}||vs�|tjvs�||}tjdd|�}t|||��E|S)z+Remove references to any SDKs not availablerr@z-isysroot\s*(\S+)rFz-isysroot\s*\S+(?:\s|$)r�)rirIrJrLrr�existsr�rr�rm)re�cflagsrN�sdkrjr�s      r(�_check_for_unavailable_sdkr�Ks����
�
�h��
+�F�
�	�	�&��/�A��}��g�g�a�j���w�w�~�~�c�"�,�
B����%�"�B�J�J�*>�(��,�E��F�F�#=�s�E�J�E�(��r�5�A�
B��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)ae
    This function will strip '-isysroot PATH' and '-arch ARCH' from the
    compile flags if the user has specified one them in extra_compile_flags.

    This is needed because '-arch ARCH' adds another architecture to the
    build, without a way to remove an architecture. Furthermore GCC will
    barf if multiple '-isysroot' arguments are present.
    FTr�c3�DK�|]}|jd�s�|���y�w)�	-isysrootN)rc)rV�args  r(rXz!compiler_fixup.<locals>.<genexpr>ys����Q�3�S�^�^�K�5P�3�Q�s� � r�rGrF�arm64r�rNz2Compiling 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�	�*�	+��b�j�j� ��"�B�J�J�{�$;�$A�$A�$C�C����$-�k�$:�X�S�Q�q�a�l�l�;�>W�q�X�G�X����A�J�E��5�!�[�0���e�A�g�
�.� ��e�A�g�
�.���G�
�F�%�g�.�L�S�Q�q�!�,�,�{�2K�q�L�G�L���� )�+� 6�T���1�!�,�,�{�:S�1�T��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�7I�I�I$�&I$�?I*�I*�	I�Ic�\�t�st|�t|�t|�|S)a�Customize Python build configuration variables.

    Called internally from sysconfig with a mutable mapping
    containing name/value pairs parsed from the configured
    makefile used to build this interpreter.  Returns
    the mapping updated as needed to reflect the environment
    in which the interpreter is running; in the case of
    a Python from a binary installer, the installed
    environment may be very different from the build
    environment, i.e. different OS levels, different
    built tools, different available CPU architectures.

    This customization is performed whenever
    distutils.sysconfig.get_config_vars() is first
    called.  It may be used in environments where no
    compilers are present, i.e. when installing pure
    Python dists.  Customization of compiler paths
    and detection of unavailable archs is deferred
    until the first extension module build is
    requested (in distutils.sysconfig.customize_compiler).

    Currently called from distutils.sysconfig
    )r}r�r�r��res r(rr�s.��2&�'�
	 ��-���%��|�,��r*c�H�t|�t|�t|�|S)z�Customize compiler path and configuration variables.

    This customization is performed when the first
    extension module build is requested
    in distutils.sysconfig.customize_compiler.
    )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)"z Filter values for get_platform()�MACOSX_DEPLOYMENT_TARGETr@rEz.0�macosxrc3�2K�|]}t|����y�wrRrSrUs  r(rXz#get_platform_osx.<locals>.<genexpr>s����"N�a�3�q�6�"N�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&�&E4�3E4rR)F)�__doc__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*

Zerion Mini Shell 1.0