Viewing 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fddffZddddZddddfddddfddddfddddfdd d!d"fiZd#d$Zdddddd%d&Zd'd(Zd)d*ZdS)+N)*)spawn)	move_file)mkpath)newer_pairwisenewer_group)split_quotedexecute)logc@seZdZdZdZdZdZdZdZdZ	dZ
dddddddddd	iZdd	dgZd
d
d
ddZ
d
dZddZddZddZdddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Z dd3d4Z!d5d6Z"d7d8Z#d9d:Z$d;d<Z%dddddd=d>Z&dddd
dddd?d@Z'dAdBZ(dd
ddCdDZ)dEZ*dFZ+dGZ,dddddd
dddddHdI
Z-dddddd
dddddJdK
Z.dddddd
dddddLdM
Z/ddddd
ddddNdOZ0dPdQZ1dRdSZ2dTdUZ3dddddVdWZ4d
dXdYZ5d
dZd[d\Z6d
dZd]d^Z7d
dZd_d`Z8dad
dZdbdcZ9dddedfZ:dgdhZ;didjZ<ddddkdlZ=dmdnZ>dodpZ?dqdrdsZ@dS)t	CCompilerNz.ccz.cczc++z.cppz.cxxz.mZobjcrcCs||_||_||_d|_g|_g|_g|_g|_g|_g|_	x.|j
jD]}|j||j
|qjWdS)N)
dry_runforceverbose
output_dirmacrosinclude_dirs	librarieslibrary_dirsruntime_library_dirsobjectsexecutableskeysset_executable)selfrr
rkeyr./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)rkwargsrrrrset_executablesys

zCCompiler.set_executablescCs<t|tr(t||t|nt|||dS)N)
isinstancestrsetattrr)rrvaluerrrrszCCompiler.set_executablecCs<d}x/|jD]$}|d|kr*|S|d7}qWdS)Nr)r)rnameidefnrrr_find_macroszCCompiler._find_macrocCsx}|D]u}t|toat|dkoat|dtsQ|ddkoat|dtstd|ddqWdS)Nr(rzinvalid macro definition '%s': z.must be tuple (string,), (string, string), or z(string, None))r(r-)r$tuplelenr%	TypeError)rZdefinitionsr+rrr_check_macro_definitionss
#z"CCompiler._check_macro_definitionscCs?|j|}|dk	r%|j|=|jj||fdS)N)r,rappend)rr)r'r*rrrdefine_macros	
zCCompiler.define_macrocCsB|j|}|dk	r%|j|=|f}|jj|dS)N)r,rr2)rr)r*Zundefnrrrundefine_macros

	zCCompiler.undefine_macrocCs|jj|dS)N)rr2)rdirrrradd_include_dirszCCompiler.add_include_dircCs|dd|_dS)N)r)rdirsrrrset_include_dirsszCCompiler.set_include_dirscCs|jj|dS)N)rr2)rlibnamerrradd_libraryszCCompiler.add_librarycCs|dd|_dS)N)r)rZlibnamesrrr
set_librariesszCCompiler.set_librariescCs|jj|dS)N)rr2)rr5rrradd_library_dirszCCompiler.add_library_dircCs|dd|_dS)N)r)rr7rrrset_library_dirsszCCompiler.set_library_dirscCs|jj|dS)N)rr2)rr5rrradd_runtime_library_dirsz!CCompiler.add_runtime_library_dircCs|dd|_dS)N)r)rr7rrrset_runtime_library_dirssz"CCompiler.set_runtime_library_dirscCs|jj|dS)N)rr2)robjectrrradd_link_object szCCompiler.add_link_objectcCs|dd|_dS)N)r)rrrrrset_link_objects(szCCompiler.set_link_objectscCs|dkr|j}nt|ts3td|dkrK|j}n1t|trp||jpig}ntd|dkr|j}n=t|ttfrt||jpg}ntd|dkrg}|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%r0rlistrr.object_filenamesgen_preprocess_optionsranger/ospathsplitextrdirname)rZoutdirrZincdirssourcesdependsextrarpp_optsbuildr*srcobjextrrr_setup_compile6s8		

zCCompiler._setup_compilecCs@|dg}|r&dg|dd<|r<||dd<|S)Nz-cz-grr)rrOdebugZbeforecc_argsrrr_get_cc_argsas
zCCompiler._get_cc_argscCs|dkr|j}nt|ts3td|dkrK|j}n1t|trp||jpig}ntd|dkr|j}n=t|ttfrt||jpg}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_compiles	zCCompiler._prep_compilecCsjt|ttfs!tdt|}|dkrE|j}nt|ts`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_argsszCCompiler._fix_object_argscCs|dkr|j}n=t|ttfrIt||jpBg}ntd|dkrm|j}n=t|ttfrt||jpg}ntd|dkr|j}n=t|ttfrt||jpg}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_argss&			zCCompiler._fix_lib_argscCsE|jr
dS|jr.t||dd}nt||}|SdS)NTmissingnewer)rr
r)rroutput_filer]rrr
_need_links		zCCompiler._need_linkc	Cst|ts|g}d}t|j}x{|D]s}tjj|\}}|jj|}y.|jj	|}||kr|}|}Wq4t
k
rYq4Xq4W|S)N)r$rDr/language_orderrHrIrJlanguage_mapgetindexr)	rrLlangrcsourcebaserSZextlangZextindexrrrdetect_languages	


	zCCompiler.detect_languagecCsdS)Nr)rrer^rr
extra_preargsextra_postargsrrr
preprocessszCCompiler.preprocessc	Cs|j||||||\}}	}}
}|j|
||}xV|	D]N}
y||
\}}Wntk
rzwIYnX|j|
|||||
qIW|	S)N)rTrWKeyError_compile)rrLrrrrUrhrirMrrOrPrVrRrQrSrrrcompiles6

 zCCompiler.compilecCsdS)Nr)rrRrQrSrVrirOrrrrlCszCCompiler._compilecCsdS)Nr)rroutput_libnamerrUtarget_langrrrcreate_static_libIszCCompiler.create_static_libZ
shared_objectZshared_library
executablecCs
tdS)N)NotImplementedError)rZtarget_descroutput_filenamerrrrexport_symbolsrUrhri
build_temprorrrlinkis9zCCompiler.linkc

CsG|jtj||j|dd|||||||	|
||
dS)Nlib_typeshared)rvrSHARED_LIBRARYlibrary_filename)
rrrnrrrrrtrUrhrirurorrrlink_shared_libs
	zCCompiler.link_shared_libc

Cs8|jtj|||||||||	|
||
dS)N)rvr
SHARED_OBJECT)
rrrsrrrrrtrUrhrirurorrrlink_shared_objects

	zCCompiler.link_shared_objectcCsA|jtj||j|||||d|||	d|

dS)N)rvr
EXECUTABLEexecutable_filename)rrZoutput_prognamerrrrrUrhrirorrrlink_executableszCCompiler.link_executablecCs
tdS)N)rr)rr5rrrlibrary_dir_optionszCCompiler.library_dir_optioncCs
tdS)N)rr)rr5rrrruntime_library_dir_optionsz$CCompiler.runtime_library_dir_optioncCs
tdS)N)rr)rlibrrrlibrary_optionszCCompiler.library_optioncCsAddl}|dkrg}|dkr0g}|dkrBg}|dkrTg}|jd|dd\}}tj|d}	z7x|D]}
|	jd|
qW|	jd|Wd|	jXy|j|gd|}Wntk
rd	SYnXy |j|d
d|d|Wnt	t
fk
r<d	SYnXdS)
Nrz.ctextTwz#include "%s"
z+main (int argc, char **argv) {
    %s();
}
rFza.outrr)tempfilemkstemprHfdopenwriteclosermZCompileErrorrZ	LinkErrorr0)rfuncnameZincludesrrrrfdZfnamefZinclrrrrhas_functions8	

		zCCompiler.has_functioncCs
tdS)N)rr)rr7rrUrrrfind_library_file#szCCompiler.find_library_filecCs|dkrd}g}x|D]}tjj|\}}tjj|d}|tjj|d}||jkrtd||f|rtjj|}|jtjj	|||j
qW|S)Nrr(z"unknown file type '%s' (from '%s'))rHrIrJ
splitdriveisabssrc_extensionsZUnknownFileErrorbasenamer2join
obj_extension)rZsource_filenamesrCrZ	obj_namesZsrc_namerfrSrrrrENs
zCCompiler.object_filenamescCs2|rtjj|}tjj|||jS)N)rHrIrrshared_lib_extension)rrrCrrrrshared_object_filename_sz CCompiler.shared_object_filenamecCs8|rtjj|}tjj|||jp3dS)Nr)rHrIrr
exe_extension)rrrCrrrrreszCCompiler.executable_filenamestaticc
Cs|d	krtdt||d}t||d}tjj|\}}|||f}	|rrd}tjj|||	S)
Nrrxdylib
xcode_stubz?'lib_type' must be "static", "shared", "dylib", or "xcode_stub"Z_lib_formatZ_lib_extensionr)rrxrr)rgetattrrHrIsplitr)
rr9rwrCrfmtrSr5rffilenamerrrrzks	zCCompiler.library_filenamer(cCstj|dS)N)r
rU)rmsglevelrrrannounce~szCCompiler.announcecCs$ddlm}|r t|dS)Nr)DEBUG)Zdistutils.debugrprint)rrrrrrdebug_printszCCompiler.debug_printcCstjjd|dS)Nzwarning: %s
)sysstderrr)rrrrrwarnszCCompiler.warncCst||||jdS)N)r	r
)rfuncargsrrrrrr	szCCompiler.executecCst|d|jdS)Nr
)rr
)rcmdrrrrszCCompiler.spawncCst||d|jS)Nr
)rr
)rrQdstrrrrszCCompiler.move_fileicCst||d|jdS)Nr
)rr
)rr)moderrrrszCCompiler.mkpath)Ar!
__module____qualname__Z
compiler_typerrZstatic_lib_extensionrZstatic_lib_formatZshared_lib_formatrrar`rr#rr,r1r3r4r6r8r:r;r<r=r>r?rArBrTrWrXrYrZr[r_rgrjrmrlrpr|ryr~rvr{r}rrrrrrrErrrzrrrr	rrrrrrrrs$ 
+	 "
	B4*+rzcygwin.*unixposixntZmsvccCsy|dkrtj}|dkr*tj}xHtD]@\}}tj||dk	smtj||dk	r1|Sq1WdS)Nr)rHr)rplatform_default_compilersrematch)osnamerpatterncompilerrrrget_default_compilers
		rZ
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}x6tjD](}|jd|dt|dfq#W|j||}|jddS)Nr)FancyGetoptz	compiler=r-zList of available compilers:)Zdistutils.fancy_getoptrcompiler_classrr2sort
print_help)rZ	compilersrZpretty_printerrrrshow_compilerss
rcCs|dkrtj}y/|dkr0t|}t|\}}}WnBtk
rd|}|dk	rx|d|}t|YnXy5d|}t|tj|}	t	|	|}
WnIt
k
rtd|Yn(tk
r	td||fYnX|
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)rrrkZDistutilsPlatformError
__import__rmodulesvarsImportErrorZDistutilsModuleError)Zplatrrr
rmodule_name
class_nameZlong_descriptionrmoduleklassrrrnew_compilers2	






rcCsg}x|D]}t|toAdt|ko?dknsTtd|t|dkr~|jd|dq
t|dkr
|ddkr|jd|dq
|jd|q
Wx|D]}|jd|qW|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

rFcCsg}x$|D]}|j|j|q
WxF|D]>}|j|}t|tre||}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))r2rrr$rDrHrIrrrr)rrrrZlib_optsr5optrZlib_dirZlib_nameZlib_filerrrgen_lib_options7s$



	r)rrHrZdistutils.errorsZdistutils.spawnrZdistutils.file_utilrZdistutils.dir_utilrZdistutils.dep_utilrrZdistutils.utilrr	Z	distutilsr
rrrrrrrFrrrrr<module>s:$
							--
Back to Directory File Manager