Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib64/python3.7/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/distutils/__pycache__/ccompiler.cpython-37.opt-2.pyc

B

YI~dI��@s�ddlZddlZddlZddlTddlmZddlmZddlm	Z	ddl
mZmZddl
mZmZddlmZGd	d
�d
�ZdZddd
�Zdddddd�Zdd�Zddd�Zdd�Zdd�ZdS)�N)�*)�spawn)�	move_file)�mkpath)�newer_pairwise�newer_group)�split_quoted�execute)�logc
@seZdZdZdZdZdZdZdZdZ	dZ
dddddd�ZdddgZdpdd�Z
d	d
�Zdd�Zd
d�Zdd�Zdqdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Z drd/d0�Z!d1d2�Z"d3d4�Z#d5d6�Z$d7d8�Z%dsd9d:�Z&dtd;d<�Z'd=d>�Z(dud?d@�Z)dAZ*dBZ+dCZ,dvdDdE�Z-dwdFdG�Z.dxdHdI�Z/dydJdK�Z0dLdM�Z1dNdO�Z2dPdQ�Z3dzdRdS�Z4d{dTdU�Z5d|dWdX�Z6d}dYdZ�Z7d~d[d\�Z8dd^d_�Z9d�dadb�Z:dcdd�Z;dedf�Z<d�dgdh�Z=didj�Z>dkdl�Z?d�dndo�Z@dS)��	CCompilerN�czc++Zobjc)z.cz.ccz.cppz.cxxz.mrcCsf||_||_||_d|_g|_g|_g|_g|_g|_g|_	x$|j
��D]}|�||j
|�qHWdS)N)
�dry_run�force�verbose�
output_dir�macros�include_dirs�	libraries�library_dirs�runtime_library_dirs�objects�executables�keys�set_executable)�selfrr
r�key�r�8/opt/alt/python37/lib64/python3.7/distutils/ccompiler.py�__init__UszCCompiler.__init__cKs@x:|D]2}||jkr(td||jjf��|�|||�qWdS)Nz$unknown executable '%s' for class %s)r�
ValueError�	__class__�__name__r)r�kwargsrrrr�set_executablesys


zCCompiler.set_executablescCs,t|t�rt||t|��nt|||�dS)N)�
isinstance�str�setattrr)rr�valuerrrr�s
zCCompiler.set_executablecCs0d}x&|jD]}|d|kr |S|d7}qWdS)Nr�)r)r�name�i�defnrrr�_find_macro�szCCompiler._find_macrocCsdx^|D]V}t|t�rHt|�dkrHt|dt�s:|ddkrHt|dt�std|dd��qWdS)N)r(�r(rzinvalid macro definition '%s': z.must be tuple (string,), (string, string), or z(string, None))r$�tuple�lenr%�	TypeError)rZdefinitionsr+rrr�_check_macro_definitions�s


z"CCompiler._check_macro_definitionscCs.|�|�}|dk	r|j|=|j�||f�dS)N)r,r�append)rr)r'r*rrr�define_macro�s	
zCCompiler.define_macrocCs0|�|�}|dk	r|j|=|f}|j�|�dS)N)r,rr2)rr)r*Zundefnrrr�undefine_macro�s

zCCompiler.undefine_macrocCs|j�|�dS)N)rr2)r�dirrrr�add_include_dir�szCCompiler.add_include_dircCs|dd�|_dS)N)r)r�dirsrrr�set_include_dirs�szCCompiler.set_include_dirscCs|j�|�dS)N)rr2)r�libnamerrr�add_library�szCCompiler.add_librarycCs|dd�|_dS)N)r)rZlibnamesrrr�
set_libraries�szCCompiler.set_librariescCs|j�|�dS)N)rr2)rr5rrr�add_library_dirszCCompiler.add_library_dircCs|dd�|_dS)N)r)rr7rrr�set_library_dirsszCCompiler.set_library_dirscCs|j�|�dS)N)rr2)rr5rrr�add_runtime_library_dirsz!CCompiler.add_runtime_library_dircCs|dd�|_dS)N)r)rr7rrr�set_runtime_library_dirssz"CCompiler.set_runtime_library_dirscCs|j�|�dS)N)rr2)r�objectrrr�add_link_object szCCompiler.add_link_objectcCs|dd�|_dS)N)r)rrrrr�set_link_objects(szCCompiler.set_link_objectscCs|dkr|j}nt|t�s"td��|dkr2|j}n"t|t�rL||jpFg}ntd��|dkrd|j}n*t|ttf�r�t|�|jp�g}ntd��|dkr�g}|j|d|d�}t	||�}i}	xRt
t|��D]B}
||
}||
}tj
�|�d}
|�tj
�|��||
f|	|<q�W|||||	fS)Nz%'output_dir' must be a string or Nonez/'macros' (if supplied) must be a list of tuplesz6'include_dirs' (if supplied) must be a list of stringsr)�	strip_dirrr()rr$r%r0r�listrr.�object_filenames�gen_preprocess_options�ranger/�os�path�splitextr�dirname)rZoutdirrZincdirs�sources�dependsZextrar�pp_opts�buildr*�src�obj�extrrr�_setup_compile6s8


zCCompiler._setup_compilecCs0|dg}|rdg|dd�<|r,||dd�<|S)Nz-cz-grr)rrN�debugZbefore�cc_argsrrr�_get_cc_argsas
zCCompiler._get_cc_argscCs�|dkr|j}nt|t�s"td��|dkr2|j}n"t|t�rL||jpFg}ntd��|dkrd|j}n*t|ttf�r�t|�|jp�g}ntd��|||fS)Nz%'output_dir' must be a string or Nonez/'macros' (if supplied) must be a list of tuplesz6'include_dirs' (if supplied) must be a list of strings)rr$r%r0rrDrr.)rrrrrrr�_fix_compile_argsjs 


zCCompiler._fix_compile_argscCs|j||d�}|ifS)N)r)rE)rrLrrMrrrr�
_prep_compile�s	zCCompiler._prep_compilecCsHt|ttf�std��t|�}|dkr.|j}nt|t�s@td��||fS)Nz,'objects' must be a list or tuple of stringsz%'output_dir' must be a string or None)r$rDr.r0rr%)rrrrrr�_fix_object_args�s
zCCompiler._fix_object_argscCs�|dkr|j}n*t|ttf�r2t|�|jp,g}ntd��|dkrJ|j}n*t|ttf�rlt|�|jpfg}ntd��|dkr�|j}n*t|ttf�r�t|�|jp�g}ntd��|||fS)Nz3'libraries' (if supplied) must be a list of stringsz6'library_dirs' (if supplied) must be a list of stringsz>'runtime_library_dirs' (if supplied) must be a list of strings)rr$rDr.r0rr)rrrrrrr�
_fix_lib_args�s&zCCompiler._fix_lib_argscCs2|jr
dS|jr t||dd�}n
t||�}|SdS)NT�newer)�missing)rr
r)rr�output_filer[rrr�
_need_link�s
zCCompiler._need_linkc		Cs�t|t�s|g}d}t|j�}x^|D]V}tj�|�\}}|j�|�}y |j�	|�}||krb|}|}Wq$t
k
rxYq$Xq$W|S)N)r$rDr/�language_orderrHrIrJ�language_map�get�indexr)	rrL�langrb�source�baserRZextlangZextindexrrr�detect_language�s



zCCompiler.detect_languagecCsdS)Nr)rrdr]rr�
extra_preargs�extra_postargsrrr�
preprocess�szCCompiler.preprocessc		Csz|�||||||�\}}	}}
}|�|
||�}xH|	D]@}
y||
\}}Wntk
r\w2YnX|�|
|||||
�q2W|	S)N)rSrV�KeyError�_compile)rrLrrrrTrgrhrMrrNrOrUrQrPrRrrr�compile�s6
zCCompiler.compilecCsdS)Nr)rrQrPrRrUrhrNrrrrkCszCCompiler._compilecCsdS)Nr)rr�output_libnamerrT�target_langrrr�create_static_libIszCCompiler.create_static_libZ
shared_objectZshared_library�
executablecCst�dS)N)�NotImplementedError)rZtarget_descr�output_filenamerrrr�export_symbolsrTrgrh�
build_temprnrrr�linkis9zCCompiler.linkc

Cs2|�tj||j|dd�|||||||	|
||�
dS)N�shared)�lib_type)rur�SHARED_LIBRARY�library_filename)
rrrmrrrrrsrTrgrhrtrnrrr�link_shared_lib�s
zCCompiler.link_shared_libc

Cs(|�tj|||||||||	|
||�
dS)N)rur�
SHARED_OBJECT)
rrrrrrrrrsrTrgrhrtrnrrr�link_shared_object�s

zCCompiler.link_shared_objectcCs.|�tj||�|�||||d|||	d|
�
dS)N)rur�
EXECUTABLE�executable_filename)rrZoutput_prognamerrrrrTrgrhrnrrr�link_executable�s

zCCompiler.link_executablecCst�dS)N)rq)rr5rrr�library_dir_option�szCCompiler.library_dir_optioncCst�dS)N)rq)rr5rrr�runtime_library_dir_option�sz$CCompiler.runtime_library_dir_optioncCst�dS)N)rq)r�librrr�library_option�szCCompiler.library_optionc	Cs�ddl}|dkrg}|dkr g}|dkr,g}|dkr8g}|jd|dd�\}}t�|d�}	z.x|D]}
|	�d|
�q`W|	�d|�Wd|	��Xy|j|g|d�}Wntk
r�d	SXy|j|d
||d�Wnt	t
fk
r�d	SXdS)Nrz.cT)�text�wz#include "%s"
z=int main (int argc, char **argv) {
    %s();
    return 0;
}
)rFza.out)rr)�tempfileZmkstemprH�fdopen�write�closerlZCompileErrorrZ	LinkErrorr0)r�funcnameZincludesrrrr��fdZfname�fZinclrrrr�has_function�s8	

zCCompiler.has_functioncCst�dS)N)rq)rr7r�rTrrr�find_library_file$szCCompiler.find_library_file�cCs�|dkrd}g}x�|D]|}tj�|�\}}tj�|�d}|tj�|�d�}||jkrhtd||f��|rxtj�|�}|�tj�	|||j
��qW|S)Nr�r(z"unknown file type '%s' (from '%s'))rHrIrJ�
splitdrive�isabs�src_extensionsZUnknownFileError�basenamer2�join�
obj_extension)rZsource_filenamesrCrZ	obj_namesZsrc_namererRrrrrEOs

zCCompiler.object_filenamescCs$|rtj�|�}tj�|||j�S)N)rHrIr�r��shared_lib_extension)rr�rCrrrr�shared_object_filename`sz CCompiler.shared_object_filenamecCs(|rtj�|�}tj�|||jp"d�S)Nr�)rHrIr�r��
exe_extension)rr�rCrrrrr~fszCCompiler.executable_filename�staticc
Cs`|dkrtd��t||d�}t||d�}tj�|�\}}|||f}	|rPd}tj�|||	�S)N)r�rvZdylibZ
xcode_stubz?'lib_type' must be "static", "shared", "dylib", or "xcode_stub"Z_lib_formatZ_lib_extensionr�)r�getattrrHrI�splitr�)
rr9rwrCrZfmtrRr5re�filenamerrrrylszCCompiler.library_filenamer(cCst�|�dS)N)r
rT)r�msg�levelrrr�announceszCCompiler.announcecCsddlm}|rt|�dS)Nr)�DEBUG)Zdistutils.debugr��print)rr�r�rrr�debug_print�szCCompiler.debug_printcCstj�d|�dS)Nzwarning: %s
)�sys�stderrr�)rr�rrr�warn�szCCompiler.warncCst||||j�dS)N)r	r
)r�func�argsr�r�rrrr	�szCCompiler.executecCst||jd�dS)N)r
)rr
)r�cmdrrrr�szCCompiler.spawncCst|||jd�S)N)r
)rr
)rrP�dstrrrr�szCCompiler.move_file�cCst|||jd�dS)N)r
)rr
)rr)�moderrrr�szCCompiler.mkpath)rrr)N)N)NNNNN)NNNrNNN)NrN)
NNNNNrNNNN)
NNNNNrNNNN)
NNNNNrNNNN)NNNNrNNN)NNNN)r)rr�)rr�)rr�)r�rr�)r()Nr()r�)Ar!�
__module__�__qualname__Z
compiler_typer�r�Zstatic_lib_extensionr�Zstatic_lib_formatZshared_lib_formatr�r`r_rr#rr,r1r3r4r6r8r:r;r<r=r>r?rArBrSrVrWrXrYrZr^rfrirlrkror{rxr}rurzr|rr�r�r�r�r�rEr�r~ryr�r�r�r	rrrrrrrrs�

$ 

+	 
"


B

4



+
+





r))zcygwin.*�unix)�posixr�)�nt�msvccCsV|dkrtj}|dkrtj}x4tD],\}}t�||�dk	sJt�||�dk	r"|Sq"WdS)Nr�)rHr)r��platform�_default_compilers�re�match)Zosnamer��pattern�compilerrrr�get_default_compiler�s
r�)Z
unixccompilerZ
UnixCCompilerzstandard UNIX-style compiler)Z
_msvccompilerZMSVCCompilerzMicrosoft Visual C++)�cygwinccompilerZCygwinCCompilerz'Cygwin port of GNU C Compiler for Win32)r�ZMingw32CCompilerz(Mingw32 port of GNU C Compiler for Win32)ZbcppcompilerZBCPPCompilerzBorland C++ Compiler)r�r��cygwinZmingw32ZbcppcCs\ddlm}g}x,t��D] }|�d|dt|df�qW|��||�}|�d�dS)Nr)�FancyGetoptz	compiler=r-zList of available compilers:)Zdistutils.fancy_getoptr��compiler_classrr2�sort�
print_help)r�Z	compilersr�Zpretty_printerrrr�show_compilers�sr�cCs�|dkrtj}y"|dkr t|�}t|\}}}Wn8tk
rhd|}|dk	r\|d|}t|��YnXy*d|}t|�tj|}	t	|	�|}
WnBt
k
r�td|��Yn$tk
r�td||f��YnX|
d||�S)Nz5don't know how to compile C/C++ code on platform '%s'z with '%s' compilerz
distutils.z4can't compile C/C++ code: unable to load module '%s'zBcan't compile C/C++ code: unable to find class '%s' in module '%s')rHr)r�r�rjZDistutilsPlatformError�
__import__r��modules�vars�ImportErrorZDistutilsModuleError)Zplatr�rr
rZmodule_name�
class_nameZlong_descriptionr��module�klassrrr�new_compiler�s2
r�cCs�g}x�|D]�}t|t�r2dt|�kr0dks>ntd|��t|�dkr^|�d|d�q
t|�dkr
|ddkr�|�d|d�q
|�d|�q
Wx|D]}|�d|�q�W|S)	Nr(r-zPbad macro definition '%s': each element of 'macros' list must be a 1- or 2-tuplez-U%srz-D%sz-D%s=%sz-I%s)r$r.r/r0r2)rrrNZmacror5rrrrFs
$
rFcCs�g}x|D]}|�|�|��q
Wx4|D],}|�|�}t|t�rJ||}q(|�|�q(Wx^|D]V}tj�|�\}}	|r�|�|g|	�}
|
r�|�|
�q�|�	d|�q^|�|�
|��q^W|S)Nz6no library file corresponding to '%s' found (skipping))r2r�r�r$rDrHrIr�r�r�r�)r�rrrZlib_optsr5�optr�Zlib_dirZlib_nameZlib_filerrr�gen_lib_options8s$






r�)NN)NNrrr)r�rHr�Zdistutils.errorsZdistutils.spawnrZdistutils.file_utilrZdistutils.dir_utilrZdistutils.dep_utilrrZdistutils.utilrr	Z	distutilsr
rr�r�r�r�r�rFr�rrrr�<module>s4

--

Hacked By AnonymousFox1.0, Coded By AnonymousFox