�
��Vc�? c s � d Z ddlZddlZddlZddlmZmZmZ ddlZddl m
Z
ddlmZ ddl
mZmZmZmZ ddlmZ ddlmZ d � Z G d
� de
� � Z G d� d
e� � ZdZdZdZd� Z ej d� � Zd� Zd� Z d� Z!dS )a distutils.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)�Popen�PIPE�check_output)�
UnixCCompiler)�
write_file)�DistutilsExecError�CCompilerError�CompileError�UnknownFileError)�LooseVersion)�find_executablec s � t j � d� � } | dk rYt j | dz | dz � }|dk rdgS |dk rdgS |d k rd
gS |dk rdgS |d
k rdgS t d|z � � �dS )zaInclude the appropriate MSVC runtime library if Python was built
with MSVC 7.0 or later.
zMSC v.i����i i
Z1300Zmsvcr70Z1310Zmsvcr71Z1400Zmsvcr80Z1500Zmsvcr90Z1600Zmsvcr100zUnknown MS Compiler version %s N)�sys�versionZfindZ
ValueError)Zmsc_posZmsc_ver� �2/usr/lib64/python3.11/distutils/cygwinccompiler.py� get_msvcrr = s� � � �k���x�(�(�G��"�}� J��+�g�a�i���
�2�3���f�� J��;��
��
�
J��;��
��
�
J��;��
��
� J��;��
��
� J��<���>��H�I�I�I�%J� J� c sT � e Zd ZdZdZdZdZdZdZdZ dZ
dd
�Zd� Z dd
�Z
dd�ZdS )�CygwinCCompilerz? Handles the Cygwin port of the GNU C compiler to Windows.
Zcygwinz.o�.az.dllzlib%s%sz%s%sz.exer c
s� � t j | |||� � t � � \ }}| � d|�d|�d�� � |t ur| � d|z � � t
� � \ | _ | _ | _ | � | j
d| j �d| j �d| j �d�z � � | j d k rd
| _ nd| _ | j dk rd
}nd}| � dddd| j �d|���� � | j dk rdg| _
| � d� � d S t � � | _
d S )NzPython's GCC status: z (details: z)z�Python's pyconfig.h doesn't seem to support your compiler. Reason: %s. Compiling may fail because of undefined preprocessor macros.z: gcc z, ld z
, dllwrap z
z2.10.90�gcc�dllwrap�2.13�-shared�
-mdll -staticzgcc -mcygwin -O -Wallzgcc -mcygwin -mdll -O -Wallzg++ -mcygwin -O -Wallzgcc -mcygwinz
-mcygwin �Zcompiler�compiler_soZcompiler_cxxZ
linker_exeZ linker_so�2.91.57Zmsvcrtz,Consider upgrading to a newer version of gcc)r �__init__�check_config_hZdebug_print�CONFIG_H_OKZwarn�get_versions�gcc_version�
ld_versionZdllwrap_version�
compiler_type�
linker_dll�set_executables�
dll_librariesr )�self�verbose�dry_run�forceZstatusZdetails�
shared_options r r zCygwinCCompiler.__init__b s� � ���t�W�g�u�=�=�=�(�*�*�������� �&�&�'�'�'�+� ,� ,� ,���$� ��I�I�O� ��
�
�
�
�N�N� @���$�/�4�+?�����+�+��*�*�*��/�/�/��.�.�.�/0� 0� 2� 2� 2� �?�i�'� (�#�D�O�O�'�D�O� �?�f�$� ,�%�M�M�+�M�
���&=�)F�*A�(6�)-����-�-�)I� � K� K� K� ��y�(� -� !)�z�D���I�I�>�
@�
@�
@�
@�
@�
"+���D���r c s* � |dk s|dk r> | � dd|d|g� � dS # t $ r}t |� � �d}~ww xY w | � | j |z |d|gz |z � � dS # t $ r}t |� � �d}~ww xY w)z:Compiles the source by spawning GCC and windres if needed.�.rc�.resZwindresz-iz-oN)Zspawnr r r )r&