3 eC@sdZddlZddlZddlZddlmZmZmZddlZddl Z ddl m Z ddl mZddlmZmZmZmZddl mZddlmZd d ZGd d d e ZGd ddeZdZdZdZddZejdZddZ ddZ!ddZ"dS)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)PopenPIPE check_output) UnixCCompiler) write_file)DistutilsExecErrorCCompilerError CompileErrorUnknownFileError) LooseVersion)find_executablecCstjjd}|dkrtj|d|d}|dkr8dgS|dkrFdgS|d krTd gS|d krbd gS|d krpdgS|dkr~dgS|dkrdgSdt|kodknrddgStd|dS)zaInclude the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later. zMSC v. Z1300Zmsvcr70Z1310Zmsvcr71Z1400Zmsvcr80Z1500Zmsvcr90Z1600Zmsvcr100Z1700Zmsvcr110Z1800Zmsvcr120iliZucrtZ vcruntime140zUnknown MS Compiler version %s N)sysversionfindint ValueError)Zmsc_posZmsc_verrK/tmp/pip-build-vlmub77e/setuptools/setuptools/_distutils/cygwinccompiler.py get_msvcr@s( rc @sReZdZdZdZdZdZdZdZdZ dZ dd d Z d d Z dddZ dddZdS)CygwinCCompilerz? Handles the Cygwin port of the GNU C compiler to Windows. cygwinz.oz.az.dllzlib%s%sz%s%sz.exercCsHtj||||t\}}|jd||f|tk rB|jd|tjjdd|_ tjjdd|_ d|j krt \|_ |_ |_|j|jd|j |j |jf|j dkr|j |_nd |_|j d krd }qd }n |j |_d }|jd |j d|j d |j d|j d|j|fdd|j kr<|j dkrsz get_versions..)tuple)commandsrrrr/s r/cCst|dg}|jjdS)zCTry to determine if the compiler that would be used is from cygwin.z -dumpmachinescygwin)rstripendswith)r-rrrrrgs rg)#rdr*rrE subprocessrrrreZdistutils.versionrjZdistutils.unixccompilerrdistutils.file_utilrZdistutils.errorsrrr r r distutils.spawnr rrrfr(rnrqr&compileryrr/rgrrrrs.+    #@1/