관리-도구
편집 파일: cygwinccompiler.cpython-39.pyc
a (�Re*B � @ s� d Z ddlZddlZddlZddlmZmZmZ ddlZddl m Z ddlmZ ddl mZmZmZmZ ddlmZ ddlmZ d d � ZG dd� de �ZG d d� de�ZdZdZdZdd� Ze�d�Zdd� Zdd� Z dd� 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 C s� t j�d�} | dkr|t j| d | d � }|dkr8dgS |dkrFdgS |d krTd gS |dkrbdgS |d krpdgS td| ��dS )zaInclude the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later. zMSC v.���� � Z1300Zmsvcr70Z1310Zmsvcr71Z1400Zmsvcr80Z1500Zmsvcr90Z1600Zmsvcr100zUnknown MS Compiler version %s N)�sys�version�find� ValueError)Zmsc_posZmsc_ver� r ��/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/cygwinccompiler.py� get_msvcr? s r c @ sR e Zd ZdZdZdZdZdZdZdZ dZ dd d�Zdd � Zddd�Z ddd�ZdS )�CygwinCCompilerz? Handles the Cygwin port of the GNU C compiler to Windows. �cygwinz.o�.az.dllzlib%s%sz%s%sz.exer c C sH t �| |||� t� \}}| �d||f � |turB| �d| � tj�dd�| _ tj�dd�| _ d| j v r�t� \| _| _ | _| �| jd| j| j | jf � | j dkr�| j | _nd | _| j d kr�d}q�d}n| j | _d}| jd | j d| j d | j d| j d| j|f d� d| j v �r<| jdk�r<dg| _| �d� nt� | _d S )Nz%Python's GCC status: %s (details: %s)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++z: gcc %s, ld %s, dllwrap %s z2.10.90�dllwrap�2.13�-shared� -mdll -staticz%s -mcygwin -O -Wallz%s -mcygwin -mdll -O -Wallz%s -mcygwinz%s -mcygwin %s��compiler�compiler_so�compiler_cxx� linker_exe� linker_so�2.91.57�msvcrtz,Consider upgrading to a newer version of gcc)r �__init__�check_config_h�debug_print�CONFIG_H_OK�warn�os�environ�get�cc�cxx�get_versions�gcc_version� ld_versionZdllwrap_version� compiler_type� linker_dll�set_executables� dll_librariesr )�self�verbose�dry_run�force�status�details� shared_optionr r r r) d sX ��� � �� ���zCygwinCCompiler.__init__c C s� |dks|dkrXz| � dd|d|g� W q� tyT } zt|��W Y d}~q�d}~0 0 nPz"| � | j| |d|g | � W n, ty� } zt|��W Y d}~n d}~0 0 dS )z:Compiles the source by spawning GCC and windres if needed.�.rc�.resZwindresz-iz-oN)�spawnr r r# )r: �obj�src�extZcc_args�extra_postargsZpp_opts�msgr r r �_compile� s � zCygwinCCompiler._compileNc C sP t � | p g �} t � |pg �}t � |p&g �}|�| j� |du�r|| jksV| jdk�rtj�|d �}tj�tj� |��\}}tj� ||d �}tj� |d| d �}dtj� |� dg}|D ]}|�|� q�| �t ||fd | � | jd k�r| �d|g� | �d|g� n |�|� | �s(| �d � t�| |||||||d| | ||| � dS )zLink the objects.Nr r z.def�libr z LIBRARY %sZEXPORTSz writing %sr z--output-libz--defz-s)�copy�extendr9 Z EXECUTABLEr7 r. �path�dirname�splitext�basename�join�append�executer r �link)r: Ztarget_descZobjectsZoutput_filename� output_dir� libraries�library_dirs�runtime_library_dirs�export_symbols�debugZ extra_preargsrG � build_tempZtarget_lang�temp_dirZdll_nameZ dll_extensionZdef_fileZlib_file�contents�symr r r rT � sH �� ��� �zCygwinCCompiler.link� c C s� |du rd}g }|D ]�}t j�t j�|��\}}|| jddg vrRtd||f ��|rbt j�|�}|dv r�|�t j�||| | j �� q|�t j�||| j �� q|S )z#Adds supports for rc and res files.Nr_ rA rB z"unknown file type '%s' (from '%s'))rB rA ) r. rM rO �normcaseZsrc_extensionsr rP rR rQ � obj_extension)r: Zsource_filenamesZ strip_dirrU Z obj_names�src_name�baserF r r r �object_filenames s&