관리-도구
편집 파일: msvccompiler.cpython-39.opt-1.pyc
a �������f�[����������������������@���s~��d�Z�ddlZddlZddlmZmZmZmZmZ�ddl m Z mZ�ddlm Z �dZz,ddlZdZeZejZejZejZejZW�nd�ey����z4ddlZddlZdZeZejZejZejZejZW�n�ey����e �d��Y�n0�Y�n0�er�ejejejej fZ!d d ��Z"dd��Z#d d��Z$G�dd��d�Z%dd��Z&dd��Z'dd��Z(G�dd��de �Z)e&��dk�rze �*d��e)Z+ddl,m)Z)�ddl,m%Z%�dS�)z�distutils.msvccompiler Contains MSVCCompiler, an implementation of the abstract CCompiler class for the Microsoft Visual Studio. �����N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError� LinkError)� CCompiler�gen_lib_options)�logFTz�Warning: Can't read registry to find the necessary compiler setting Make sure that Python modules winreg, win32api or win32con are installed.c�����������������C���sj���zt�|�|�}W�n�ty"���Y�dS�0�g�}d}zt||�}W�n�tyP���Y�qfY�n0�|�|��|d7�}q,|S�)zReturn list of registry keys.Nr�������)�RegOpenKeyEx�RegError� RegEnumKey�append)�base�key�handle�L�i�k��r����F/usr/lib/python3.9/site-packages/setuptools/_distutils/msvccompiler.py� read_keys7���s���� r���c�����������������C���s~���zt�|�|�}W�n�ty"���Y�dS�0�i�}d}zt||�\}}}W�n�tyV���Y�qzY�n0�|���}t|�|t|�<�|d7�}q,|S�)zXReturn dict of registry keys and values. All names are converted to lowercase. Nr���r ���)r���r����RegEnumValue�lower�convert_mbcs)r���r���r����dr����name�value�typer���r���r����read_valuesH���s���� r���c�����������������C���s8���t�|�dd��}|d�ur4z|d�}�W�n�ty2���Y�n0�|�S�)N�decode�mbcs)�getattr�UnicodeError)�sZdecr���r���r���r���]���s����r���c�������������������@���s,���e�Zd�Zdd��Zdd��Zdd��Zdd��Zd S�) � MacroExpanderc�����������������C���s���i�|�_�|��|��d�S��N)�macros�load_macros)�self�versionr���r���r����__init__g���s����zMacroExpander.__init__c�����������������C���s2���t�D�](}t||�}|r||�|�jd|�<��q.qd�S�)Nz$(%s))�HKEYSr���r'���)r)���Zmacro�pathr���r���r���r���r���r���� set_macrok���s ���� zMacroExpander.set_macroc����������� ��� ���C���s����d|�}|���d|d�d��|���d|d�d��d}|���d|d ��z*|d krX|���d|d��n|���d|d ��W�n,�ty��}�ztd��W�Y�d�}~n d�}~0�0�d}tD�]T}zt||�}W�n�ty����Y�q�Y�n0�t|d�}t|d||f��} | d�|�jd<�q�d�S�)Nz%Software\Microsoft\VisualStudio\%0.1fZVCInstallDirz \Setup\VCZ productdirZVSInstallDirz \Setup\VSz Software\Microsoft\.NETFrameworkZFrameworkDirZinstallrootg������@ZFrameworkSDKDirzsdkinstallrootv1.1Zsdkinstallroota��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*���ZvsbaseZnet�exc�pr����hr���r���r���r���r���r(���r���s,����� zMacroExpander.load_macrosc�����������������C���s$���|�j����D�]\}}|�||�}q |S�r&���)r'����items�replace)r)���r$���r����vr���r���r����sub����s����zMacroExpander.subN)�__name__� __module__�__qualname__r+���r.���r(���r6���r���r���r���r���r%���f���s���r%���c������������������C���s����d}�t�j�|��}|dkrdS�|t|���}t�j|d���dd�\}}t|dd���d�}|dkrf|d7�}t|d d ���d�}|dkr�d}|dkr�||�S�dS�) z�Return 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���)�sysr*����find�len�split�int)�prefixr���r$����restZmajorVersionZminorVersionr���r���r����get_build_version����s����rH���c������������������C���s@���d}�t�j�|��}|dkrdS�t�j�d|�}t�j|t|���|��S�)zUReturn the processor architecture. Possible results are "Intel" or "AMD64". z bit (r:����Intel�))rA���r*���rB���rC���)rF���r����jr���r���r����get_build_architecture����s����rL���c�����������������C���s0���g�}|�D�]"}t�j�|�}||vr|�|��q|S�)znReturn a list of normalized paths with duplicates removed. The current order of paths is maintained. )�osr-����normpathr���)�pathsZ reduced_pathsr1���Znpr���r���r����normalize_and_reduce_paths����s����rP���c���������������� ���@���s����e�Zd�ZdZdZi�ZdgZg�d�ZdgZdgZ ee�e�e �Z dZdZd Z d Zd�ZZdZd+dd�Zdd��Zd,dd�Zd-dd�Zd.dd�Zd/dd�Zdd��Zdd��Zd d!��Zd0d"d#�Zd$d%��Zd1d'd(�Zd)d*��ZdS�)2�MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++, as defined by the CCompiler abstract class.Zmsvcz.c)z.ccz.cppz.cxx�.rcz.mcz.resz.objz.libz.dllz%s%sz.exer���c�����������������C���sv���t��|�|||��t��|�_t��|�_|�jdkr\|�jdkrHd|�_t|�j�|�_nd|�_d|�j�|�_ nd|�jd��|�_ d|�_ d�S�) NrI�������zSoftware\Microsoft\VisualStudiozSoftware\Microsoft\DevstudiozVisual Studio version %szMicrosoft 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���� zMSVCCompiler.__init__c�����������������C���s���g�|�_�dtjv�rDdtjv�rD|��d�rDd|�_d|�_d|�_d|�_d|�_nx|�� d�|�_�t |�j��d krltd |�j���|��d�|�_|��d�|�_|��d�|�_|��d�|�_|��d�|�_|�� d��|�� d��z&tjd��d �D�]}|�j��|��q�W�n�ty����Y�n0�t|�j��|�_�d �|�j��tjd<�d�|�_|�jdk�r<g�d�|�_g�d�|�_ng�d�|�_g�d�|�_g�d�|�_|�jdk�rrg�d�|�_n g�d�|�_dg|�_d|�_d�S�)NZDISTUTILS_USE_SDKZMSSdkzcl.exezlink.exezlib.exezrc.exezmc.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.�libZinclude�;rI���)�/nologo�/Ox�/MD�/W3�/GX�/DNDEBUG)r_����/Od�/MDdrb���rc����/Z7�/D_DEBUG)r_���r`���ra���rb����/GS-rd���)r_���re���rf���rb���ri���rg���rh���)�/DLLr_���z/INCREMENTAL:NOrS���)rj���r_����/INCREMENTAL:no�/DEBUG)rj���r_���rk���z /pdb:Nonerl���r_���T)�_MSVCCompiler__pathsrM����environ�find_exe�cc�linkerr]����rc�mc�get_msvc_pathsrC���r���rX����set_path_env_varrD���r���r/���rP����joinZpreprocess_optionsrU����compile_options�compile_options_debug�ldflags_sharedrT����ldflags_shared_debugZldflags_staticrY���)r)���r1���r���r���r���� initialize����sL����� zMSVCCompiler.initialize��c�����������������C���s����|d�u�rd}g�}|D�]�}t�j�|�\}}t�j�|�d�}|t�j�|�d���}||�jvrbtd|���|rrt�j�|�}||�jv�r�|� t�j� |||�j����q||�jv�r�|� t�j� |||�j����q|� t�j� |||�j ����q|S�)Nr|���r ���zDon't know how to compile %s)rM���r-����splitext� splitdrive�isabs�src_extensionsr����basename�_rc_extensionsr���rv���� res_extension�_mc_extensions� obj_extension)r)���Zsource_filenamesZ strip_dir� output_dirZ obj_namesZsrc_namer����extr���r���r����object_filenames8��s,���� � ��zMSVCCompiler.object_filenamesNc �����������������C���st��|�j�s|�����|��||||||�} | \}} }}}|p6g�} | �d��|rT| �|�j��n| �|�j��| D��]}z||�\}}W�n�ty����Y�qdY�n0�|r�tj � |�}||�jv�r�d|�}�nX||�jv�r�d|�}�nB||�j v��r<|}d|�}z"|��|�jg|�|g�|g���W�qd�t�y6�}�zt|��W�Y�d�}~qdd�}~0�0�qdn�||�jv��r�tj �|�}tj �|�}zl|��|�jgd|d|g�|g���tj �tj �|��\}}tj �||d��}|��|�jgd|�g�|g���W�qd�t�y��}�zt|��W�Y�d�}~qdd�}~0�0�qdntd||f���d |�}z&|��|�jg| �|�||g�|���W�qd�t�yl�}�zt|��W�Y�d�}~qdd�}~0�0�qd| S�) Nz/cz/Tcz/Tpz/foz-hz-rrR���z"Don't know how to compile %s to %sz/Fo)rY���r{���Z_setup_compiler����extendrx���rw���r/���rM���r-����abspath� _c_extensions�_cpp_extensionsr�����spawnrr���r���r���r�����dirnamers���r}���r����rv���rp���)r)���Zsourcesr����r'���Zinclude_dirs�debug� extra_preargs�extra_postargsZdependsZcompile_info�objectsZpp_optsZbuildZcompile_opts�obj�srcr����Z input_optZ output_opt�msgZh_dirZrc_dirr����_Zrc_filer���r���r����compileW��s����� � �� �� �� ��� zMSVCCompiler.compilec����������� ��� ���C���s����|�j�s|�����|��||�\}}|�j||d�}|��||�r�|d|�g�}|rJz|��|�jg|���W�q��ty��}�zt|��W�Y�d�}~q�d�}~0�0�nt � d|��d�S�)N)r�����/OUT:�skipping %s (up-to-date))rY���r{����_fix_object_args�library_filename� _need_linkr����r]���r���r���r ���r����) r)���r����Zoutput_libnamer����r�����target_lang�output_filenameZlib_argsr����r���r���r����create_static_lib���s����� zMSVCCompiler.create_static_libc�������������� ���C���s���|�j�s|�����|��||�\}}|��|||�}|\}}}|rL|��dt|����t|�|||�}|d�urptj� ||�}|�� ||��r�|tjkr�| r�|�j dd���}q�|�jdd���}n| r�|�j }n|�j}g�}|p�g�D�]}|�d|���q�||�|�|�d|�g�}|d�u�rHtj�tj�|��\}}tj� tj�|d��|��|��}|�d|���| �rZ| |d�d�<�|�rj|�|��|��tj�|���z|��|�jg|���W�n.�t�y��}�zt|��W�Y�d�}~n d�}~0�0�nt�d|��d�S�)Nz5I don't know what to do with 'runtime_library_dirs': r ���z/EXPORT:r����r���z/IMPLIB:r����)rY���r{���r����Z _fix_lib_args�warn�strr���rM���r-���rv���r����r���Z EXECUTABLErz���ry���r���r}���r����r����r����r����Zmkpathr����rq���r���r���r ���r����)r)���Ztarget_descr����r����r����Z librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsr����r����r����Z build_tempr����Z fixed_argsZlib_optsZldflagsZexport_optsZsymZld_argsZdll_nameZdll_extZimplib_filer����r���r���r����link���sh����� �� �� �� zMSVCCompiler.linkc�����������������C���s���d|�S�)Nz /LIBPATH:r����r)����dirr���r���r����library_dir_option��s����zMSVCCompiler.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����runtime_library_dir_option��s�����z'MSVCCompiler.runtime_library_dir_optionc�����������������C���s ���|���|�S�r&���)r����)r)���r]���r���r���r����library_option��s����zMSVCCompiler.library_optionc�����������������C���s\���|r|d�|g}n|g}|D�]:}|D�]0}t�j�||��|��}t�j�|�r$|����S�q$qd�S�)NZ_d)rM���r-���rv���r�����exists)r)����dirsr]���r����Z try_namesr����r���Zlibfiler���r���r����find_library_file#��s����zMSVCCompiler.find_library_filec�����������������C���sz���|�j�D�].}tj�tj�|�|�}tj�|�r|��S�qtjd��d�D�].}tj�tj�|�|�}tj�|�rF|��S�qF|S�)a���Return 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^���)rm���rM���r-���rv���r�����isfilern���rD���)r)���Zexer1����fnr���r���r���ro���5��s���� zMSVCCompiler.find_exe�x86c�����������������C���s����t�sg�S�|d�}|�jdkr,d|�j|�jf�}nd|�j|f�}tD�]H}t||�}|r>|�jdkrt|�j�||���d���S�||��d���S�q>|�jdkr�tD�]&}t|d|�j��dur�|��d ���q�q�g�S�) z�Get 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 dirsrS���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.0Nz�It 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_regrT���rV���r,���r���rW���r6���rD���r����)r)���r-����platformr���r���r���r���r���r���rt���K��s,���� �� zMSVCCompiler.get_msvc_pathsc�����������������C���s6���|dkr|���d�}n |���|�}|r2d�|�tj|<�dS�)z�Set environment variable 'name' to an MSVC path type value. This is equivalent to a SET command prior to execution of spawned commands. r]���Zlibraryr^���N)rt���rv���rM���rn���)r)���r���r1���r���r���r���ru���o��s ���� zMSVCCompiler.set_path_env_var)r���r���r���)r���r|���)NNNr���NNN)Nr���N) NNNNNr���NNNN)r���)r����)r7���r8���r9����__doc__Z compiler_typeZexecutablesr����r����r����r����r����r����r����Zstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ exe_extensionr+���r{���r����r����r����r����r����r����r����r����ro���rt���ru���r���r���r���r���rQ�������s`����� B��� ��� X���� ����������� S $rQ���g������ @z3Importing new compiler from distutils.msvc9compiler)rQ���)r%���)-r����rA���rM���Zdistutils.errorsr���r���r���r���r���Zdistutils.ccompilerr���r���Z distutilsr ���r�����winregZhkey_modZ OpenKeyExr���ZEnumKeyr ���Z EnumValuer����errorr����ImportErrorZwin32apiZwin32con�infoZ HKEY_USERS�HKEY_CURRENT_USER�HKEY_LOCAL_MACHINEZHKEY_CLASSES_ROOTr,���r���r���r���r%���rH���rL���rP���rQ���r����ZOldMSVCCompilerZdistutils.msvc9compilerr���r���r���r����<module>���s`��� � - ���9