????

Your IP : 3.146.176.29


Current Path : /lib/python3.10/distutils/__pycache__/
Upload File :
Current File : //lib/python3.10/distutils/__pycache__/msvccompiler.cpython-310.pyc

o

��bc�[�@s�dZddlZddlZddlmZmZmZmZmZddl	m
Z
mZddlm
Z
dZzddlZdZeZejZejZejZejZWn2eypzddlZddlZdZeZejZejZejZejZWneyme
�d�YnwYnwer}ejejejej fZ!d	d
�Z"dd�Z#d
d�Z$Gdd�d�Z%dd�Z&dd�Z'dd�Z(Gdd�de
�Z)e&�dkr�e
�*d�e)Z+ddl,m)Z)ddl,m%Z%dSdS)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.cCsfzt||�}Wn
tyYdSwg}d}	zt||�}Wn
ty(Y|Sw|�|�|d7}q)zReturn list of registry keys.NrT�)�RegOpenKeyEx�RegError�
RegEnumKey�append)�base�key�handle�L�i�k�r�-/usr/lib/python3.10/distutils/msvccompiler.py�	read_keys7s"��
�rcCszzt||�}Wn
tyYdSwi}d}	z
t||�\}}}Wn
ty+Y|Sw|��}t|�|t|�<|d7}q)zXReturn dict of registry keys and values.

    All names are converted to lowercase.
    NrTr
)rr�RegEnumValue�lower�convert_mbcs)rrr�dr�name�value�typerrr�read_valuesHs$���rcCs<t|dd�}|durz|d�}W|StyY|Sw|S)N�decode�mbcs)�getattr�UnicodeError)�s�decrrrr]s
��rc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
MacroExpandercCsi|_|�|�dS�N)�macros�load_macros)�self�versionrrr�__init__gszMacroExpander.__init__cCs4tD]}t||�}|r|||jd|<dSqdS)Nz$(%s))�HKEYSrr()r*�macro�pathrrrrrr�	set_macroks
��zMacroExpander.set_macroc

Cs�d|}|�d|dd�|�d|dd�d}|�d|d	�z|d
kr,|�d|d�n|�d|d
�WntyD}ztd��d}~wwd}tD](}zt||�}Wn	ty[YqIwt|d�}t|d||f�}	|	d|jd<qIdS)Nz%Software\Microsoft\VisualStudio\%0.1f�VCInstallDirz	\Setup\VC�
productdir�VSInstallDirz	\Setup\VSz Software\Microsoft\.NETFramework�FrameworkDir�installrootg@�FrameworkSDKDirzsdkinstallrootv1.1�sdkinstallrootaPython 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%s\%sr+z$(FrameworkVersion))	r0�KeyErrorrr-rrr
rr()
r*r+�vsbase�net�exc�pr�hrrrrrr)rs6�����
�zMacroExpander.load_macroscCs$|j��D]
\}}|�||�}q|Sr')r(�items�replace)r*r$r�vrrr�sub�szMacroExpander.subN)�__name__�
__module__�__qualname__r,r0r)rArrrrr&fs
r&cCs�d}tj�|�}|dkrdS|t|�}tj|d��dd�\}}t|dd��d}|dkr3|d7}t|d	d
��d}|dkrCd}|dkrK||SdS)
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)�prefixrr$�rest�majorVersion�minorVersionrrr�get_build_version�srUcCs@d}tj�|�}|dkrdStj�d|�}tj|t|�|�S)zUReturn the processor architecture.

    Possible results are "Intel" or "AMD64".
    z bit (rE�Intel�))rLr+rMrN)rQr�jrrr�get_build_architecture�srYcCs0g}|D]}tj�|�}||vr|�|�q|S)znReturn a list of normalized paths with duplicates removed.

    The current order of paths is maintained.
    )�osr/�normpathr)�paths�
reduced_pathsr<�nprrr�normalize_and_reduce_paths�s
�r_c@s�eZdZdZdZiZdgZgd�ZdgZdgZ	eeee	Z
dZdZd	Z
d
ZdZZdZd+dd�Zdd�Z	
	d,dd�Z	
	d-dd�Z		
	d.dd�Z						
				d/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.�msvcz.c)z.ccz.cppz.cxx�.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCsvt�||||�t�|_t�|_|jdkr.|jdkr$d|_t|j�|_nd|_d|j|_	nd|jd|_	d|_
dS)	NrV�zSoftware\Microsoft\VisualStudiozSoftware\Microsoft\DevstudiozVisual Studio version %szMicrosoft SDK compiler %srFF)rr,rU�_MSVCCompiler__versionrY�_MSVCCompiler__arch�_MSVCCompiler__rootr&�_MSVCCompiler__macros�_MSVCCompiler__product�initialized)r*�verbose�dry_run�forcerrrr,�s


zMSVCCompiler.__init__cCs�g|_dtjvr"dtjvr"|�d�r"d|_d|_d|_d|_d|_n<|�	d�|_t
|j�d	kr6td
|j��|�d�|_|�d�|_|�d�|_|�d�|_|�d�|_|�
d�|�
d�ztjd�d
�D]}|j�|�qgWn	tyzYnwt|j�|_d
�|j�tjd<d|_|jdkr�gd�|_gd�|_n
gd�|_gd�|_gd�|_|jdkr�gd�|_ngd�|_dg|_d|_dS)N�DISTUTILS_USE_SDK�MSSdkzcl.exezlink.exezlib.exezrc.exezmc.exer/rzxPython was built with %s, and extensions need to be built with the same version of the compiler, but it isn't installed.�lib�include�;rV)�/nologo�/Ox�/MD�/W3�/GX�/DNDEBUG)rr�/Od�/MDdrurv�/Z7�/D_DEBUG)rrrsrtru�/GS-rw)rrrxryrur|rzr{)�/DLLrrz/INCREMENTAL:NOrc)r}rr�/INCREMENTAL:no�/DEBUG)r}rrr~z	/pdb:NonerrrT)�_MSVCCompiler__pathsrZ�environ�find_exe�cc�linkerro�rc�mc�get_msvc_pathsrNrrh�set_path_env_varrOrr8r_�join�preprocess_optionsre�compile_options�compile_options_debug�ldflags_sharedrd�ldflags_shared_debug�ldflags_staticri)r*r<rrr�
initialize�sP�

��







zMSVCCompiler.initialize�cCs�|durd}g}|D]b}tj�|�\}}tj�|�d}|tj�|�d�}||jvr1td|��|r9tj�|�}||jvrL|�	tj�
|||j��q
||jvr_|�	tj�
|||j��q
|�	tj�
|||j
��q
|S)Nr�r
zDon't know how to compile %s)rZr/�splitext�
splitdrive�isabs�src_extensionsr�basename�_rc_extensionsrr��
res_extension�_mc_extensions�
obj_extension)r*�source_filenames�	strip_dir�
output_dir�	obj_names�src_namer�extrrr�object_filenames8s,

�
��zMSVCCompiler.object_filenamesNc	Cs8|js|��|�||||||�}	|	\}}
}}}|pg}
|
�d�|r*|
�|j�n|
�|j�|
D]�}z||\}}Wn	tyEYq2w|rNtj	�
|�}||jvrXd|}n�||jvrbd|}n�||j
vr�|}d|}z|�|jg||g|g�Wnty�}zt|��d}~wwq2||jvr�tj	�|�}tj	�|�}z6|�|jgd|d|g|g�tj	�tj	�|��\}}tj	�||d�}|�|jgd|g|g�Wnty�}zt|��d}~wwq2td||f��d	|}z|�|jg|
|||g|�Wq2t�y}zt|��d}~ww|
S)
Nz/cz/Tcz/Tpz/foz-hz-rrbz"Don't know how to compile %s to %sz/Fo)rir��_setup_compiler�extendr�r�r8rZr/�abspath�
_c_extensions�_cpp_extensionsr��spawnr�rrr��dirnamer�r�r�r�r�)r*�sourcesr�r(�include_dirs�debug�
extra_preargs�extra_postargs�depends�compile_info�objects�pp_opts�build�compile_opts�obj�srcr��	input_opt�
output_opt�msg�h_dir�rc_dirr�_�rc_filerrr�compileWs�
�
�




�
���


��
�
�����
���zMSVCCompiler.compilec	
Cs�|js|��|�||�\}}|j||d�}|�||�rC|d|g}|r&	z|�|jg|�WdStyB}zt|��d}~wwt	�
d|�dS)N)r��/OUT:�skipping %s (up-to-date))rir��_fix_object_args�library_filename�
_need_linkr�rorrr	r�)	r*r��output_libnamer�r��target_lang�output_filename�lib_argsr�rrr�create_static_lib�s"���zMSVCCompiler.create_static_libc
Cs�|js|��|�||�\}}|�|||�}|\}}}|r&|�dt|��t||||�}|dur8tj�	||�}|�
||�r�|tjkrU|	rM|j
dd�}n|jdd�}n	|	r[|j
}n|j}g}|pcgD]	}|�d|�qd||||d|g}|dur�tj�tj�|��\}}tj�	tj�|d�|�|��}|�d|�|
r�|
|dd�<|r�|�|�|�tj�|��z|�|jg|�WdSty�}zt|��d}~wwt�d|�dS)Nz5I don't know what to do with 'runtime_library_dirs': r
z/EXPORT:r�rz/IMPLIB:r�)rir�r��
_fix_lib_args�warn�strrrZr/r�r�r�
EXECUTABLEr�r�rr�r�r�r�r��mkpathr�r�rrr	r�)r*�target_descr�r�r��	libraries�library_dirs�runtime_library_dirs�export_symbolsr�r�r��
build_tempr��
fixed_args�lib_opts�ldflags�export_opts�sym�ld_args�dll_name�dll_ext�implib_filer�rrr�link�sl�
��

��
��
��zMSVCCompiler.linkcCsd|S)Nz	/LIBPATH:r�r*�dirrrr�library_dir_optionszMSVCCompiler.library_dir_optioncCstd��)Nz<don't know how to set runtime library search path for MSVC++)rr�rrr�runtime_library_dir_options�z'MSVCCompiler.runtime_library_dir_optioncCs
|�|�Sr')r�)r*rorrr�library_options
zMSVCCompiler.library_optioncCs\|r	|d|g}n|g}|D]}|D]}tj�||�|��}tj�|�r*|SqqdS)N�_d)rZr/r�r��exists)r*�dirsror��	try_namesr�r�libfilerrr�find_library_file#s��zMSVCCompiler.find_library_filecCsz|jD]}tj�tj�|�|�}tj�|�r|Sqtjd�d�D]}tj�tj�|�|�}tj�|�r:|Sq#|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'.
        �Pathrq)r�rZr/r�r��isfiler�rO)r*�exer<�fnrrrr�5s
	��zMSVCCompiler.find_exe�x86cCs�tsgS|d}|jdkrd|j|jf}nd|j|f}tD]$}t||�}|rC|jdkr:|j�||��d�S||�d�Sq|jdkr`tD]}t|d|j�dur_|�d	�gSqKgS)
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 dirsrcz6%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directoriesz?%s\6.0\Build System\Components\Platforms\Win32 (%s)\DirectoriesrqrFz%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_regrdrfr-rrgrArOr�)r*r/�platformrrrrrrr�Ks2

��

�

�zMSVCCompiler.get_msvc_pathscCs:|dkr
|�d�}n|�|�}|rd�|�tj|<dSdS)z�Set environment variable 'name' to an MSVC path type value.

        This is equivalent to a SET command prior to execution of spawned
        commands.
        ro�libraryrqN)r�r�rZr�)r*rr<rrrr�os
�zMSVCCompiler.set_path_env_var)rrr)rr�)NNNrNNN)NrN)
NNNNNrNNNN)r)r�)rBrCrD�__doc__�
compiler_type�executablesr�r�r�r�r�r�r��static_lib_extension�shared_lib_extension�static_lib_format�shared_lib_format�
exe_extensionr,r�r�r�r�r�r�r�r�r�r�r�r�rrrrr`�sb��
B
� 
�X
�
�S

$r`g @z3Importing new compiler from distutils.msvc9compiler)r`)r&)-r�rLrZ�distutils.errorsrrrrr�distutils.ccompilerrr�	distutilsr	r��winreg�hkey_mod�	OpenKeyExr�EnumKeyr
�	EnumValuer�errorr�ImportError�win32api�win32con�info�
HKEY_USERS�HKEY_CURRENT_USER�HKEY_LOCAL_MACHINE�HKEY_CLASSES_ROOTr-rrrr&rUrYr_r`r��OldMSVCCompiler�distutils.msvc9compilerrrrr�<module>sj



����	-

9
�

Page not found | The NCLEX Doctor

Page not found!

Sorry, this page is not available...