AlkantarClanX12

Your IP : 3.135.205.26


Current Path : /opt/alt/python310/lib64/python3.10/distutils/command/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/distutils/command/__pycache__/config.cpython-310.opt-2.pyc

o

6��f=3�@sj	ddlZddlZddlmZddlmZddlmZddlm	Z	ddd�Z
Gd	d
�d
e�Zd
dd�ZdS)�N)�Command)�DistutilsExecError)�customize_compiler)�logz.cz.cxx)�czc++c@s�eZdZdZgd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
d(dd�Z		d(dd�Zd)dd�Z		d*dd�Z		d*dd �Z		!d+d"d#�Zdddgfd$d%�Z		d)d&d'�ZdS),�configzprepare to build)	)z	compiler=Nzspecify the compiler type)zcc=Nzspecify the compiler executable)z
include-dirs=�Iz.list of directories to search for header files)zdefine=�DzC preprocessor macros to define)zundef=�Uz!C preprocessor macros to undefine)z
libraries=�lz!external C libraries to link with)z
library-dirs=�Lz.directories to search for external C libraries)�noisyNz1show every action (compile, link, run, ...) taken)zdump-sourceNz=dump generated source files before attempting to compile themcCs4d|_d|_d|_d|_d|_d|_d|_g|_dS)N�)�compilerZcc�include_dirs�	libraries�library_dirsr
�dump_source�
temp_files��self�r�?/opt/alt/python310/lib64/python3.10/distutils/command/config.py�initialize_options3s
zconfig.initialize_optionscCs�|jdur
|jjp
g|_nt|jt�r|j�tj�|_|jdur$g|_nt|jt�r/|jg|_|jdur9g|_dSt|jt�rI|j�tj�|_dSdS�N)	rZdistribution�
isinstance�str�split�os�pathseprrrrrr�finalize_optionsBs




�zconfig.finalize_optionscCsdSrrrrrr�runRsz
config.runcCs�	ddlm}m}t|j|�s>||j|jdd�|_t|j�|jr(|j�|j�|j	r2|j�
|j	�|jr@|j�|j�dSdSdS)Nr)�	CCompiler�new_compilerr)r�dry_runZforce)
�distutils.ccompilerr"r#rrr$rrZset_include_dirsrZ
set_librariesrZset_library_dirs)rr"r#rrr�_check_compilerYs�
�zconfig._check_compilercCs�dt|}t|d��4}|r|D]	}|�d|�q|�d�|�|�|ddkr7|�d�Wd�|SWd�|S1sBwY|S)NZ_configtest�wz#include <%s>
�
���)�LANG_EXT�open�write)r�body�headers�lang�filename�file�headerrrr�_gen_temp_sourcefileks 


��
��zconfig._gen_temp_sourcefilecCs<|�|||�}d}|j�||g�|jj|||d�||fS)Nz
_configtest.i�r)r3r�extendrZ
preprocess)rr-r.rr/�src�outrrr�_preprocessws
zconfig._preprocesscCs\|�|||�}|jrt|d|�|j�|g�\}|j�||g�|jj|g|d�||fS)Nzcompiling '%s':r4)r3r�	dump_filerZobject_filenamesrr5�compile)rr-r.rr/r6�objrrr�_compile~szconfig._compilec
Csr|�||||�\}}tj�tj�|��d}	|jj|g|	|||d�|jjdur.|	|jj}	|j�	|	�|||	fS)Nr)rrZtarget_lang)
r<r�path�splitext�basenamerZlink_executableZ
exe_extensionr�append)
rr-r.rrrr/r6r;�progrrr�_link�s�
zconfig._linkc	GsP|s|j}g|_t�dd�|��|D]}zt�|�Wqty%YqwdS)Nzremoving: %s� )rr�info�joinr�remove�OSError)r�	filenamesr0rrr�_clean�s��z
config._cleanNrcCsR	ddlm}|��d}z
|�||||�Wn|y"d}Ynw|��|S)Nr��CompileErrorTF)r%rKr&r8rI�rr-r.rr/rK�okrrr�try_cpp�s�zconfig.try_cppcCs�	|��|�||||�\}}t|t�rt�|�}t|��}d}		|��}
|
dkr*n	|�|
�r2d}	nq!Wd�n1s=wY|�	�|	S)NFT�)
r&r8rr�rer:r+�readline�searchrI)r�patternr-r.rr/r6r7r1�match�linerrr�
search_cpp�s&



���
zconfig.search_cppcCsd	ddlm}|��z|�||||�d}Wn|y"d}Ynwt�|r)dp*d�|��|S)NrrJTF�success!�failure.)r%rKr&r<rrDrIrLrrr�try_compile�s�zconfig.try_compilec
	Csp	ddlm}m}|��z|�||||||�d}	Wn
||fy(d}	Ynwt�|	r/dp0d�|��|	S�Nr)rK�	LinkErrorTFrWrX)r%rKr[r&rBrrDrI)
rr-r.rrrr/rKr[rMrrr�try_link�s
��zconfig.try_linkc

Cs�	ddlm}m}|��z|�||||||�\}	}
}|�|g�d}Wn||tfy2d}Ynwt�|r9dp:d�|�	�|SrZ)
r%rKr[r&rBZspawnrrrDrI)
rr-r.rrrr/rKr[r6r;ZexerMrrr�try_run�s

��zconfig.try_runrc	Csv	|��g}|r|�d|�|�d�|r|�d|�n|�d|�|�d�d�|�d}|�|||||�S)Nz
int %s ();z
int main () {z  %s();z  %s;�}r()r&r@rEr\)	r�funcr.rrrZdeclZcallr-rrr�
check_funcs



�zconfig.check_funccCs"	|��|�d|||g||�S)Nzint main (void) { })r&r\)rZlibraryrr.rZother_librariesrrr�	check_lib4s


�zconfig.check_libcCs	|jd|g|d�S)Nz
/* No body */)r-r.r)rN)rr2rrr/rrr�check_headerBs
�zconfig.check_header)NNNr)NNr)NNNNr)NNNNrr)�__name__�
__module__�__qualname__�descriptionZuser_optionsrr r!r&r3r8r<rBrIrNrVrYr\r]r`rarbrrrrrs@	

�

�
�
�
��rcCsR	|durt�d|�nt�|�t|�}zt�|���W|��dS|��w)Nz%s)rrDr+�read�close)r0�headr1rrrr9Ks
r9r)
rrPZdistutils.corerZdistutils.errorsrZdistutils.sysconfigrZ	distutilsrr*rr9rrrr�<module>s
8