%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/setuptools/_distutils/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/setuptools/_distutils/__pycache__/cygwinccompiler.cpython-312.pyc

�


_�d�.��>�dZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZddl
mZmZmZmZddlmZmZdd	lmZej.d
gdgdgd
gdgdgdgdgej0d�	�Zd�ZdZGd�de
�ZGd�de�ZdZdZdZ d�Z!d�Z"dZ#y)adistutils.cygwinccompiler

Provides the CygwinCCompiler class, a subclass of UnixCCompiler that
handles the Cygwin port of the GNU C compiler to Windows.  It also contains
the Mingw32CCompiler class which handles the mingw32 port of GCC (same as
cygwin in no-cygwin mode).
�N)�check_output�)�
UnixCCompiler)�
write_file)�DistutilsExecError�DistutilsPlatformError�CCompilerError�CompileError)�LooseVersion�suppress_known_deprecation)�RangeMap�msvcr70�msvcr71�msvcr80�msvcr90�msvcr100�msvcr110�msvcr120�vcruntime140)	iiixi�i@i�iili�c���tjdtj�}	t	|jd��}	t|S#t$rYywxYw#t$rtd|z��wxYw)zaInclude the appropriate MSVC runtime library if Python was built
    with MSVC 7.0 or later.
    zMSC v\.(\d{4})rNzUnknown MS Compiler version %s )
�re�search�sys�version�int�group�AttributeError�
_msvcr_lookup�KeyError�
ValueError)�match�msc_vers  �G/usr/lib/python3/dist-packages/setuptools/_distutils/cygwinccompiler.py�	get_msvcrr$4sx��
�I�I�'����5�E���e�k�k�!�n�%��F��W�%�%��������F��:�W�D�E�E�F�s�A
�A�
	A�A�A1zxUnable to set runtime library search path on Windows, usually indicated by `runtime_library_dirs` parameter to Extensionc���eZdZdZdZdZdZdZdZdZ	dZ
dZd	Zd�fd
�	Z
ed��Zd�Z										dd
�Zd�Z�fd�Ze�fd��Z�xZS)�CygwinCCompilerz9Handles the Cygwin port of the GNU C compiler to Windows.�cygwinz.oz.az.dll.az.dllzlib%s%szcyg%s%sz.exec
�\��t�|�|||�t�\}}|jdj	||��|t
ur|j
d|z�tjjdd�|_
tjjdd�|_|j|_d}|jd|jzd	|jzd|jzd
|jzdj	|j|���t�|_y)
Nz%Python's GCC status: {} (details: {})z�Python's pyconfig.h doesn't seem to support your compiler. Reason: %s. Compiling may fail because of undefined preprocessor macros.�CC�gcc�CXXzg++�-sharedz%s -mcygwin -O -Wallz%s -mcygwin -mdll -O -Wallz%s -mcygwinz{} -mcygwin {}��compiler�compiler_so�compiler_cxx�
linker_exe�	linker_so)�super�__init__�check_config_h�debug_print�format�CONFIG_H_OK�warn�os�environ�get�cc�cxx�
linker_dll�set_executablesr$�
dll_libraries)�self�verbose�dry_run�force�status�details�
shared_option�	__class__s       �r#r4zCygwinCCompiler.__init__Vs���
����'�5�1�(�*�������3�:�:�6�7�K�	
���$��I�I�O�QX�Y�
��*�*�.�.��u�-����:�:�>�>�%��/����'�'���!�
����+�d�g�g�5�4�t�w�w�>�/�$�(�(�:�$�t�w�w�.�'�.�.�t���
�N�	�	
�'�[���c��tjdtd��t�5t	d�cddd�S#1swYyxYw)Nz�gcc_version attribute of CygwinCCompiler is deprecated. Instead of returning actual gcc version a fixed value 11.2.0 is returned.�)�
stacklevelz11.2.0)�warningsr9�DeprecationWarningrr)rBs r#�gcc_versionzCygwinCCompiler.gcc_versionvsA��	�
�
�
X���		
�(�
)�	*���)�	*�	*�	*�s	�<�Ac��|dvr	|jdd|d|g�y	|j|j|z|d|gz|z�y#t$r}t|��d}~wwxYw#t$r}t|��d}~wwxYw)z:Compiles the source by spawning GCC and windres if needed.)�.rc�.res�windresz-iz-oN)�spawnrr
r/)rB�obj�src�ext�cc_args�extra_postargs�pp_opts�msgs        r#�_compilezCygwinCCompiler._compile�s����/�!�
(��
�
�I�t�S�$��<�=�
(��
�
��$�$�w�.�#�t�S�1A�A�N�R���	&�
(�"�3�'�'��
(��&�
(�"�3�'�'��
(�s.�A�'A"�	A�A�A�"	A;�+A6�6A;c��tj|
xsg�}
tj|xsg�}tj|xsg�}|r|jt�|j|j�|��||j
k7s|jdk(r�tjj|d�}tjjtjj|��\}}tjj||dz�}dtjj|�zdg}|D]}|j|��|jt||fd|z�|j|�|	s|
jd�t!j"||||||||d|	|
|||
�y)	zLink the objects.Nr*rz.defz
LIBRARY %s�EXPORTSz
writing %sz-s)�copyr9�_runtime_library_dirs_msg�extendrA�
EXECUTABLEr?r:�path�dirname�splitext�basename�join�append�executerr�link)rB�target_desc�objects�output_filename�
output_dir�	libraries�library_dirs�runtime_library_dirs�export_symbols�debug�
extra_preargsrZ�
build_temp�target_lang�temp_dir�dll_name�
dll_extension�def_file�contents�syms                    r#rkzCygwinCCompiler.link�s���$�	�	�-�"5�2�6�
��I�I�i�o�2�.�	��)�)�G�M�r�*����I�I�/�0�	����+�+�,�
�&��4�?�?�*�d�o�o��.F��w�w���w�q�z�2�H�(*���(8�(8���� � ��1�)�%�X�}�
�w�w�|�|�H�h��.?�@�H�%�r�w�w�'7�'7��'H�H�)�T�H�%�
%������$�
%��L�L��h��%9�<�(�;R�S�

�N�N�8�$��� � ��&����������� �������	
rJc�0�|jt�gS�N)r9ra�rB�dirs  r#�runtime_library_dir_optionz*CygwinCCompiler.runtime_library_dir_option�s��	
�	�	�+�,��	rJc�d��tjj|�}t�|�|||�Sr)r:rd�normcaser3�_make_out_path)rBro�	strip_dir�src_name�
norm_src_namerIs     �r#r�zCygwinCCompiler._make_out_path�s+������(�(��2�
��w�%�j�)�]�K�KrJc�b��it�|��dD�cic]}|||jz��c}�Scc}w)z3
        Add support for rc and res files.
        )rSrR)r3�out_extensions�
obj_extension)rBrXrIs  �r#r�zCygwinCCompiler.out_extensions�s@���

��g�$�
�8G�H��s�C�$�,�,�,�,�H�
�	
��Hs�,�rrr)
NNNNNrNNNN)�__name__�
__module__�__qualname__�__doc__�
compiler_typer��static_lib_extension�shared_lib_extension�dylib_lib_extension�static_lib_format�shared_lib_format�dylib_lib_format�
exe_extensionr4�propertyrPr]rkr�r�r��
__classcell__�rIs@r#r&r&Is����C��M��M���#�� ��!��!�� ���M�)�@�*��*�(�*���!�������X
�t�L�
�
��
rJr&c�.��eZdZdZdZd�fd�	Zd�Z�xZS)�Mingw32CCompilerz:Handles the Mingw32 port of the GNU C compiler to Windows.�mingw32c
�4��t�|�|||�d}t|j�rt	d��|jd|jzd|jzd|jzd|jzdj|j|���y)Nr,z1Cygwin gcc cannot be used with --compiler=mingw32z%s -O -Wallz%s -mdll -O -Wallz%sz{} {}r-)	r3r4�is_cygwinccr=r	r@r>r7r?)rBrCrDrErHrIs     �r#r4zMingw32CCompiler.__init__s����
����'�5�1�!�
��t�w�w�� �!T�U�U����"�T�W�W�,�+�d�g�g�5�&����1��d�g�g�~��n�n�T�_�_�m�D�	�	
rJc� �tt��r)rrar�s  r#r�z+Mingw32CCompiler.runtime_library_dir_options��$�%>�?�?rJr�)r�r�r�r�r�r4r�r�r�s@r#r�r�	s���D��M�
� @rJr��okznot ok�	uncertainc���ddlm}dtjvrtdfSdtjvrtdfS|j�}	t
|�}	d|j�vrtd|zf|j�Std	|zf|j�S#|j�wxYw#t$r,}td
j||j�fcYd}~Sd}~wwxYw)awCheck if the current Python installation appears amenable to building
    extensions with GCC.

    Returns a tuple (status, details), where 'status' is one of the following
    constants:

    - CONFIG_H_OK: all is well, go ahead and compile
    - CONFIG_H_NOTOK: doesn't look good
    - CONFIG_H_UNCERTAIN: not sure -- unable to read pyconfig.h

    'details' is a human-readable string explaining the situation.

    Note there are two ways to conclude "OK": either 'sys.version' contains
    the string "GCC" (implying that this Python was built with GCC), or the
    installed "pyconfig.h" contains the string "__GNUC__".
    r)�	sysconfig�GCCzsys.version mentions 'GCC'�Clangzsys.version mentions 'Clang'�__GNUC__z'%s' mentions '__GNUC__'z '%s' does not mention '__GNUC__'zcouldn't read '{}': {}N)�	distutilsr�rrr8�get_config_h_filename�open�read�close�CONFIG_H_NOTOK�OSError�CONFIG_H_UNCERTAINr7�strerror)r��fn�config_h�excs    r#r5r5+s���*$�
������8�8�8��#�+�+���:�:�:�
�	(�	(�	*�B�
W���8��	��X�]�]�_�,�"�$>��$C�C�
�N�N��&�'I�B�'N�N��N�N���H�N�N����W�"�$<�$C�$C�B����$U�V�V��W�sB�B5�B �4B5�
B �B5� B2�2B5�5	C*�>!C%�C*�%C*c��ttj|�dgz�}|j�j	d�S)zCTry to determine if the compiler that would be used is from cygwin.z-dumpmachinescygwin)r�shlex�split�strip�endswith)r=�
out_strings  r#r�r�Zs6���e�k�k�"�o��0@�@�A�J�����&�&�y�1�1rJ)$r�r:rrr`r�rN�
subprocessr�
unixccompilerr�	file_utilr�errorsrrr	r
rrr�_collectionsr
�left�undefined_valuerr$rar&r�r8r�r�r5r��get_versions�rJr#�<module>r�s����
�	�
����#�(�!���>�"���
�
��k��k��k��k��l��l��l����&�&�#��
�.F� I��|
�m�|
�@@��@�:���� ��,W�^2���rJ

Zerion Mini Shell 1.0