ef\ZdZddlZddlZddlZddlmZmZmZmZm Z ddl m Z m Z ddl mZdZ ddlZdZeZejZejZejZejZnP#e$rH ddlZddlZdZeZejZejZejZejZn#e$rejd YnwxYwYnwxYwerejejej ej!fZ"ej#d e$d Z%d Z&d Z'GddZ(dZ)dZ*dZ+Gdde Z,e)dkr ej-de,Z.ddl/m,Z,ddl/m(Z(dSdS)zdistutils.msvccompiler Contains MSVCCompiler, an implementation of the abstract CCompiler class for the Microsoft Visual Studio. N)DistutilsExecErrorDistutilsPlatformError CompileErrorLibError LinkError) CCompilergen_lib_options)logFTzWarning: Can't read registry to find the necessary compiler setting Make sure that Python modules winreg, win32api or win32con are installed.zmsvccompiler is deprecated and slated to be removed in the future. Please discontinue use or file an issue with pypa/distutils describing your use case.c t||}n#t$rYdSwxYwg}d} t||}n#t$rYnwxYw|||dz }=|S)zReturn list of registry keys.NrTr) RegOpenKeyExRegError RegEnumKeyappend)basekeyhandleLiks /builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/setuptools/_distutils/msvccompiler.py read_keysrJsdC(( tt A A 61%%AA    E    Q  Hs !!; AAc t||}n#t$rYdSwxYwi}d} t||\}}}n#t$rYn=wxYw|}t ||t |<|dz }_|S)zXReturn dict of registry keys and values. All names are converted to lowercase. NrTr)r r RegEnumValuelower convert_mbcs)rrrdrnamevaluetypes r read_valuesr!\s dC(( tt A A  ,VQ 7 7 D%    E zz|| ,U 3 3,t   Q Hs !!? A  A cft|dd}| |d}n#t$rYnwxYw|S)Ndecodembcs)getattr UnicodeError)sdecs rrrrsQ !Xt $ $C  F AA    D  Hs ! ..c&eZdZdZdZdZdZdS) MacroExpanderc>i|_||dSN)macros load_macros)selfversions r__init__zMacroExpander.__init__}s#  !!!!!cjtD]*}t||}|r|||jd|z<dS+dS)Nz$(%s))HKEYSr!r-)r/macropathrrrs r set_macrozMacroExpander.set_macrosR  DD$''A /0v GeO,   r2c6d|z}|d|dzd|d|dzdd}|d|d  |d kr|d |d n|d |d n#t$rtdwxYwd}tD]h} t ||}n#t $rY wxYwt |d}t|d||}|d|j d<idS)Nz%Software\Microsoft\VisualStudio\%0.1f VCInstallDirz \Setup\VC productdir VSInstallDirz \Setup\VSz Software\Microsoft\.NETFramework FrameworkDir installrootg@FrameworkSDKDirzsdkinstallrootv1.1sdkinstallrootaPython was built with Visual Studio 2003; extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2003 was not found on this system. If you have Cygwin installed, you can try compiling with MingW32, by passing "-c mingw32" to setup.py.z.Software\Microsoft\NET Framework Setup\Productrz{}\{}r0z$(FrameworkVersion)) r7KeyErrorrr4r rrr!formatr-) r/r0vsbasenetprhrrs rr.zMacroExpander.load_macrossh9GC ~v ' > >D  q))    Q""CD(//!S"9"9::A129DK- . . > >s5B B$3C CCcp|jD]\}}|||}|Sr,)r-itemsreplace)r/r'rvs rsubzMacroExpander.subs;K%%''  DAq !QAAr2N)__name__ __module__ __qualname__r1r7r.rJr2rr*r*|sP""">>>:r2r*cvd}tj|}|dkrdS|t|z}tj|ddd\}}t |dddz }|dkr|dz }t |d d d z }|dkrd }|dkr||zSdS) zReturn the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in sys.version. For earlier versions, assume the compiler is MSVC 6. zMSC v.N r g$@r)sysr0findlensplitint)prefixrr'rest majorVersion minorVersions rget_build_versionr`s F   ABwwq CKKAk!""o##C++GAtq"v;;?Lr q1v;;%Lq ql** 4r2cd}tj|}|dkrdStjd|}tj|t|z|S)zUReturn the processor architecture. Possible results are "Intel" or "AMD64". z bit (rPIntel))rWr0rXrY)r\rjs rget_build_architectureres_ F   ABwww a  A ;q3v;;* ++r2cg}|D]:}tj|}||vr||;|S)znReturn a list of normalized paths with duplicates removed. The current order of paths is maintained. )osr6normpathr)paths reduced_pathsrDnps rnormalize_and_reduce_pathsrlsS M %% W  a  ] " "   $ $ $ r2ceZdZdZdZiZdgZgdZdgZdgZ eezeze zZ dZ dZ d Z d Zd xZZd Zdfd ZdZddZ d dZ d!dZ d"dZdZdZdZd#dZdZd$dZdZxZS)% MSVCCompilerztConcrete class that implements an interface to Microsoft Visual C++, as defined by the CCompiler abstract class.msvcz.c)z.ccz.cppz.cxx.rcz.mcz.resz.objz.libz.dllz%s%sz.exercht|||t|_t |_|jdkrC|jdkr!d|_t|j|_nd|_d|jz|_ nd|jdzz|_ d|_ dS) NrbzSoftware\Microsoft\VisualStudiozSoftware\Microsoft\DevstudiozVisual Studio version %szMicrosoft SDK compiler %srQF) superr1r`_MSVCCompiler__versionre_MSVCCompiler__arch_MSVCCompiler__rootr*_MSVCCompiler__macros_MSVCCompiler__product initialized)r/verbosedry_runforce __class__s rr1zMSVCCompiler.__init__s '5111*,,,.. ;' ! !~""@ -dn = = = 7$.HDNN9DNQQ  (X(X(XD % %)))D % )ksAF F#"F#c|d}g}|D]s}tj|\}}tj|d}|tj|d}||jvrt d|z|rtj|}||jvr<| tj |||j z||j vr=| tj |||j z8| tj |||j zu|S)NrrzDon't know how to compile %s)rgr6splitext splitdriveisabssrc_extensionsrbasename_rc_extensionsrr res_extension_mc_extensions obj_extension)r/source_filenames strip_dir output_dir obj_namessrc_namerexts robject_filenameszMSVCCompiler.object_filenamesdsf  J ( V VH'**844KT37%%d++A.D d++--.D$---##AH#LMMM .w''--d)))  j$AS:S!T!TUUUU+++  j$AS:S!T!TUUUU  j$AS:S!T!TUUUUr2Nc |js||||||||} | \}} }} } |pg} | d|r| |jn| |j| D]I} | |\}}n#t$rYwxYw|rtj |}||j vrd|z}n||j vrd|z}n||j vrQ|}d|z} ||jg| z|gz|gzn!#t $r}t#|d}~wwxYw||jvrtj |}tj |} ||jgd|d|gz|gztj tj |\}}tj ||dz}||jgd|zgz|gzn!#t $r}t#|d}~wwxYwt#d||d |z} ||jg| z| z||gz|z*#t $r}t#|d}~wwxYw| S) Nz/cz/Tcz/Tpz/foz-hz-rrpz"Don't know how to compile {} to {}z/Fo)ryr_setup_compilerextendrrr@rgr6abspath _c_extensions_cpp_extensionsrspawnrrrrdirnamerrrrrAr)r/sourcesrr- include_dirsdebug extra_preargsextra_postargsdepends compile_infoobjectspp_optsbuild compile_optsobjsrcr input_opt output_optmsgh_dirrc_dirr_rc_files rcompilezMSVCCompiler.compile}sw  OO   **  gw  ;G7%$* D!!!  6    : ; ; ; ;    4 5 5 5A (A (C  :SS     +gooc**d(((!CK ,,,!CK +++ "S[ ,JJy72j\AYKOPPPP),,,&s+++,+++,,-- ,JJyD%v+FF#NOOO g..rw/?/?/D/DEEGD! gll64%<@@GJJyECK=8G9DEEEE),,,&s+++,#8??SIIJ ( WI"#!*-.% %& ( ( ("3''' (s[ B  B-,B-&D)) E3EEB.I I! II!)J:: KKKc|js||||\}}|||}|||rN|d|zgz}|r ||jg|zdS#t$r}t|d}~wwxYwtj d|dS)N)r/OUT:skipping %s (up-to-date)) ryr_fix_object_argslibrary_filename _need_linkrrrrr r) r/routput_libnamerr target_langoutput_filenamelib_argsrs rcreate_static_libzMSVCCompiler.create_static_libs  OO    $ 5 5gz J J*//:/VV ??7O 4 4 C'O";!<W=XX )&(g&6&6G$$_55''#7!gllGOOGAJ//1F1Fx1P1P zK7888 ,+  /~... KK88 9 9 9 % DK=7233333% % % %nn$ % I0/ B B B B Bs<I I:&I55I:c d|zS)Nz /LIBPATH:rNr/dirs rlibrary_dir_optionzMSVCCompiler.library_dir_optionBs S  r2c td)Nz>'**#"NNNNN# # 4r2c|jD]b}tjtj||}tj|r|cSctjddD]b}tjtj||}tj|r|cSc|S)aReturn path to an MSVC executable program. Tries to find the program in several places: first, one of the MSVC program search paths from the registry; next, the directories in the PATH environment variable. If any of those work, return an absolute path that is known to exist. If none of them work, just return the original program name, 'exe'. Pathr)rrgr6rrisfilerrZ)r/exerDfns rrzMSVCCompiler.find_exe_s  Abgooa00#66Bw~~b!!   F#))#..  Abgooa00#66Bw~~b!!    r2x86ctsgS|dz}|jdkr!d|j|j}n |jd|d}tD]q}t ||}|r]|jdkr5|j||dcS||dcSr|jdkr9tD]1}t |d|jz| d n2gS) zGet a list of devstudio directories (include, lib or path). Return a list of strings. The list will be empty if unable to access the registry or appropriate registry keys not found. z dirsrrz8{}\{:0.1f}\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directoriesz.\6.0\Build System\Components\Platforms\Win32 (z )\DirectoriesrrQz%s\6.0NzIt seems you have Visual Studio 6 installed, but the expected registry settings are not present. You must at least run the Visual Studio GUI once so that these entries are created.) _can_read_regrtrArvr4r!rwrJrZr)r/r6platformrrrs rrzMSVCCompiler.get_msvc_pathsusL  Ig~ >Q  MTT CC/3kkk888E   . .DD#&&A .>Q&&=,,QtW55;;C@@@@@T7==-----  . >Q    tY%<==III= EJ r2c|dkr|d}n||}|r$d|tj|<dSdS)zSet environment variable 'name' to an MSVC path type value. This is equivalent to a SET command prior to execution of spawned commands. rlibraryrN)rrrgr)r/rrDs rrzMSVCCompiler.set_path_env_varsc 5==##I..AA##D))A  +"xx{{BJt    + +r2)rrr)rr)NNNrNNN)NrN) NNNNNrNNNN)r)r) rKrLrM__doc__ compiler_type executablesrrrrrrrstatic_lib_extensionshared_lib_extensionstatic_lib_formatshared_lib_format exe_extensionr1rrrrrrrrrrrr __classcell__)r}s@rrnrns33MKFM---OWNWN#_4~EVNMM!!,22)M!!!!!!$O O O f8\\\\~NRCCCC0!NCNCNCNCh!!!   ***$,((((T + + + + + + +r2rng @z3Importing new compiler from distutils.msvc9compiler)rn)r*)0r rWrgwarningserrorsrrrrr ccompilerr r _logr r winreghkey_mod OpenKeyExr EnumKeyr EnumValuererrorr ImportErrorwin32apiwin32coninfo HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOTr4rDeprecationWarningrr!rr*r`rerlrnrOldMSVCCompilerdistutils.msvc9compilerrNr2rr+s 21111111  MMMMH#LJ#L|HH     , ( , >     2     *"#"  E 4    $   ,   ,,,,,,,,^4 , , ,   I+I+I+I+I+9I+I+I+X# CICDDD"O44444465555555 s5$AB (BB BB BB B