<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>

]\                 @   s  d  d l  Z  d  d l Z d  d l m Z m Z m Z m Z m Z d  d l m	 Z	 m
 Z
 m Z d  d l m Z d Z y@ d  d l Z d Z e Z e j Z e j Z e j Z e j Z Wn e k
 r4yL d  d l Z d  d l Z d Z e Z e j Z e j Z e j Z e j Z Wn e k
 r/e j d  Yn XYn Xe rYe j e j e j e j  f Z! d d	   Z" d
 d   Z# d d   Z$ Gd d   d  Z% d d   Z& d d   Z' d d   Z( Gd d   d e	  Z) e&   d k re j* d  e) Z+ d  d l, m) Z) d  d l, m% Z% d S)    N)DistutilsExecErrorDistutilsPlatformErrorCompileErrorLibError	LinkError)	CCompilergen_preprocess_optionsgen_lib_options)logFTzWarning: Can't read registry to find the necessary compiler setting
Make sure that Python modules winreg, win32api or win32con are installed.c             C   s   y t  |  |  } Wn t k
 r+ d  SYn Xg  } d } xD y t | |  } Wn t k
 rc PYn X| j |  | d 7} q; W| S)Nr      )RegOpenKeyExRegError
RegEnumKeyappend)basekeyhandleLik r   1/opt/alt/python35/lib64/python3.5/msvccompiler.py	read_keys7   s    	r   c             C   s   y t  |  |  } Wn t k
 r+ d  SYn Xi  } d } xb y t | |  \ } } } Wn t k
 rl PYn X| j   } t |  | t |  <| d 7} q; W| S)Nr   r   )r   r   RegEnumValuelowerconvert_mbcs)r   r   r   dr   namevaluetyper   r   r   read_valuesH   s    	r    c             C   sG   t  |  d d   } | d  k	 rC y | d  }  Wn t k
 rB Yn X|  S)Ndecodembcs)getattrUnicodeError)sZdecr   r   r   r   ]   s    r   c               @   s@   e  Z d  Z d d   Z d d   Z d d   Z d d   Z d	 S)
MacroExpanderc             C   s   i  |  _  |  j |  d  S)N)macrosload_macros)selfversionr   r   r   __init__g   s    	zMacroExpander.__init__c             C   s@   x9 t  D]1 } t | |  } | r | | |  j d | <Pq Wd  S)Nz$(%s))HKEYSr    r'   )r)   Zmacropathr   r   r   r   r   r   	set_macrok   s
    zMacroExpander.set_macroc       
      C   s=  d | } |  j  d | d d  |  j  d | d d  d } |  j  d | d	  y9 | d
 k rv |  j  d | d  n |  j  d | d  Wn1 t k
 r } z t d   WYd  d  } ~ Xn Xd } xr t D]j } y t | |  } Wn t k
 r w Yn Xt | d  } t | d | | f  }	 |	 d |  j d <q Wd  S)Nz%Software\Microsoft\VisualStudio\%0.1fZVCInstallDirz	\Setup\VCZ
productdirZVSInstallDirz	\Setup\VSz Software\Microsoft\.NETFrameworkZFrameworkDirZinstallrootg      @ZFrameworkSDKDirzsdkinstallrootv1.1Zsdkinstallroota  Python 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\Productr   z%s\%sr*   z$(FrameworkVersion))	r.   KeyErrorr   r,   r   r   r   r    r'   )
r)   r*   ZvsbaseZnetexcpr   hr   r   r   r   r   r(   r   s*    
zMacroExpander.load_macrosc             C   s6   x/ |  j  j   D] \ } } | j | |  } q W| S)N)r'   itemsreplace)r)   r%   r   vr   r   r   sub   s    zMacroExpander.subN)__name__
__module____qualname__r+   r.   r(   r6   r   r   r   r   r&   f   s   r&   c              C   s   d }  t  j j |   } | d
 k r( d S| t |   } t  j | d   j d d  \ } } t | d  d   d } | d k r | d 7} t | d d   d } | d k r d	 } | d k r | | Sd  S)NzMSC v.r                g      $@r   )sysr*   findlensplitint)prefixr   r%   restZmajorVersionZminorVersionr   r   r   get_build_version   s    %
rH   c              C   sX   d }  t  j j |   } | d k r( d St  j j d |  } t  j | t |   |  S)Nz bit (r   Intel)r?   )rA   r*   rB   rC   )rF   r   jr   r   r   get_build_architecture   s    rL   c             C   sF   g  } x9 |  D]1 } t  j j |  } | | k r | j |  q W| S)N)osr-   normpathr   )pathsZreduced_pathsr1   Znpr   r   r   normalize_and_reduce_paths   s    rP   c               @   sm  e  Z d  Z d Z i  Z d g Z d d d g Z d g Z d g Z e e e e Z	 d Z
 d	 Z d
 Z d Z d Z Z d Z d d d d d  Z d d   Z d d d d  Z d d d d d d d d d  Z d d d d d  Z d d d d d d d d d d d d 
 Z d d   Z d d    Z d! d"   Z d d# d$  Z d% d&   Z d' d( d)  Z d* d+   Z d S),MSVCCompilerZmsvcz.cz.ccz.cppz.cxxz.rcz.mcz.resz.objz.libz.dllz%s%sz.exer   c             C   s   t  j |  | | |  t   |  _ t   |  _ |  j d k r |  j d k rj d |  _ t |  j  |  _ n	 d |  _ d |  j |  _	 n d |  j d |  _	 d |  _
 d  S)	NrI      zSoftware\Microsoft\VisualStudiozSoftware\Microsoft\DevstudiozVisual Studio version %szMicrosoft SDK compiler %sr:   F)r   r+   rH   _MSVCCompiler__versionrL   _MSVCCompiler__arch_MSVCCompiler__rootr&   _MSVCCompiler__macros_MSVCCompiler__productinitialized)r)   verbosedry_runforcer   r   r   r+      s    		zMSVCCompiler.__init__c             C   s  g  |  _  d t j k rf d t j k rf |  j d  rf d |  _ d |  _ d |  _ d |  _ d |  _ n |  j	 d  |  _  t
 |  j   d	 k r t d
 |  j   |  j d  |  _ |  j d  |  _ |  j d  |  _ |  j d  |  _ |  j d  |  _ |  j d  |  j d  y5 x. t j d j d  D] } |  j  j |  q.WWn t k
 r]Yn Xt |  j   |  _  d j |  j   t j d <d  |  _ |  j d k rd d d d d d g |  _ d d d d d d d g |  _ n9 d d d d d d g |  _ d d d d d d d g |  _ d d d g |  _ |  j d k rOd d d d g |  _ n d d d d d g |  _ d g |  _ d  |  _ d  S)!NZDISTUTILS_USE_SDKZMSSdkzcl.exezlink.exezlib.exezrc.exezmc.exer-   r   zxPython was built with %s, and extensions need to be built with the same version of the compiler, but it isn't installed.libinclude;rI   z/nologoz/Oxz/MDz/W3z/GXz/DNDEBUGz/Odz/MDdz/Z7z/D_DEBUGz/GS-z/DLLz/INCREMENTAL:NOrR   z/INCREMENTAL:noz/DEBUGz	/pdb:NoneT)_MSVCCompiler__pathsrM   environfind_execclinkerr\   rcmcget_msvc_pathsrC   r   rW   set_path_env_varrD   r   r/   rP   joinZpreprocess_optionsrT   compile_optionscompile_options_debugldflags_sharedrS   ldflags_shared_debugZldflags_staticrX   )r)   r1   r   r   r   
initialize   sR    	-					zMSVCCompiler.initialize c             C   s;  | d  k r d } g  } x| D]} t  j j |  \ } } t  j j |  d } | t  j j |  d   } | |  j k r t d |   | r t  j j |  } | |  j k r | j	 t  j j
 | | |  j   q | |  j k r| j	 t  j j
 | | |  j   q | j	 t  j j
 | | |  j   q W| S)Nrn   r   zDon't know how to compile %s)rM   r-   splitext
splitdriveisabssrc_extensionsr   basename_rc_extensionsr   rh   res_extension_mc_extensionsobj_extension)r)   Zsource_filenamesZ	strip_dir
output_dirZ	obj_namesZsrc_namer   extr   r   r   object_filenames8  s(     zMSVCCompiler.object_filenamesNc	             C   s  |  j  s |  j   |  j | | | | | |  }	 |	 \ } }
 } } } | pO g  } | j d  | rx | j |  j  n | j |  j  x|
 D]} y | | \ } } Wn t k
 r w Yn X| r t j	 j
 |  } | |  j k r d | } n| |  j k rd | } n| |  j k r| } d | } y) |  j |  j g | | g | g  Wq t k
 r} z t |   WYd  d  } ~ Xq Xq n| |  j k rt j	 j |  } t j	 j |  } y |  j |  j g d | d | g | g  t j	 j t j	 j |   \ } } t j	 j | | d  } |  j |  j g d | g | g  Wq t k
 r} z t |   WYd  d  } ~ Xq Xq n t d | | f   d	 | } y- |  j |  j g | | | | g |  Wq t k
 r} z t |   WYd  d  } ~ Xq Xq W|
 S)
Nz/cz/Tcz/Tpz/foz-hz-rz.rcz"Don't know how to compile %s to %sz/Fo)rX   rm   Z_setup_compiler   extendrj   ri   r/   rM   r-   abspath_c_extensions_cpp_extensionsrt   spawnrd   r   r   rv   dirnamere   ro   rs   rh   rb   )r)   Zsourcesrx   r'   Zinclude_dirsdebugextra_preargsextra_postargsZdependsZcompile_infoobjectsZpp_optsZbuildZcompile_optsobjsrcry   Z	input_optZ
output_optmsgZh_dirZrc_dirr   _Zrc_filer   r   r   compileW  sj    	

#$$#
#zMSVCCompiler.compilec       	      C   s   |  j  s |  j   |  j | |  \ } } |  j | d | } |  j | |  r | d | g } | ri y |  j |  j g |  Wq t k
 r } z t |   WYd  d  } ~ Xq Xn t	 j
 d |  d  S)Nrx   z/OUT:zskipping %s (up-to-date))rX   rm   _fix_object_argslibrary_filename
_need_linkr   r\   r   r   r
   r   )	r)   r   Zoutput_libnamerx   r   target_langoutput_filenameZlib_argsr   r   r   r   create_static_lib  s    	
	"zMSVCCompiler.create_static_libc             C   sr  |  j  s |  j   |  j | |  \ } } |  j | | |  } | \ } } } | rl |  j d t |   t |  | | |  } | d  k	 r t j j	 | |  } |  j
 | |  r^| t j k r |	 r |  j d d   } q|  j d d   } n |	 r|  j } n	 |  j } g  } x% | p"g  D] } | j d |  q#W| | | | d | g } | d  k	 rt j j t j j |   \ } } t j j	 t j j | d  |  j |   } | j d |  |
 r|
 | d  d  <| r| j |  |  j t j j |   y |  j |  j g |  Wqnt k
 rZ} z t |   WYd  d  } ~ XqnXn t j d |  d  S)Nz5I don't know what to do with 'runtime_library_dirs': r   z/EXPORT:z/OUT:r   z/IMPLIB:zskipping %s (up-to-date))rX   rm   r   Z_fix_lib_argswarnstrr	   rM   r-   rh   r   r   Z
EXECUTABLErl   rk   r   ro   rs   r   r   r{   Zmkpathr   rc   r   r   r
   r   )r)   Ztarget_descr   r   rx   Z	librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsr   r   r   Z
build_tempr   Z
fixed_argsZlib_optsZldflagsZexport_optsZsymZld_argsZdll_nameZdll_extZimplib_filer   r   r   r   link  sV    	
						"zMSVCCompiler.linkc             C   s   d | S)Nz	/LIBPATH:r   )r)   dirr   r   r   library_dir_option  s    zMSVCCompiler.library_dir_optionc             C   s   t  d   d  S)Nz<don't know how to set runtime library search path for MSVC++)r   )r)   r   r   r   r   runtime_library_dir_option  s    z'MSVCCompiler.runtime_library_dir_optionc             C   s   |  j  |  S)N)r   )r)   r\   r   r   r   library_option  s    zMSVCCompiler.library_optionc             C   s   | r | d | g } n	 | g } xW | D]K } xB | D]: } t  j j | |  j |   } t  j j |  r6 | Sq6 Wq) Wd  Sd  S)NZ_d)rM   r-   rh   r   exists)r)   dirsr\   r   Z	try_namesr   r   Zlibfiler   r   r   find_library_file#  s    	zMSVCCompiler.find_library_filec             C   s   xH |  j  D]= } t j j t j j |  |  } t j j |  r
 | Sq
 WxU t j d j d  D]= } t j j t j j |  |  } t j j |  rb | Sqb W| S)NZPathr^   )r_   rM   r-   rh   r|   isfiler`   rD   )r)   Zexer1   fnr   r   r   ra   5  s    	!!zMSVCCompiler.find_exeZx86c             C   s   t  s
 g  S| d } |  j d k r< d |  j |  j f } n d |  j | f } x` t D]X } t | |  } | rV |  j d k r |  j j | |  j d  S| | j d  SqV W|  j d k r x8 t D]0 } t | d |  j  d  k	 r |  j d  Pq Wg  S)	Nz dirsrR   z6%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directoriesz?%s\6.0\Build System\Components\Platforms\Win32 (%s)\Directoriesr^   r:   z%s\6.0zIt 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_regrS   rU   r,   r    rV   r6   rD   r   )r)   r-   platformr   r   r   r   r   r   rf   K  s(    
zMSVCCompiler.get_msvc_pathsc             C   sM   | d k r |  j  d  } n |  j  |  } | rI d j |  t j | <d  S)Nr\   Zlibraryr^   )rf   rh   rM   r`   )r)   r   r1   r   r   r   rg   o  s
    zMSVCCompiler.set_path_env_var)r7   r8   r9   Zcompiler_typeZexecutablesr}   r~   rt   rv   rr   ru   rw   Zstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZexe_extensionr+   rm   rz   r   r   r   r   r   r   r   ra   rf   rg   r   r   r   r   rQ      sN   			
BVF$rQ   g       @z3Importing new compiler from distutils.msvc9compiler)rQ   )r&   )-rA   rM   Zdistutils.errorsr   r   r   r   r   Zdistutils.ccompilerr   r   r	   Z	distutilsr
   r   winregZhkey_modZ	OpenKeyExr   ZEnumKeyr   Z	EnumValuer   errorr   ImportErrorZwin32apiZwin32coninfoZ
HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEZHKEY_CLASSES_ROOTr,   r   r    r   r&   rH   rL   rP   rQ   r   ZOldMSVCCompilerZdistutils.msvc9compilerr   r   r   r   <module>   sX   (						
	- 