a
´iü? ã @ 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 ú1/usr/lib64/python3.9/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 sè t | |||¡ tƒ \}}| d||f ¡ |turB| d| ¡ tƒ \| _| _| _ | | j
d| j| j| j f ¡ | jdkr†d| _nd| _| jdkrœd}nd }| jd
ddd
d| j|f d� | jdkrÜ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.z: gcc %s, ld %s, dllwrap %s
z2.10.90ÚgccÚdllwrapú2.13ú-sharedú
-mdll -staticzgcc -mcygwin -O -Wallzgcc -mcygwin -mdll -O -Wallzg++ -mcygwin -O -Wallzgcc -mcygwinz%s -mcygwin %s©ZcompilerÚcompiler_soZcompiler_cxxZ
linker_exeZ linker_soú2.91.57Úmsvcrtz,Consider upgrading to a newer version of gcc)r Ú__init__Úcheck_config_hZdebug_printÚCONFIG_H_OKÚwarnÚ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# b sN
ÿýÿÿ
þÿ
ÿü
ÿ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