ok

Mini Shell

Direktori : /opt/alt/python311/lib64/python3.11/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/distutils/__pycache__/_msvccompiler.cpython-311.pyc

�

�f'N����dZddlZddlZddlZddlmZmZmZmZm	Z	ddl
mZmZddl
mZddlmZddlmZd�Zd	�Zd
ddd
d�Zd�Zd�Zdd�Zd
dddd�ZGd�de��ZdS)adistutils._msvccompiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for Microsoft Visual Studio 2015.

The module is compatible with VS 2015 and later. You can find legacy support
for older versions in distutils.msvc9compiler and distutils.msvccompiler.
�N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError�	LinkError)�	CCompiler�gen_lib_options)�log)�get_platform)�countc�j�	tjtjdtjtjz���}n%#t
$rt
jd��YdSwxYwd}d}|5t��D]�}	tj	||��\}}}n#t
$rYn{wxYw|rt|tj
krdtj�
|��rE	tt|����}n#t t"f$rY��wxYw|dkr
||kr||}}��ddd��n#1swxYwY||fS)Nz'Software\Microsoft\VisualStudio\SxS\VC7)�accesszVisual C++ is not registered�NNr�)�winreg�	OpenKeyEx�HKEY_LOCAL_MACHINE�KEY_READ�KEY_WOW64_32KEY�OSErrorr
�debugr�	EnumValue�REG_SZ�os�path�isdir�int�float�
ValueError�	TypeError)�key�best_version�best_dir�i�v�vc_dir�vt�versions        �>/opt/alt/python311/lib64/python3.11/distutils/_msvccompiler.py�_find_vc2015r*s�������%�6��?�V�%;�;�
�
�
����
�����	�0�1�1�1��z�z������L��H�	�=�=����	=�	=�A�
� &� 0��a� 8� 8�
��6�2�2���
�
�
����
�����
=�R�6�=�(�(�R�W�]�]�6�-B�-B�(��!�%��(�(�m�m�G�G��"�I�.�����H������b�=�=�W�|�%;�%;�-4�f�(�L��=�=�=�=�=�=�=�=�=�=�=����=�=�=�=���!�!si�8;�A�A�&D&�8B�D&�
B �D&�B � 4D&�C2�1D&�2D�D&�D�D&�&D*�-D*c��tj�d��ptj�d��}|sdS	tjtj�|ddd��ddd	d
ddd
dg	dd������}n##tjttf$rYdSwxYwtj�|ddd��}tj�|��rd|fSdS)aJReturns "15, path" based on the result of invoking vswhere.exe
    If no install is found, returns "None, None"

    The version is returned to avoid unnecessarily changing the function
    result. It may be ignored when the path is not None.

    If vswhere.exe is not available, by definition, VS 2017 is not
    installed.
    zProgramFiles(x86)�ProgramFilesrzMicrosoft Visual Studio�	Installerzvswhere.exez-latestz-prereleasez	-requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z	-property�installationPathz	-products�*�mbcs�strict)�encoding�errors�VC�	Auxiliary�Build�)r�environ�get�
subprocess�check_outputr�join�strip�CalledProcessErrorr�UnicodeDecodeErrorr)�rootrs  r)�_find_vc2017rA8s
���:�>�>�-�.�.�P�"�*�.�.��2P�2P�D����z�
��&��G�L�L��8�+�}�U�U����L��+���
(
��8�-�-�-�.3�U�W�W�	
���
�)�7�4F�G�����z�z������7�<�<��d�K��9�9�D�	�w�}�}�T�����4�x���:s�AB�B7�6B7�x86�x64�arm�arm64)rB�	x86_amd64�x86_arm�	x86_arm64c�.�t��\}}|st��\}}|stjd��dStj�|d��}tj�|��stjd|��dS|dfS)Nz$No suitable Visual C++ version foundrz
vcvarsall.batz%s cannot be found)rAr*r
rrrr<�isfile)�	plat_spec�_r#r"�	vcvarsalls     r)�_find_vcvarsallrN_s����.�.�K�A�x��0�!-�����h����	�8�9�9�9��z�����X��7�7�I�
�7�>�>�)�$�$���	�&�	�2�2�2��z��d�?��c�X�tjd��r(d�tj���D��St	|��\}}|std���	t
jd�||��tj	����
dd���}nW#tj$rE}tj
|j��td	�|j�����d}~wwxYwd
�d�|���D��D��}|S)N�DISTUTILS_USE_SDKc�>�i|]\}}|���|��S���lower)�.0r!�values   r)�
<dictcomp>z_get_vc_env.<locals>.<dictcomp>ss6��
�
�
���U�
�I�I�K�K��
�
�
rOzUnable to find vcvarsall.batzcmd /u /c "{}" {} && set)�stderrzutf-16le�replace)r3zError executing {}c�H�i|]\}}}|�|�
|���|�� SrSrT)rVr!rLrWs    r)rXz_get_vc_env.<locals>.<dictcomp>�sH������C��E��	��	��	�	���U���rOc3�@K�|]}|�d��V��dS)�=N)�	partition)rV�lines  r)�	<genexpr>z_get_vc_env.<locals>.<genexpr>�s.����:�:������	�	�:�:�:�:�:�:rO)r�getenvr8�itemsrNrr:r;�format�STDOUT�decoder>r
�error�output�cmd�
splitlines)rKrMrL�out�exc�envs      r)�_get_vc_envrmqsS��	�y�$�%�%�
�
�
� �j�.�.�0�0�
�
�
�	
�
#�9�-�-�L�I�q��E�$�%C�D�D�D�"��%�&�-�-�i��C�C��$�
�
�
��&��I�&�
.�
.�	����(�"�"�"��	�#�*����$�%9�������"�"�	"�����"����
��	;�:����)9�)9�:�:�:����C��Js�!A	B+�+C?�:AC:�:C?c�6�|s1tjd���tj��}|D]b}tj�tj�|��|��}tj�|��r|cS�c|S)atReturn path to an MSVC executable program.

    Tries to find the program in several places: first, one of the
    MSVC program search paths from the registry; next, the directories
    in the PATH environment variable.  If any of those work, return an
    absolute path that is known to exist.  If none of them work, just
    return the original program name, 'exe'.
    r)rra�split�pathseprr<�abspathrJ)�exe�paths�p�fns    r)�	_find_exerv�s����4��	�&�!�!�'�'��
�3�3��
����
�W�\�\�"�'�/�/�!�,�,�c�
2�
2��
�7�>�>�"���	��I�I�I�	��JrOrFrGrH)�win32z	win-amd64z	win-arm32z	win-arm64c����eZdZdZdZiZdgZgd�ZdgZdgZ	eezeze	zZ
dZdZd	Z
d
ZdxZZdZdd�Zdd�Z		dd�Z		dd�Z			dd�Z										d d�Z�fd�Zd�Zd�Zd�Zd!d�Z�xZS)"�MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class.�msvcz.c)z.ccz.cppz.cxx�.rcz.mcz.resz.objz.libz.dllz%s%sz.exerc�P�tj||||��d|_d|_dS)NF)r�__init__�	plat_name�initialized)�self�verbose�dry_run�forces    r)r}zMSVCCompiler.__init__�s.����D�'�7�E�:�:�:���� ����rONc�~�|jr
Jd���|�t��}|tvr4td�tt�������t|}t
|��}|std���|�dd��|_|j�	tj��}td|��|_
td|��|_td|��|_td	|��|_td
|��|_td|��|_|�dd���	tj��D]6}|r2|�|�tj�����7|�d
d���	tj��D]6}|r2|�|�tj�����7d|_gd�|_gd�|_gd�}gd�}g|�d�|_g|�d�|_g|�d�d�d�|_g|�d�d�d�|_g|�|_g|�|_t@j!df|jt@j!df|jt@j!df|jt@j"df|jt@j"df|jt@j"df|jt@j#df|jt@j#df|jt@j#df|ji	|_$d|_dS)Nzdon't init multiple timesz--plat-name must be one of {}z7Unable to find a compatible Visual Studio installation.r�zcl.exezlink.exezlib.exezrc.exezmc.exezmt.exe�include�lib)�/nologoz/Ox�/W3z/GLz/DNDEBUGz/MD)r�z/Odz/MDdz/Zir�z/D_DEBUG)r��/INCREMENTAL:NO�/LTCG)r�r�r�z/DEBUG:FULLz/MANIFEST:EMBED,ID=1z/DLLz/MANIFEST:EMBED,ID=2z/MANIFESTUAC:NOFT)%rr�PLAT_TO_VCVARSrrc�tuplermr9�_pathsrorrprv�cc�linkerr��rc�mc�mt�add_include_dir�rstrip�sep�add_library_dir�preprocess_options�compile_options�compile_options_debug�ldflags_exe�ldflags_exe_debug�ldflags_shared�ldflags_shared_debug�ldflags_static�ldflags_static_debugr�
EXECUTABLE�
SHARED_OBJECT�SHARED_LIBRARY�_ldflags)r�r~rK�vc_envrs�dir�ldflags�
ldflags_debugs        r)�
initializezMSVCCompiler.initialize�sW���#�@�@�%@�@�@�#���$���I��N�*�*�(�)H�*0�&��~�1F�1F�*G�*G�I�I�
I�#�9�-�	��Y�'�'���	/�(�*.�/�/�
/��j�j���,�,�����!�!�"�*�-�-���H�e�,�,����
�E�2�2����Y��.�.����H�e�,�,����H�e�,�,����H�e�,�,����:�:�i��,�,�2�2�2�:�>�>�	9�	9�C��
9��$�$�S�Z�Z���%7�%7�8�8�8���:�:�e�R�(�(�.�.�r�z�:�:�	9�	9�C��
9��$�$�S�Z�Z���%7�%7�8�8�8��"&��� 
� 
� 
���&
�&
�&
��"�
�
�
��
�
�
�
�>�W�=�&<�=���!I�=�!I�2H�!I���[��[��[�1G�[�IZ�[���$g�m�$g�V�$g�=S�$g�Uf�$g��!�(��j���$4�m�$4��!��
!�4�(�$�*:�
�
!�5�)�4�+;�
�
!�4�(�$�*@�
�
$�d�+�T�-@�
�
$�e�,�d�.A�
�
$�d�+�T�-F�
�
%�t�,�d�.A�
�
%�u�-�t�/B�
�
%�t�,�d�.G�

��
� ����rOr�c������i�fd��jD����fd��j�jzD�����pd����fd�}tt	||����S)Nc� ��i|]
}|�j��SrS)�
obj_extension�rV�extr�s  �r)rXz1MSVCCompiler.object_filenames.<locals>.<dictcomp>"s���F�F�F�3�s�D�&�F�F�FrOc� ��i|]
}|�j��SrS)�
res_extensionr�s  �r)rXz1MSVCCompiler.object_filenames.<locals>.<dictcomp>#s���\�\�\�3�s�D�&�\�\�\rOr�c���tj�|��\}}�r tj�|��}natj�|��\}}|�tjjtjjf��r
|dd�}	tj��|�|z��S#t$r#td�|�����wxYw)N�zDon't know how to compile {})rr�splitext�basename�
splitdrive�
startswithr��altsepr<�LookupErrorrrc)rt�baser�rL�ext_map�
output_dir�	strip_dirs    ���r)�
make_out_pathz4MSVCCompiler.object_filenames.<locals>.make_out_path(s������(�(��+�+�I�D�#��
$��w�'�'��-�-����'�,�,�T�2�2���4��?�?�B�G�K����#@�A�A�$�����8�D�	
M��w�|�|�J��w�s�|�0C�D�D�D���
M�
M�
M�#�#A�#H�#H��#K�#K�L�L�L�	
M���s�((C�-C>)�src_extensions�_rc_extensions�_mc_extensions�list�map)r��source_filenamesr�r�r�r�s` `` @r)�object_filenameszMSVCCompiler.object_filenamess�������
�F�F�F�F�$�2E�F�F�F�
�\�\�\�\�$�2E��H[�2[�\�\�\�
��
 �%�2�
�	M�	M�	M�	M�	M�	M�	M�&�C�
�'7�8�8�9�9�9rOc		�@�|js|���|�||||||��}	|	\}}
}}}|pg}
|
�d��|r|
�|j��n|
�|j��d}|
D�]�}	||\}}n#t$rY�wxYw|rtj	�
|��}||jvrd|z}�n�||jvr	d|z}d}�n�||j
vrN|}d|z}	|�|jg|z||gz��n!#t $r}t#|���d}~wwxYw��||jv�rtj	�|��}tj	�|��}	|�|jd|d||g��tj	�tj	�|����\}}tj	�||d	z��}|�|jd|z|g��n!#t $r}t#|���d}~wwxYw���t#d
�||�����|jg|
z|z}|r|�d��|�|��|�d|z��|�|��	|�|����k#t $r}t#|���d}~wwxYw|
S)
Nz/cFz/Tcz/TpTz/foz-hz-rr{z"Don't know how to compile {} to {}z/EHscz/Fo)rr��_setup_compile�append�extendr�r��KeyErrorrrrq�
_c_extensions�_cpp_extensionsr��spawnr�rrr��dirnamer�r�r�r<rcr�)r��sourcesr��macros�include_dirsr�
extra_preargs�extra_postargs�depends�compile_info�objects�pp_opts�build�compile_opts�add_cpp_opts�obj�srcr��	input_opt�
output_opt�msg�h_dir�rc_dirr�rL�rc_file�argss                           r)�compilezMSVCCompiler.compile>s�����	��O�O�����*�*�:�v�|�+2�G�^�M�M��:F�7�����%�$�*������D�!�!�!��	6����� :�;�;�;�;����� 4�5�5�5����A	(�A	(�C�
� ��:���S�S���
�
�
���
�����
+��g�o�o�c�*�*���d�(�(�(�!�C�K�	�	���,�,�,�!�C�K�	�#�����+�+�+��	�"�S�[�
�,��J�J���y�7�2�j�)�5L�L�M�M�M�M��)�,�,�,�&�s�+�+�+�����,�������+�+�+������,�,�������-�-��	,��J�J����u�d�F�C�H�I�I�I� �g�.�.�r�w�/?�/?��/E�/E�F�F�G�D�!� �g�l�l�6�4�%�<�@�@�G��J�J������g�>�?�?�?�?��)�,�,�,�&�s�+�+�+�����,�����#�#G�$*�F�3��$4�$4�6�6�6��G�9�|�+�g�5�D��
%����G�$�$�$��K�K�	�"�"�"��K�K����$�$�$��K�K��'�'�'�
(��
�
�4� � � � ��%�
(�
(�
(�"�3�'�'�'�����
(�����s[�B"�"
B/�.B/�#D*�*
E�4E�E�B"H8�8
I�I�I�&K=�=
L�L�Lc���|js|���|�||��\}}|�||���}|�||��r||d|zgz}|r		tjd|jd�|����|�	|jg|z��dS#t$r}t|���d}~wwxYwtjd|��dS)N)r��/OUT:�Executing "%s" %s� �skipping %s (up-to-date))rr��_fix_object_args�library_filename�
_need_linkr
rr�r<r�rr)	r�r��output_libnamer�r�target_lang�output_filename�lib_argsr�s	         r)�create_static_libzMSVCCompiler.create_static_lib�s����	��O�O����"�3�3�G�Z�H�H�����/�/��;E�0�G�G���?�?�7�O�4�4�
	C��'�O�";�!<�<�H��
��
$��	�-�t�x����(�9K�9K�L�L�L��
�
�D�H�:��0�1�1�1�1�1��%�
$�
$�
$��s�m�m�#�����
$����
�I�0�/�B�B�B�B�Bs�/AB=�=
C�C�Cc�8�|js|���|�||��\}}|�|||��}|\}}}|r%|�dt|��z��t
||||��}|� tj�	||��}|�
||���r�|j||	f}d�|pgD��}||z|z|zd|zgz}tj�|d��}|��tj�
tj�|����\}}tj�	||�|����}|�d|z��|
r|
|dd�<|r|�|��tj�tj�|����}|�|��	t)jd|jd�	|����|�|jg|z��dS#t0$r}t3|���d}~wwxYwt)jd|��dS)	Nz5I don't know what to do with 'runtime_library_dirs': c��g|]}d|z��S)z/EXPORT:rS)rV�syms  r)�
<listcomp>z%MSVCCompiler.link.<locals>.<listcomp>�s��N�N�N��:��+�N�N�NrOr�rz/IMPLIB:r�r�r�)rr�r��
_fix_lib_args�warn�strr	rrr<r�r�r�r�r�r�r�r�rq�mkpathr
rr�r�rr)r��target_descr�r�r��	libraries�library_dirs�runtime_library_dirs�export_symbolsrr�r��
build_tempr��
fixed_args�lib_optsr��export_opts�ld_args�dll_name�dll_ext�implib_filer�s                       r)�linkzMSVCCompiler.link�s�����	��O�O����"�3�3�G�Z�H�H�����'�'�	�<�(<�>�>�
�8B�5�	�<�!5��	4��I�I�M��1�2�2�3�
4�
4�
4�#�4�#/�1E�#,�.�.���!� �g�l�l�:��G�G�O��?�?�7�O�4�4�#	C��m�K��$6�7�G�N�N��8L�"�N�N�N�K���)�K�7���")�O�";�!<�=�G��������4�4�J��)�&(�g�&6�&6��G�$�$�_�5�5�'7�'7�#��7� �g�l�l���)�)�(�3�3�5�5�����
�[� 8�9�9�9��
,�+�������
/����~�.�.�.����������)I�)I�J�J�J��K�K�
�#�#�#�
%��	�-�t�{�C�H�H�W�<M�<M�N�N�N��
�
�D�K�=�7�2�3�3�3�3�3��%�
%�
%�
%���n�n�$�����
%����
�I�0�/�B�B�B�B�Bs�AI$�$
J�.I=�=Jc����tjd��}	|jtjd<t	���|��|tjd<S#|tjd<wxYw)Nr)rrar�r8�superr�)r�rh�old_path�	__class__s   �r)r�zMSVCCompiler.spawn�s_����9�V�$�$��	*�!%��B�J�v���7�7�=�=��%�%�!)�B�J�v�����B�J�v��)�)�)�)s�4A�A,c��d|zS)Nz	/LIBPATH:rS�r�r�s  r)�library_dir_optionzMSVCCompiler.library_dir_options
���S� � rOc� �td���)Nz:don't know how to set runtime library search path for MSVC)rrs  r)�runtime_library_dir_optionz'MSVCCompiler.runtime_library_dir_options��$�J�L�L�	LrOc�,�|�|��S�N)r�)r�r�s  r)�library_optionzMSVCCompiler.library_option
s���$�$�S�)�)�)rOc���|r|dz|g}n|g}|D]_}|D]Z}tj�||�|����}tj�|��r|ccS�[�`dS)N�_d)rrr<r�rJ)r��dirsr�r�	try_namesr��name�libfiles        r)�find_library_filezMSVCCompiler.find_library_file
s����	��t��S�)�I�I���I��	�	�C�!�
#�
#���'�,�,�s�D�,A�,A�$�,G�,G�H�H���7�>�>�'�*�*�#�"�N�N�N�N�N�#�
#��4rO)rrrr)rr�)NNNrNNN)NrN)
NNNNNrNNNN)r)�__name__�
__module__�__qualname__�__doc__�
compiler_type�executablesr�r�r�r�r�r�r��static_lib_extension�shared_lib_extension�static_lib_format�shared_lib_format�
exe_extensionr}r�r�r�r�rr�r
rrr�
__classcell__)r
s@r)ryry�s��������6�6��M��K��F�M�-�-�-�O��W�N��W�N�$�o�5�$�%�'5�6�N��M��M�!��!��,2�2��)��M�!�!�!�!�J �J �J �J �`$%�$&�:�:�:�:�DHI�AE�W�W�W�W�z&*� !�&*�C�C�C�C�<���"&� ��� ���CC�CC�CC�CC�J*�*�*�*�*�!�!�!�L�L�L�*�*�*��������rOryr)rrr:r�distutils.errorsrrrrr�distutils.ccompilerrr	�	distutilsr
�distutils.utilr�	itertoolsrr*rA�PLAT_SPEC_TO_RUNTIMErNrmrvr�ryrSrOr)�<module>r,s�����
�	�	�	�����
�
�
�
�?�?�?�?�?�?�?�?�?�?�?�?�?�?�:�:�:�:�:�:�:�:�������'�'�'�'�'�'�������"�"�"�8���B
����	������$���<����*����	���q�q�q�q�q�9�q�q�q�q�qrO

Zerion Mini Shell 1.0