Advanced Web Server Manager
Complete File Manager & Terminal - Standalone Version
By Sid Gifari | Gifari Industries
Current path:
/
/
usr
/
local
/
lib
/
python3.6
/
site-packages
/
setuptools
/
_distutils
/
__pycache__
✏️
Editing: cygwinccompiler.cpython-36.pyc
3 ���e�C � @ s� d Z ddlZddlZddlZddlmZmZmZ ddlZddl Z ddlmZ ddl mZ ddlmZmZmZmZ ddl mZ ddlmZ d d � ZG dd� de�ZG d d� de�ZdZdZdZdd� Zejd�Zdd� Z dd� 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 jjd�} | dkr�t j| d | d � }|dkr8dgS |dkrFdgS |d krTd gS |dkrbdgS |d krpdgS |dkr~dgS |dkr�dgS dt|� ko�dk n r�ddgS td| ��dS )zaInclude the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later. zMSC v.� � � Z1300Zmsvcr70Z1310Zmsvcr71Z1400Zmsvcr80Z1500Zmsvcr90Z1600Zmsvcr100Z1700Zmsvcr110Z1800Zmsvcr120il i� ZucrtZvcruntime140zUnknown MS Compiler version %s N���)�sys�version�find�int� ValueError)Zmsc_posZmsc_ver� r �K/tmp/pip-build-vlmub77e/setuptools/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.oz.az.dllzlib%s%sz%s%sz.exer c C sH t j| |||� t� \}}| jd||f � |tk rB| jd| � tjjdd�| _ tjjdd�| _ d| j kr�t� \| _| _ | _| j| 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 k�r<| jdk�r<dg| _| jd� 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�dllwrapz2.13z-sharedz -mdll -staticz%s -mcygwin -O -Wallz%s -mcygwin -mdll -O -Wallz%s -mcygwinz%s -mcygwin %s)�compiler�compiler_so�compiler_cxx� linker_exe� linker_soz2.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% n sF zCygwinCCompiler.__init__c C s� |dks|dkrVy| j dd|d|g� W q� tk rR } zt|��W Y dd}~X q�X nNy"| j | j| |d|g | � W n* tk r� } zt|��W Y dd}~X nX dS )z:Compiles the source by spawning GCC and windres if needed.z.rcz.resZwindresz-iz-oN)�spawnr r r )r6 �obj�src�extZcc_args�extra_postargsZpp_opts�msgr r r �_compile� s zCygwinCCompiler._compileNc C sR t j | p g �} t j |pg �}t j |p&g �}|j| j� |dk oP|| jksT| jdk�rtjj|d �}tjjtjj |��\}}tjj ||d �}tjj |d| d �}dtjj |� dg}x|D ]}|j|� q�W | jt ||fd | � | jd k�r| jd|g� | jd|g� n |j|� | �s*| jd � tj| |||||||d| | ||| � dS )zLink the objects.Nr r z.def�libz.az LIBRARY %sZEXPORTSz writing %sr z--output-libz--defz-s)�copy�extendr5 Z EXECUTABLEr3 r* �path�dirname�splitext�basename�join�append�executer r �link)r6 Ztarget_descZobjectsZoutput_filename� output_dir� libraries�library_dirs�runtime_library_dirs�export_symbols�debugZ extra_preargsrA � build_tempZtarget_lang�temp_dirZdll_nameZ dll_extensionZdef_fileZlib_file�contents�symr r r rN � s: zCygwinCCompiler.link� c C s� |dkrd}g }x�|D ]�}t jjt jj|��\}}|| jddg krTtd||f ��|rdt jj|�}|dkr�|jt jj||| | j �� q|jt jj||| j �� qW |S )z#Adds supports for rc and res files.NrY �.rc�.resz"unknown file type '%s' (from '%s'))r[ rZ ) r* rG rI �normcaseZsrc_extensionsr rJ rL rK � obj_extension)r6 Zsource_filenamesZ strip_dirrO Z obj_names�src_name�baser@ r r r �object_filenames s z CygwinCCompiler.object_filenames)r r r ) NNNNNr NNNN)r rY )�__name__� __module__�__qualname__�__doc__r2 r] Zstatic_lib_extension�shared_lib_extensionZstatic_lib_formatZshared_lib_formatZ exe_extensionr% rC rN r` r r r r r c s @ Kr c @ s e Zd ZdZdZddd�ZdS )�Mingw32CCompilerz@ Handles the Mingw32 port of the GNU C compiler to Windows. Zmingw32r c C s� t j| |||� d| jkr*| jdk r*d}nd}d| jkrH| jdkrHd}nd}t| j�r^td��| jd | j d | j d | j d| j d| j ||f d � g | _ t� | _ d S )Nr z2.13z -mdll -staticz-sharedz2.91.57z--entry _DllMain@12rY z1Cygwin gcc cannot be used with --compiler=mingw32z%s -O -Wallz%s -mdll -O -Wallz%sz%s %s %s)r r r! r"