AlkantarClanX12

Your IP : 18.225.175.230


Current Path : /opt/alt/python35/lib64/python3.5/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/distutils/__pycache__/ccompiler.cpython-35.opt-2.pyc



���]7��@stddlZddlZddlZddlTddlmZddlmZddlm	Z	ddl
mZmZddl
mZmZddlmZGd	d
�d
�Zddfd
dfddffZdddd�Zddddfddddfddddfddddfdd d!d"fiZd#d$�Zdddddd%d&�Zd'd(�Zd)d*�ZdS)+�N)�*)�spawn)�	move_file)�mkpath)�newer_pairwise�newer_group)�split_quoted�execute)�logc@s�eZdZdZdZdZdZdZdZdZ	dZ
dddddddddd	iZdd	dgZd
d
d
dd�Z
d
d�Zdd�Zdd�Zdd�Zddd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Z dd3d4�Z!d5d6�Z"d7d8�Z#d9d:�Z$d;d<�Z%dddddd=d>�Z&dddd
dddd?d@�Z'dAdB�Z(dd
ddCdD�Z)dEZ*dFZ+dGZ,dddddd
dddddHdI�
Z-dddddd
dddddJdK�
Z.dddddd
dddddLdM�
Z/ddddd
ddddNdO�Z0dPdQ�Z1dRdS�Z2dTdU�Z3dddddVdW�Z4d
dXdY�Z5d
dZd[d\�Z6d
dZd]d^�Z7d
dZd_d`�Z8dad
dZdbdc�Z9dddedf�Z:dgdh�Z;didj�Z<ddddkdl�Z=dmdn�Z>dodp�Z?dqdrds�Z@dS)t�	CCompilerNz.c�cz.cczc++z.cppz.cxxz.mZobjcrcCs�||_||_||_d|_g|_g|_g|_g|_g|_g|_	x.|j
j�D]}|j||j
|�qjWdS)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�./opt/alt/python35/lib64/python3.5/ccompiler.py�__init__Us										zCCompiler.__init__cKsTxM|D]E}||jkr8td||jjf��|j|||�qWdS)Nz$unknown executable '%s' for class %s)r�
ValueError�	__class__�__name__r)r�kwargsrrrr�set_executablesys

zCCompiler.set_executablescCs<t|t�r(t||t|��nt|||�dS)N)�
isinstance�str�setattrr)rr�valuerrrr�szCCompiler.set_executablecCs<d}x/|jD]$}|d|kr*|S|d7}qWdS)Nr�)r)r�name�i�defnrrr�_find_macro�szCCompiler._find_macrocCs�x}|D]u}t|t�oat|�dkoat|dt�sQ|ddkoat|dt�std|dd��qWdS)Nr(�rzinvalid macro definition '%s': z.must be tuple (string,), (string, string), or z(string, None))r(r-)r$�tuple�lenr%�	TypeError)rZdefinitionsr+rrr�_check_macro_definitions�s
#z"CCompiler._check_macro_definitionscCs?|j|�}|dk	r%|j|=|jj||f�dS)N)r,r�append)rr)r'r*rrr�define_macro�s	
zCCompiler.define_macrocCsB|j|�}|dk	r%|j|=|f}|jj|�dS)N)r,rr2)rr)r*Zundefnrrr�undefine_macro�s

	zCCompiler.undefine_macrocCs|jj|�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|jj|�dS)N)rr2)r�libnamerrr�add_library�szCCompiler.add_librarycCs|dd�|_dS)N)r)rZlibnamesrrr�
set_libraries�szCCompiler.set_librariescCs|jj|�dS)N)rr2)rr5rrr�add_library_dirszCCompiler.add_library_dircCs|dd�|_dS)N)r)rr7rrr�set_library_dirsszCCompiler.set_library_dirscCs|jj|�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|jj|�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�s3td��|dkrK|j}n1t|t�rp||jpig}ntd��|dkr�|j}n=t|ttf�r�t|�|jp�g}ntd��|dkr�g}|j|ddd|�}t	||�}i}	xmt
t|��D]Y}
||
}||
}tj
j|�d}
|jtj
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 strings�	strip_dirrrr()rr$r%r0r�listrr.�object_filenames�gen_preprocess_options�ranger/�os�path�splitextr�dirname)rZoutdirrZincdirs�sources�depends�extrar�pp_opts�buildr*�src�obj�extrrr�_setup_compile6s8		

zCCompiler._setup_compilecCs@|dg}|r&dg|dd�<|r<||dd�<|S)Nz-cz-grr)rrO�debugZbefore�cc_argsrrr�_get_cc_argsas
zCCompiler._get_cc_argscCs�|dkr|j}nt|t�s3td��|dkrK|j}n1t|t�rp||jpig}ntd��|dkr�|j}n=t|ttf�r�t|�|jp�g}ntd��|||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)Nr)rE)rrLrrMrrrr�
_prep_compile�s	zCCompiler._prep_compilecCsjt|ttf�s!td��t|�}|dkrE|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�rIt|�|jpBg}ntd��|dkrm|j}n=t|ttf�r�t|�|jp�g}ntd��|dkr�|j}n=t|ttf�r�t|�|jp�g}ntd��|||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_argscCsE|jr
dS|jr.t||dd�}nt||�}|SdS)NT�missing�newer)rr
r)rr�output_filer]rrr�
_need_link�s		zCCompiler._need_linkc	Cs�t|t�s|g}d}t|j�}x{|D]s}tjj|�\}}|jj|�}y.|jj	|�}||kr�|}|}Wq4t
k
r�Yq4Xq4W|S)N)r$rDr/�language_orderrHrIrJ�language_map�get�indexr)	rrL�langrc�source�baserSZextlangZextindexrrr�detect_language�s	


	zCCompiler.detect_languagecCsdS)Nr)rrer^rr�
extra_preargs�extra_postargsrrr�
preprocess�szCCompiler.preprocessc	Cs�|j||||||�\}}	}}
}|j|
||�}xV|	D]N}
y||
\}}Wntk
rzwIYnX|j|
|||||
�qIW|	S)N)rTrW�KeyError�_compile)rrLrrrrUrhrirMrrOrPrVrRrQrSrrr�compile�s6

 zCCompiler.compilecCsdS)Nr)rrRrQrSrVrirOrrrrlCszCCompiler._compilecCsdS)Nr)rr�output_libnamerrU�target_langrrr�create_static_libIszCCompiler.create_static_libZ
shared_objectZshared_library�
executablecCs
t�dS)N)�NotImplementedError)rZtarget_descr�output_filenamerrrr�export_symbolsrUrhri�
build_temprorrr�linkis9zCCompiler.linkc

CsG|jtj||j|dd�|||||||	|
||�
dS)N�lib_type�shared)rvr�SHARED_LIBRARY�library_filename)
rrrnrrrrrtrUrhrirurorrr�link_shared_lib�s
	zCCompiler.link_shared_libc

Cs8|jtj|||||||||	|
||�
dS)N)rvr�
SHARED_OBJECT)
rrrsrrrrrtrUrhrirurorrr�link_shared_object�s

	zCCompiler.link_shared_objectcCsA|jtj||j|�||||d|||	d|
�
dS)N)rvr�
EXECUTABLE�executable_filename)rrZoutput_prognamerrrrrUrhrirorrr�link_executable�szCCompiler.link_executablecCs
t�dS)N)rr)rr5rrr�library_dir_option�szCCompiler.library_dir_optioncCs
t�dS)N)rr)rr5rrr�runtime_library_dir_option�sz$CCompiler.runtime_library_dir_optioncCs
t�dS)N)rr)r�librrr�library_option�szCCompiler.library_optioncCsAddl}|dkrg}|dkr0g}|dkrBg}|dkrTg}|jd|dd�\}}tj|d�}	z7x|D]}
|	jd|
�q�W|	jd|�Wd|	j�Xy|j|gd|�}Wntk
r�d	SYnXy |j|d
d|d|�Wnt	t
fk
r<d	SYnXdS)
Nrz.c�textT�wz#include "%s"
z+main (int argc, char **argv) {
    %s();
}
rFza.outrr)�tempfile�mkstemprH�fdopen�write�closermZCompileErrorr�Z	LinkErrorr0)r�funcnameZincludesrrrr��fdZfname�fZinclrrrr�has_function�s8	

		zCCompiler.has_functioncCs
t�dS)N)rr)rr7r�rUrrr�find_library_file#szCCompiler.find_library_file�cCs�|dkrd}g}x�|D]�}tjj|�\}}tjj|�d}|tjj|�d�}||jkr�td||f��|r�tjj|�}|jtjj	|||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_namerfrSrrrrENs
zCCompiler.object_filenamescCs2|rtjj|�}tjj|||j�S)N)rHrIr�r��shared_lib_extension)rr�rCrrrr�shared_object_filename_sz CCompiler.shared_object_filenamecCs8|rtjj|�}tjj|||jp3d�S)Nr�)rHrIr�r��
exe_extension)rr�rCrrrrreszCCompiler.executable_filename�staticc
Cs�|d	krtd��t||d�}t||d�}tjj|�\}}|||f}	|rrd}tjj|||	�S)
Nr�rx�dylib�
xcode_stubz?'lib_type' must be "static", "shared", "dylib", or "xcode_stub"Z_lib_formatZ_lib_extensionr�)r�rxr�r�)r�getattrrHrI�splitr�)
rr9rwrCr�fmtrSr5rf�filenamerrrrzks	zCCompiler.library_filenamer(cCstj|�dS)N)r
rU)r�msg�levelrrr�announce~szCCompiler.announcecCs$ddlm}|r t|�dS)Nr)�DEBUG)Zdistutils.debugr��print)rr�r�rrr�debug_print�szCCompiler.debug_printcCstjjd|�dS)Nzwarning: %s
)�sys�stderrr�)rr�rrr�warn�szCCompiler.warncCst||||j�dS)N)r	r
)r�func�argsr�r�rrrr	�szCCompiler.executecCst|d|j�dS)Nr
)rr
)r�cmdrrrr�szCCompiler.spawncCst||d|j�S)Nr
)rr
)rrQ�dstrrrr�szCCompiler.move_filei�cCst||d|j�dS)Nr
)rr
)rr)�moderrrr�szCCompiler.mkpath)Ar!�
__module__�__qualname__Z
compiler_typer�r�Zstatic_lib_extensionr�Zstatic_lib_formatZshared_lib_formatr�rar`rr#rr,r1r3r4r6r8r:r;r<r=r>r?rArBrTrWrXrYrZr[r_rgrjrmrlrpr|ryr~rvr{r}r�r�r�r�r�r�rEr�rrzr�r�r�r	rrrrrrrrs�$ 
+	 "
	B4*+rzcygwin.*�unix�posix�ntZmsvccCsy|dkrtj}|dkr*tj}xHtD]@\}}tj||�dk	smtj||�dk	r1|Sq1WdS)Nr�)rHr)r��platform�_default_compilers�re�match)�osnamer��pattern�compilerrrr�get_default_compiler�s
		r�Z
unixccompilerZ
UnixCCompilerzstandard UNIX-style compilerZ
_msvccompilerZMSVCCompilerzMicrosoft Visual C++�cygwinZcygwinccompilerZCygwinCCompilerz'Cygwin port of GNU C Compiler for Win32Zmingw32ZMingw32CCompilerz(Mingw32 port of GNU C Compiler for Win32ZbcppZbcppcompilerZBCPPCompilerzBorland C++ CompilercCsvddlm}g}x6tj�D](}|jd|dt|df�q#W|j�||�}|jd�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/|dkr0t|�}t|\}}}WnBtk
r�d|}|dk	rx|d|}t|��YnXy5d|}t|�tj|}	t	|	�|}
WnIt
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�rkZDistutilsPlatformError�
__import__r��modules�vars�ImportErrorZDistutilsModuleError)Zplatr�rr
r�module_name�
class_nameZlong_descriptionr��module�klassrrr�new_compiler�s2	






r�cCs�g}x�|D]�}t|t�oAdt|�ko?dknsTtd|��t|�dkr~|jd|d�q
t|�dkr
|ddkr�|jd|d�q
|jd|�q
Wx|D]}|jd|�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)rrrOZmacror5rrrrF
s
1

rFcCs�g}x$|D]}|j|j|��q
WxF|D]>}|j|�}t|t�re||}q4|j|�q4Wx�|D]y}tjj|�\}}	|r�|j|g|	�}
|
r�|j|
�q�|j	d|�q}|j|j
|��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_options7s$



	r�)r�rHr�Zdistutils.errorsZdistutils.spawnrZdistutils.file_utilrZdistutils.dir_utilrZdistutils.dep_utilrrZdistutils.utilrr	Z	distutilsr
rr�r�r�r�r�rFr�rrrr�<module>s:$
����							--