ef. >dZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z ddl mZmZmZmZddlmZmZdd lmZejd gd gd gd gdgdgdgdgejd ZdZdZGdde ZGddeZdZdZdZ dZ!dZ"dZ#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) check_output) UnixCCompiler) write_file)DistutilsExecErrorDistutilsPlatformErrorCCompilerError CompileError) LooseVersionsuppress_known_deprecation)RangeMapmsvcr70msvcr71msvcr80msvcr90msvcr100msvcr110msvcr120 vcruntime140) iiixii@iiilictjdtj} t |d}n#t $rYdSwxYw t|S#t$rtd|zwxYw)zaInclude the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later. zMSC v\.(\d{4})rNzUnknown MS Compiler version %s ) researchsysversionintgroupAttributeError _msvcr_lookupKeyError ValueError)matchmsc_vers /builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/setuptools/_distutils/cygwinccompiler.py get_msvcrr$4s I' 5 5Eekk!nn%% FW%% FFF:WDEEEFs"A AA A##BzxUnable 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#r4zCygwinCCompiler.__init__Vs7 '5111(**  3 : :67 K K     $ $ IIOQXY    *..u--:>>%//'!  +dg54tw>/$(:$tw.'..t NN    '[[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)warningsr9DeprecationWarningr r )rBs r# gcc_versionzCygwinCCompiler.gcc_versionvs   X      ( ) ) * *)) * * * * * * * * * * * * * * * * * *sAA A c|dvr> |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 r/)rBobjsrcextcc_argsextra_postargspp_optsmsgs r#_compilezCygwinCCompiler._compiles / ! ! ( ItS$<=====% ( ( ("3''' ( ( $w.#tS1AANR& ( ( ("3''' (s*" A;A&A,, B 6BB Nctj| 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)copyr9_runtime_library_dirs_msgextendrA EXECUTABLEr?r:pathdirnamesplitextbasenamejoinappendexecuterrlink)rB target_descobjectsoutput_filename output_dir libraries library_dirsruntime_library_dirsexport_symbolsdebug extra_preargsrZ build_temp target_langtemp_dirdll_name dll_extensiondef_filecontentssyms r#rkzCygwinCCompiler.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 $ $ $ '   & & &                  rJc:|tgSN)r9rarBdirs r#runtime_library_dir_optionz*CygwinCCompiler.runtime_library_dir_options +,,, rJctj|}t|||Sr)r:rdnormcaser3_make_out_path)rBro strip_dirsrc_name norm_src_namerIs r#rzCygwinCCompiler._make_out_paths4((22 ww%%j)]KKKrJcLitjfddDS)z3 Add support for rc and res files. c&i|] }||jzS) obj_extension).0rXrBs r# z2CygwinCCompiler.out_extensions..s#HHHsC$,,HHHrJ)rSrR)r3out_extensions)rBrIs`r#rzCygwinCCompiler.out_extensionss9  gg$ HHHHHHH  rJrrr) NNNNNrNNNN)__name__ __module__ __qualname____doc__ compiler_typerstatic_lib_extensionshared_lib_extensiondylib_lib_extensionstatic_lib_formatshared_lib_formatdylib_lib_format exe_extensionr4propertyrPr]rkrrr __classcell__rIs@r#r&r&Is,CCMM# !! M))))))@ * *X *(((*!X X X X tLLLLL     X     rJr&c.eZdZdZdZdfd ZdZxZS)Mingw32CCompilerz:Handles the Mingw32 port of the GNU C compiler to Windows.mingw32rc >t|||d}t|jrt d|d|jzd|jzd|jzd|jzd|j|dS)Nr,z1Cygwin gcc cannot be used with --compiler=mingw32z %s -O -Wallz%s -mdll -O -Wallz%sz{} {}r-) r3r4 is_cygwinccr=r r@r>r7r?)rBrCrDrErHrIs r#r4zMingw32CCompiler.__init__s '5111! tw   V !TUU U "TW,+dg5&1dg~nnT_mDD      rJc*ttr)rrars r#rz+Mingw32CCompiler.runtime_library_dir_options$%>???rJr)rrrrrr4rrrs@r#rr s^DDM      @@@@@@@rJrokznot 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) distutilsrrrr8get_config_h_filenameopenreadcloseCONFIG_H_NOTOKOSErrorCONFIG_H_UNCERTAINr7strerror)rfnconfig_hexcs r#r5r5+s4*$#####  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)r= out_strings r#rrZs?ek"oo0@@AAJ      & &y 1 11rJ)$rr:rrr`rrN subprocessr unixccompilerr file_utilrerrorsrrr r rr r _collectionsr leftundefined_valuerr$rar&rr8rrr5r get_versionsrrJr#rs ######((((((!!!!!! >======="""""" kkkklll&# . F F F I | | | | | m| | | @@@@@@@@@:  ,W,W,W^222  rJ