!,j0dZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z mZmZmZddlmZmZdZd ZGd d e ZGd d eZdZdZdZdZdZdZdS)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) check_output) UnixCCompiler) write_file)DistutilsExecErrorDistutilsPlatformErrorCCompilerError CompileError) LooseVersionsuppress_known_deprecationchtjd}|dkrtj|dz|dz}|dkrdgS|dkrdgS|d krd gS|d krd gS|d krdgS|dkrdgS|dkrdgSdt|cxkrdkrnnddgSt d|zdS)zaInclude the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later. zMSC v. 1300msvcr701310msvcr711400msvcr801500msvcr901600msvcr1001700msvcr1101800msvcr120iliucrt vcruntime140zUnknown MS Compiler version %s N)sysversionfindint ValueError)msc_posmsc_vers UC:\PYTHON\GemmaClient\venv\Lib\site-packages\setuptools/_distutils/cygwinccompiler.py get_msvcrr(skx((G"}}+gkGbL89 f  ;    ;    ;    ;    <    <    <  S\\ ( ( ( (D ( ( ( ( (N+ +>HII I7}zxUnable to set runtime library search path on Windows, usually indicated by `runtime_library_dirs` parameter to ExtensionceZdZdZdZdZdZdZdZdZ dZ dZ d Z dfd Z ed Zd Z ddZdZfdZefdZxZS)CygwinCCompilerz9Handles the Cygwin port of the GNU C compiler to Windows.cygwinz.oz.az.dll.az.dllzlib%s%szcyg%s%sz.exerc t|||t\}}|d|||t ur|d|ztj dd|_ tj dd|_ |j |_ d}| d|j zd |j zd|j zd |j zd |j | t|_dS) Nz%Python's GCC status: {} (details: {})zPython's pyconfig.h doesn't seem to support your compiler. Reason: %s. Compiling may fail because of undefined preprocessor macros.CCgccCXXzg++-sharedz%s -mcygwin -O -Wallz%s -mcygwin -mdll -O -Wallz %s -mcygwinz{} -mcygwin {}compiler compiler_so compiler_cxx linker_exe linker_so)super__init__check_config_h debug_printformat CONFIG_H_OKwarnosenvirongetcccxx linker_dllset_executablesr( dll_libraries)selfverbosedry_runforcestatusdetails shared_option __class__s r'r9zCygwinCCompiler.__init__Qs7 '5111(**  3 : :67 K K     $ $ IIOQXY    *..u--:>>%//'!  +dg54tw>/$(:$tw.'..t NN    '[[r)ctjdtdt5t dcdddS#1swxYwYdS)Nzgcc_version attribute of CygwinCCompiler is deprecated. Instead of returning actual gcc version a fixed value 11.2.0 is returned.) stacklevelz11.2.0)warningsr>DeprecationWarningr r )rGs r' gcc_versionzCygwinCCompiler.gcc_versionrs   X      ( ) ) * *)) * * * * * * * * * * * * * * * * * *sAA A c*|dks|dkr> |dd|d|gdS#t$r}t|d}~wwxYw ||j|z|d|gz|zdS#t$r}t|d}~wwxYw)z:Compiles the source by spawning GCC and windres if needed..rc.reswindresz-iz-oN)spawnrr r4)rGobjsrcextcc_argsextra_postargspp_optsmsgs r'_compilezCygwinCCompiler._compiles %<<3&== ( ItS$<=====% ( ( ("3''' ( ( $w.#tS1AANR& ( ( ("3''' (s,* AAA &A44 B>B  BNctj| pg} tj|pg}tj|pg}|r|t||j|||jks |jdkrtj |d}tj tj |\}}tj ||dz}dtj |zdg}|D]}| ||t||fd|z| || s| dt!j||||||||d| | | | | dS) zLink the objects.Nr/rz.defz LIBRARY %sEXPORTSz writing %sz-s)copyr>_runtime_library_dirs_msgextendrF EXECUTABLErDr?pathdirnamesplitextbasenamejoinappendexecuterrlink)rG target_descobjectsoutput_filename output_dir libraries library_dirsruntime_library_dirsexport_symbolsdebug extra_preargsr^ build_temp target_langtemp_dirdll_name dll_extensiondef_filecontentssyms r'rozCygwinCCompiler.links$ -"5266 Iio2.. )GMr**  1 II/ 0 0 0 +,,,  & 4? * *do.F.Fwwqz22H(*(8(8  11)) %X} w||Hh.?@@H%rw'7'7'H'HH)TH% % %$$$$ LLh%9<(;R S S S NN8 $ $ $ '   & & &                  r)c:|tgSN)r>rerGdirs r'runtime_library_dir_optionz*CygwinCCompiler.runtime_library_dir_options +,,, r)ctj|}t|||Sr)r?rhnormcaser8_make_out_path)rGrs strip_dirsrc_name norm_src_namerNs r'rzCygwinCCompiler._make_out_paths4((22 ww%%j)]KKKr)cLitjfddDS)z3 Add support for rc and res files. c&i|] }||jzS) obj_extension).0r\rGs r' z2CygwinCCompiler.out_extensions..s#HHHsC$,,HHHr))rWrV)r8out_extensions)rGrNs`r'rzCygwinCCompiler.out_extensionss9  gg$ HHHHHHH  r)rrr) NNNNNrNNNN)__name__ __module__ __qualname____doc__ compiler_typerstatic_lib_extensionshared_lib_extensiondylib_lib_extensionstatic_lib_formatshared_lib_formatdylib_lib_format exe_extensionr9propertyrTrarorrr __classcell__rNs@r'r+r+Ds,CCMM# !! M))))))B * *X *(((*!X X X X tLLLLL     X     r)r+c.eZdZdZdZdfd ZdZxZS)Mingw32CCompilerz:Handles the Mingw32 port of the GNU C compiler to Windows.mingw32rc rt|||d}t|jrt d|d|jzd|jzd|jzd|jzd|j|g|_ t|_ dS)Nr1z1Cygwin gcc cannot be used with --compiler=mingw32z %s -O -Wallz%s -mdll -O -Wallz%sz{} {}r2) r8r9 is_cygwinccrBrrErCr<rDrFr()rGrHrIrJrMrNs r'r9zMingw32CCompiler.__init__ s '5111! tw   V !TUU U "TW,+dg5&1dg~nnT_mDD     '[[r)c*ttr)rrers r'rz+Mingw32CCompiler.runtime_library_dir_option&s$%>???r)r)rrrrrr9rrrs@r'rrs^DDM))))))8@@@@@@@r)rokznot ok uncertaincddlm}dtjvr tdfSdtjvr tdfS|} t |} d|vr td|zf|Std |zf|S#|wxYw#t$r,}td ||j fcYd }~Sd }~wwxYw) awCheck if the current Python installation appears amenable to building extensions with GCC. Returns a tuple (status, details), where 'status' is one of the following constants: - CONFIG_H_OK: all is well, go ahead and compile - CONFIG_H_NOTOK: doesn't look good - CONFIG_H_UNCERTAIN: not sure -- unable to read pyconfig.h 'details' is a human-readable string explaining the situation. Note there are two ways to conclude "OK": either 'sys.version' contains the string "GCC" (implying that this Python was built with GCC), or the installed "pyconfig.h" contains the string "__GNUC__". r) sysconfigGCCzsys.version mentions 'GCC'Clangzsys.version mentions 'Clang'__GNUC__z'%s' mentions '__GNUC__'z '%s' does not mention '__GNUC__'zcouldn't read '{}': {}N) distutilsrr r!r=get_config_h_filenameopenreadcloseCONFIG_H_NOTOKOSErrorCONFIG_H_UNCERTAINr<strerror)rfnconfig_hexcs r'r:r:3s4*$#####  888#+:::  ( ( * *B W88 X]]__,,"$>$CC NN    &'IB'NN NN    HNN     WWW"$<$C$CB $U$UVVVVVVVWsB C !B0;C  B0C 0CC C?!C:4C?:C?cttj|dgz}|dS)zCTry to determine if the compiler that would be used is from cygwin.z -dumpmachinescygwin)rshlexsplitstripendswith)rB out_strings r'rrbs?ek"oo0@@AAJ      & &y 1 11r))rr?r rdrrR subprocessrdistutils.unixccompilerrdistutils.file_utilrdistutils.errorsrrrr distutils.versionr r r(rer+rr=rrr:r get_versionsrr)r'rs ######111111****** GFFFFFFF J J JHI } } } } } m} } } B"@"@"@"@"@"@"@"@R  ,W,W,W^222  r)