Your IP : 3.133.143.118


Current Path : /opt/alt/python33/lib64/python3.3/distutils/command/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/distutils/command/__pycache__/config.cpython-33.pyo

�
��f$3c@s�dZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZidd6d	d
6ZGdd�de�Z
ed
d�ZdS(u�distutils.command.config

Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications.  The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" in the
list of standard commands.  Also, this is a good place to put common
configure-like tasks: "try to compile this C code", or "figure out where
this header file lives".
iN(uCommand(uDistutilsExecError(ucustomize_compiler(ulogu.cucu.cxxuc++cBsm|EeZdZdZd>d?d@dAdBdCdDdEdFg	Zdd�Zdd�Zdd�Zdd �Z	d!d"�Z
d#d$�Zd%d&�Zd'd(�Z
d)d*�Zd=d=d=d+d,d-�Zd=d=d=d+d.d/�Zd=d=d+d0d1�Zd=d=d=d=d+d2d3�Zd=d=d=d=d+d4d5�Zd=d=d=d=d6d6d7d8�Zd=d=d=gd9d:�Zd=d=d+d;d<�Zd=S(Guconfiguprepare to buildu	compiler=uspecify the compiler typeucc=uspecify the compiler executableu
include-dirs=uIu.list of directories to search for header filesudefine=uDuC preprocessor macros to defineuundef=uUu!C preprocessor macros to undefineu
libraries=ulu!external C libraries to link withu
library-dirs=uLu.directories to search for external C librariesunoisyu1show every action (compile, link, run, ...) takenudump-sourceu=dump generated source files before attempting to compile themcCsLd|_d|_d|_d|_d|_d|_d|_g|_dS(Ni(	uNoneucompileruccuinclude_dirsu	librariesulibrary_dirsunoisyudump_sourceu
temp_files(uself((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyuinitialize_options3s							uconfig.initialize_optionscCs�|jdkr'|jjpg|_n-t|jt�rT|jjtj�|_n|jdkrog|_n$t|jt�r�|jg|_n|j	dkr�g|_	n-t|j	t�r�|j	jtj�|_	ndS(N(
uinclude_dirsuNoneudistributionu
isinstanceustrusplituosupathsepu	librariesulibrary_dirs(uself((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyufinalize_optionsBsuconfig.finalize_optionscCsdS(N((uself((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyurunRsu
config.runcCs�ddlm}m}t|j|�s�|d|jd|jdd�|_t|j�|jrx|jj|j�n|j	r�|jj
|j	�n|jr�|jj|j�q�ndS(u^Check that 'self.compiler' really is a CCompiler object;
        if not, make it one.
        i(u	CCompilerunew_compilerucompilerudry_runuforceiN(
udistutils.ccompileru	CCompilerunew_compileru
isinstanceucompilerudry_runucustomize_compileruinclude_dirsuset_include_dirsu	librariesu
set_librariesulibrary_dirsuset_library_dirs(uselfu	CCompilerunew_compiler((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyu_check_compilerYs
			uconfig._check_compilercCs�dt|}t|d�}|rUx|D]}|jd|�q*W|jd�n|j|�|ddkr�|jd�n|j�|S(Nu_configtestuwu#include <%s>
u
ii����(uLANG_EXTuopenuwriteuclose(uselfubodyuheadersulangufilenameufileuheader((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyu_gen_temp_sourcefileks


uconfig._gen_temp_sourcefilecCsT|j|||�}d}|jj||g�|jj||d|�||fS(Nu
_configtest.iuinclude_dirs(u_gen_temp_sourcefileu
temp_filesuextenducompileru
preprocess(uselfubodyuheadersuinclude_dirsulangusrcuout((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyu_preprocessxs
uconfig._preprocesscCs�|j|||�}|jr2t|d|�n|jj|g�\}|jj||g�|jj|gd|�||fS(Nucompiling '%s':uinclude_dirs(u_gen_temp_sourcefileudump_sourceu	dump_fileucompileruobject_filenamesu
temp_filesuextenducompile(uselfubodyuheadersuinclude_dirsulangusrcuobj((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyu_compiles	uconfig._compilec
	Cs�|j||||�\}}tjjtjj|��d}	|jj|g|	d|d|d|�|jjdk	r�|	|jj}	n|j	j
|	�|||	fS(Niu	librariesulibrary_dirsutarget_lang(u_compileuosupathusplitextubasenameucompilerulink_executableu
exe_extensionuNoneu
temp_filesuappend(
uselfubodyuheadersuinclude_dirsu	librariesulibrary_dirsulangusrcuobjuprog((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyu_link�s"uconfig._linkcGso|s|j}g|_ntjddj|��x4|D],}ytj|�Wq;tk
rfYq;Xq;WdS(Nuremoving: %su (u
temp_filesuloguinfoujoinuosuremoveuOSError(uselfu	filenamesufilename((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyu_clean�s	

u
config._cleanuccCscddlm}|j�d}y|j||||�Wn|k
rTd}YnX|j�|S(uQConstruct a source file from 'body' (a string containing lines
        of C/C++ code) and 'headers' (a list of header files to include)
        and run it through the preprocessor.  Return true if the
        preprocessor succeeded, false if there were any errors.
        ('body' probably isn't of much use, but what the heck.)
        i(uCompileErrorTF(udistutils.ccompileruCompileErroru_check_compileruTrueu_preprocessuFalseu_clean(uselfubodyuheadersuinclude_dirsulanguCompileErroruok((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyutry_cpp�s


uconfig.try_cppcCs�|j�|j||||�\}}t|t�rItj|�}nt|�}d}	x8|j�}
|
dkrzPn|j	|
�r^d}	Pq^q^|j�|j�|	S(u�Construct a source file (just like 'try_cpp()'), run it through
        the preprocessor, and return true if any line of the output matches
        'pattern'.  'pattern' should either be a compiled regex object or a
        string containing a regex.  If both 'body' and 'headers' are None,
        preprocesses an empty file -- which can be useful to determine the
        symbols the preprocessor and compiler set by default.
        uFT(
u_check_compileru_preprocessu
isinstanceustrureucompileuopenuFalseureadlineusearchuTrueucloseu_clean(uselfupatternubodyuheadersuinclude_dirsulangusrcuoutufileumatchuline((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyu
search_cpp�s 	


uconfig.search_cppcCs|ddlm}|j�y |j||||�d}Wn|k
rTd}YnXtj|rgdpjd�|j�|S(uwTry to compile a source file built from 'body' and 'headers'.
        Return true on success, false otherwise.
        i(uCompileErrorusuccess!ufailure.TF(	udistutils.ccompileruCompileErroru_check_compileru_compileuTrueuFalseuloguinfou_clean(uselfubodyuheadersuinclude_dirsulanguCompileErroruok((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyutry_compile�s



uconfig.try_compilec

Cs�ddlm}m}|j�y&|j||||||�d}	Wn||fk
rfd}	YnXtj|	rydp|d�|j	�|	S(u�Try to compile and link a source file, built from 'body' and
        'headers', to executable form.  Return true on success, false
        otherwise.
        i(uCompileErroru	LinkErrorusuccess!ufailure.TF(
udistutils.ccompileruCompileErroru	LinkErroru_check_compileru_linkuTrueuFalseuloguinfou_clean(
uselfubodyuheadersuinclude_dirsu	librariesulibrary_dirsulanguCompileErroru	LinkErroruok((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyutry_link�s



uconfig.try_linkc

Cs�ddlm}m}|j�yA|j||||||�\}	}
}|j|g�d}Wn!||tfk
r�d}YnXt	j
|r�dp�d�|j�|S(u�Try to compile, link to an executable, and run a program
        built from 'body' and 'headers'.  Return true on success, false
        otherwise.
        i(uCompileErroru	LinkErrorusuccess!ufailure.TF(udistutils.ccompileruCompileErroru	LinkErroru_check_compileru_linkuspawnuTrueuDistutilsExecErroruFalseuloguinfou_clean(
uselfubodyuheadersuinclude_dirsu	librariesulibrary_dirsulanguCompileErroru	LinkErrorusrcuobjuexeuok((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyutry_run�s


uconfig.try_runic	Cs�|j�g}|r*|jd|�n|jd�|rQ|jd|�n|jd|�|jd�dj|�d}|j|||||�S(u�Determine if function 'func' is available by constructing a
        source file that refers to 'func', and compiles and links it.
        If everything succeeds, returns true; otherwise returns false.

        The constructed source file starts out by including the header
        files listed in 'headers'.  If 'decl' is true, it then declares
        'func' (as "int func()"); you probably shouldn't supply 'headers'
        and set 'decl' true in the same call, or you might get errors about
        a conflicting declarations for 'func'.  Finally, the constructed
        'main()' function either references 'func' or (if 'call' is true)
        calls it.  'libraries' and 'library_dirs' are used when
        linking.
        u
int %s ();u
int main () {u  %s();u  %s;u}u
(u_check_compileruappendujoinutry_link(	uselfufuncuheadersuinclude_dirsu	librariesulibrary_dirsudeclucallubody((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyu
check_funcs


uconfig.check_funccCs*|j�|jd|||g||�S(u�Determine if 'library' is available to be linked against,
        without actually checking that any particular symbols are provided
        by it.  'headers' will be used in constructing the source file to
        be compiled, but the only effect of this is to check if all the
        header files listed are available.  Any libraries listed in
        'other_libraries' will be included in the link, in case 'library'
        has symbols that depend on other libraries.
        uint main (void) { }(u_check_compilerutry_link(uselfulibraryulibrary_dirsuheadersuinclude_dirsuother_libraries((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyu	check_lib6s

uconfig.check_libcCs|jddd|gd|�S(u�Determine if the system header file named by 'header_file'
        exists and can be found by the preprocessor; return true if so,
        false otherwise.
        ubodyu
/* No body */uheadersuinclude_dirs(utry_cpp(uselfuheaderuinclude_dirsulibrary_dirsulang((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyucheck_headerDsuconfig.check_headerN(u	compiler=Nuspecify the compiler type(ucc=Nuspecify the compiler executable(u
include-dirs=uIu.list of directories to search for header files(udefine=uDuC preprocessor macros to define(uundef=uUu!C preprocessor macros to undefine(u
libraries=ulu!external C libraries to link with(u
library-dirs=uLu.directories to search for external C libraries(unoisyNu1show every action (compile, link, run, ...) taken(udump-sourceNu=dump generated source files before attempting to compile them(u__name__u
__module__u__qualname__udescriptionuNoneuuser_optionsuinitialize_optionsufinalize_optionsurunu_check_compileru_gen_temp_sourcefileu_preprocessu_compileu_linku_cleanutry_cppu
search_cpputry_compileutry_linkutry_runu
check_funcu	check_libucheck_header(u
__locals__((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyuconfigsT	
				
uconfigc
Csb|dkr tjd|�n
tj|�t|�}ztj|j��Wd|j�XdS(ujDumps a file content into log.info.

    If head is not None, will be dumped before the file content.
    u%sN(uNoneuloguinfouopenureaduclose(ufilenameuheadufile((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyu	dump_fileNs
u	dump_file(u__doc__usysuosureudistutils.coreuCommandudistutils.errorsuDistutilsExecErrorudistutils.sysconfigucustomize_compileru	distutilsuloguLANG_EXTuconfiguNoneu	dump_file(((u=/opt/alt/python33/lib64/python3.3/distutils/command/config.pyu<module>
s$�:

?>