\bgs.dZddlZddlZddlZddlZddlZddlZddlmZddl m Z m Z m Z m Z ddlmZddlmZddlmZdd lmZmZd Zd ZGd d eZGddeZdZdZdZdZdZdZ 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)CCompilerError CompileErrorDistutilsExecErrorDistutilsPlatformError) write_file)get_config_vars) UnixCCompiler) LooseVersionsuppress_known_deprecationcgS)z6No longer needed, but kept for backward compatibility.rv/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/setuptools/_distutils/cygwinccompiler.py get_msvcrrs IrzxUnable 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.exeFc t|||t\}}|d|d|d|tur|d|dt dd\|_|_tj d|jpd|_tj d|jpd |_|j|_ |j|_ d }||jd |jd |jd |jd |jd |j d||jd |j d|t|_dS)NzPython's GCC status: z (details: )zCPython's pyconfig.h doesn't seem to support your compiler. Reason: z>. Compiling may fail because of undefined preprocessor macros.CCCXXgcczg++-sharedz -mcygwin -O -Wallz -mcygwin -mdll -O -Wallz -mcygwinz -mcygwin )compiler compiler_so compiler_cxxcompiler_so_cxx linker_exe linker_solinker_exe_cxx linker_so_cxx)super__init__check_config_h debug_print CONFIG_H_OKwarnr cccxxosenvironget linker_dlllinker_dll_cxxset_executablesr dll_libraries)selfverbosedry_runforcestatusdetails shared_option __class__s rr%zCygwinCCompiler.__init__5s '5111(** NNNGNNNOOO  $ $ IIO"OOO    ,D%88*..tw'7%88:>>%):U;;'"h!  3337<<< H888#xAAA',,,CCMCC"h111!0KKMKK  '[[rctjdtdt5t 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 )r3s r gcc_versionzCygwinCCompiler.gcc_versionYs   X      ( ) ) * *)) * * * * * * * * * * * * * * * * * *sAA A c|dvr> |dd|d|gdS#t$r}t|d}~wwxYw ||dkr(||j|z|d|gz|zdS||j|z|d|gz|zdS#t$r}t|d}~wwxYw)z:Compiles the source by spawning GCC and windres if needed.).rc.reswindresz-iz-oNzc++)spawnrrdetect_languagerr)r3objsrcextcc_argsextra_postargspp_optsmsgs r_compilezCygwinCCompiler._compilehs4 / ! ! ( ItS$<=====% ( ( ("3''' ( ('',,55JJ,!"c*+))JJ(72c45EEV& ( ( ("3''' (s0" A;A?B-&B-- C 7CC Nctj| pg} tj|pg}tj|pg}|r|t||j| ||jks |jdkrtj |d}tj tj |\}}tj ||dz}dtj |dg}||| t||fd|||| s| dt!j||||||||d| | | | | dS) zLink the objects.Nrrz.defzLIBRARY EXPORTSzwriting z-s)copyr)_runtime_library_dirs_msgextendr2 EXECUTABLEr/r,pathdirnamesplitextbasenamejoinexecuter appendr link)r3 target_descobjectsoutput_filename output_dir libraries library_dirsruntime_library_dirsexport_symbolsdebug extra_preargsrK build_temp target_langtemp_dirdll_name dll_extensiondef_filecontentss rr\zCygwinCCompiler.links$ -"5266 Iio2.. )GMr**  1 II/ 0 0 0 +,,,  & 4? * *do.F.Fwwqz22H(*(8(8  11)) %X} w||Hh.?@@HG27#3#3O#D#DFF RH OON + + + LLh%9;Ph;P;P Q Q Q NN8 $ $ $ '   & & &                  rc:|tgSN)r)rRr3dirs rruntime_library_dir_optionz*CygwinCCompiler.runtime_library_dir_options +,,, rctj|}t|||Sro)r,rUnormcaser$_make_out_path)r3r` strip_dirsrc_name norm_src_namer:s rruzCygwinCCompiler._make_out_paths4((22 ww%%j)]KKKrcLitjfddDS)z3 Add support for rc and res files. c&i|] }||jzSr) obj_extension).0rIr3s r z2CygwinCCompiler.out_extensions..s#HHHsC$,,HHHr)rCrB)r$out_extensions)r3r:s`rr~zCygwinCCompiler.out_extensionss9  gg$ HHHHHHH  rFFF) NNNNNFNNNN)__name__ __module__ __qualname____doc__ compiler_typer{static_lib_extensionshared_lib_extensiondylib_lib_extensionstatic_lib_formatshared_lib_formatdylib_lib_format exe_extensionr%propertyr@rNr\rrrur~ __classcell__r:s@rrr(s,CCMM# !! M")")")")")")H * *X *(((:!W W W W rLLLLL     X     rrc.eZdZdZdZdfd ZdZxZS)Mingw32CCompilerz:Handles the Mingw32 port of the GNU C compiler to Windows.mingw32Fc Rt|||d}t|jrt d||jd|jd|jd|jd|j|jd||j|jd|dS)Nrz1Cygwin gcc cannot be used with --compiler=mingw32z -O -Wallz -shared -O -Wall )rrrrr r!r"r#) r$r% is_cygwinccr*rr1r+r/r0)r3r4r5r6r9r:s rr%zMingw32CCompiler.__init__s '5111! tw   V !TUU U ***7555#x::: H///'|::=::"h=!0BB=BB  rc*ttro)rrRrps rrrz+Mingw32CCompiler.runtime_library_dir_option s$%>???rr)rrrrrr%rrrrs@rrrs^DDM      &@@@@@@@rrokznot ok uncertaincddlm}dtjvr tdfSdtjvr tdfS|} t j|d}d }||vr t}d }n t}d }||d |d |fS#t$r}td |d|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'zutf-8)encoding__GNUC__mentionszdoes not mentionrzcouldn't read 'z': N) distutilsrsysversionr(get_config_h_filenamepathlibPath read_textCONFIG_H_NOTOKOSErrorCONFIG_H_UNCERTAINstrerror)rfnconfig_h substringcodemention_inflectedexcs rr&r&s$*$#####  888#+:::  ( ( * *B A<##--w-??  D *  !D 2 @@0@@9@@@@ MMM"$Kb$K$KS\$K$KLLLLLLLMs (B B?!B:4B?:B?cttj|dgz}|dS)zCTry to determine if the compiler that would be used is from cygwin.z -dumpmachinescygwin)rshlexsplitstripendswith)r* out_strings rrrIs?ek"oo0@@AAJ      & &y 1 11r)!rrQr,rrrr> subprocessrerrorsrrrr file_utilr rr unixccompilerr rr r rrRrrr(rrr&r get_versionsrrrrs  ###### "!!!!!&&&&&&((((((======== I G G G G G mG G G V@@@@@@@@@  .A.A.Ab222  r