File "build_ext.cpython-34.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python34/lib64/python3.4/distutils/command/__pycache__/build_ext.cpython-34.pyc
File size: 16.73 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit


h fy@s dZddlZddlZddlZddlmZddlTddlmZm	Z	ddlm
Z
ddlmZddl
mZdd	lmZdd
lmZddlmZejdkrdd
lmZeeZnejdZddZGdddeZdS)zdistutils.command.build_ext

Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP).N)Command)*)customize_compilerget_python_version)get_config_h_filename)newer_group)	Extension)get_platform)log)	USER_BASEnt)get_build_versionz3^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$cCsddlm}|dS)Nr)show_compilers)distutils.ccompilerr)rr@/opt/alt/python34/lib64/python3.4/distutils/command/build_ext.pyrsrc@steZdZdZdejZdWdXd	d
defdd
ddfdddefdYdZd[dddefd\d]d^d_d`dadbdcddgZdd%d(d.d5gZ	d7d/d8e
fgZd9d:Zd;d<Z
d=d>Zd?d@ZdAdBZdCdDZdEdFZdGdHZdIdJZdKdLZdMdNZdOdPZdQdRZdSdTZdUdVZd/S)e	build_extz8build C/C++ extensions (compile/link to build directory)z (separated by '%s')
build-lib=b(directory for compiled extension modulesbuild-temp=t1directory for temporary files (build by-products)z
plat-name=pz>platform name to cross-compile for, if supported (default: %s)inplaceiz=ignore build-lib and put compiled extensions into the source z,directory alongside your pure Python modulesz
include-dirs=Iz.list of directories to search for header filesdefine=DC preprocessor macros to defineundef=U!C preprocessor macros to undefine
libraries=l!external C libraries to link withz
library-dirs=Lz.directories to search for external C librariesrpath=R7directories to search for shared C libraries at runtime
link-objects=O2extra explicit link objects to include in the linkdebugg'compile/link with debugging informationforcef2forcibly build everything (ignore file timestamps)	compiler=cspecify the compiler typeswig-cppN)make SWIG create C++ files (default is C)
swig-opts=!list of SWIG command line optionsswig=path to the SWIG executableuser#add user include, library and rpathz
help-compilerzlist available compilerscCsd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_dS)Nr)
extensions	build_lib	plat_name
build_temprpackageinclude_dirsdefineundef	librarieslibrary_dirsrpathlink_objectsr-r0compilerswigswig_cpp	swig_optsr<)selfrrrinitialize_optionsis(																			zbuild_ext.initialize_optionsc
	Csddlm}|jdd,d-d.d/d0d1|jdkrP|jj|_n|jj|_|j}|jd
d}|j	dkr|jj	pg|_	nt
|j	tr|j	jt
j|_	ntjtjkr|j	jt
jjtjdn|j	j|||kr7|j	j|n|jd
|jdkr_g|_n|jdkrzg|_n-t
|jtr|jjt
j|_n|jdkrg|_n-t
|jtr|jjt
j|_nt
jdkr|jjt
jjtjdtjtjkrW|jjt
jjtjdn|jr~t
jj|jd|_nt
jj|jd|_|j	jt
jjtttdd}|r|jj|nt dkrc|j!dkrd}n|j!dd}t
jjtjd}|rPt
jj||}n|jj|qt dkr|jjt
jjtjddqt dkr|jjt
jjtjddq|jjt
jjtjddntj"dddks%tj"ddd krtj#j$t
jjtjd!r{|jjt
jjtjd"d#t%d$q|jjd%n|j&d&r|j's|jj|j&d'q|jjd%n|j(r	|j(jd(}d)d*|D|_(n|j)r*|j)jd(|_)n|j*dkrEg|_*n|j*jd+|_*|j+rt
jjt,d}t
jjt,d"}	t
jj-|r|j	j|nt
jj-|	r|jj|	|jj|	qndS)2Nr)	sysconfigZbuildr?rArJr-r0r@Z
plat_specificincluderFrZlibsZDebugZRelease_home	win32ZPCbuildPCzVS8.0zVS7.1ZVC6cygwinatheosbinlibpythonconfig.Py_ENABLE_SHAREDLIBDIR,cSsg|]}|dfqS)1r).0Zsymbolrrr
<listcomp>s	z.build_ext.finalize_options.<locals>.<listcomp> )	build_librj)
build_temprk)compilerrl)debugrm)forcern)	plat_namero).	distutilsrPZset_undefined_optionsrBdistributionZext_packageZext_modulesr>Zget_python_incrC
isinstancestrsplitospathsepsysexec_prefixbase_exec_prefixappendpathjoinZensure_string_listrFrGrHnameprefixr-rAdirnamergetattrMSVC_VERSIONr@platform
executable
startswithrget_config_varZpython_buildrDrErMr<risdir)
rNrPZ
py_includeZplat_py_include	_sys_homesuffixZnew_libZdefinesZuser_includeZuser_librrrfinalize_optionss	%
"%		2$

				zbuild_ext.finalize_optionsc	Csddlm}|jsdS|jjrm|jd}|jj|jpSg|j	j
|jn|d|jd|j
d|jd|j|_t|jtjdkr|jtkr|jj|jn|jdk	r|jj|jn|jdk	rEx-|jD]\}}|jj||qWn|jdk	r{x$|jD]}|jj|q^Wn|jdk	r|jj|jn|j	dk	r|jj|j	n|jdk	r|jj|jn|j dk	r|jj!|j n|j"dS)	Nr)new_compiler
build_clibrJverbosedry_runr0r)#rrr>rqZhas_c_librariesget_finalized_commandrFextendZget_library_namesrGrzrrJrrr0rrur}r@r	Z
initializerCZset_include_dirsrDZdefine_macrorEZundefine_macroZ
set_librariesZset_library_dirsrHZset_runtime_library_dirsrIZset_link_objectsbuild_extensions)rNrrr}valuemacrorrrruns>			
!z
build_ext.runc
Cs0t|tstdnxt|D]\}}t|trLq+nt|tsnt|dkr}tdn|\}}tjd|t|t	ot
j|stdnt|tstdnt||d}x<dD]4}|j
|}|dk	rt|||qqW|j
d|_d|kretjdn|j
d}|rg|_g|_x|D]}	t|	tot|	dkstdnt|	dkr|jj|	dqt|	dkr|jj|	qqWn|||<q+WdS)aEnsure that the list of extensions (presumably provided as a
        command option 'extensions') is valid, i.e. it is a list of
        Extension objects.  We also support the old-style list of 2-tuples,
        where the tuples are (ext_name, build_info), which are converted to
        Extension instances here.

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z:'ext_modules' option must be a list of Extension instanceszMeach element of 'ext_modules' option must be an Extension instance or 2-tuplezuold-style (ext_name, build_info) tuple found in ext_modules for extension '%s'-- please convert to Extension instancezRfirst element of each tuple in 'ext_modules' must be the extension name (a string)zOsecond element of each tuple in 'ext_modules' must be a dictionary (build info)sourcesrCrGrF
extra_objectsextra_compile_argsextra_link_argsNrHZdef_filez9'def_file' element of build info dict no longer supportedmacrosrQz9'macros' element of build info dict must be 1- or 2-tupler)zinclude_dirszlibrary_dirsz	librariesz
extra_objectszextra_compile_argszextra_link_args)rQr)rrlistDistutilsSetupError	enumeratertuplelenr
warnrsextension_name_rematchdictgetsetattrruntime_library_dirs
define_macrosundef_macrosrz)
rNr>rextext_nameZ
build_infokeyvalrrrrrcheck_extensions_listUsT
"	
		
!zbuild_ext.check_extensions_listcCs>|j|jg}x!|jD]}|j|jq W|S)N)rr>rr)rN	filenamesrrrrget_source_filess
zbuild_ext.get_source_filescCsG|j|jg}x*|jD]}|j|j|jq W|S)N)rr>rzget_ext_fullpathr})rNZoutputsrrrrget_outputss
zbuild_ext.get_outputscCs|j|jx||jD]q}y|j|Wqtttfk
r}z.|js^n|jd|j|fWYdd}~XqXqWdS)Nz"building extension "%s" failed: %s)	rr>build_extensionZCCompilerErrorZDistutilsErrorZCompileErrorZoptionalrr})rNrerrrrs		zbuild_ext.build_extensionsc
Cs	|j}|dks+t|ttfrAtd|jnt|}|j|j}||j}|jpt	||dst
jd|jdSt
jd|j|j
||}|jpg}|jdd}x!|jD]}|j|fqW|jj|d|jd|d|jd|jd	|d
|j}|dd|_|jrz|j|jn|jpg}|jp|jj|}	|jj||d|j|d|jd
|jd	|d|j |d|jd|jd|	dS)Nzjin 'ext_modules' option (extension '%s'), 'sources' must be present and must be a list of source filenamesZnewerz$skipping '%s' extension (up-to-date)zbuilding '%s' extensionZ
output_dirrrCr-Zextra_postargsdependsrFrGrexport_symbolsrAZtarget_lang)!rrrrrrr}rrr0rr
r-infoswig_sourcesrrrrzrJcompilerArCZ_built_objectsrrrlanguageZdetect_languageZlink_shared_object
get_librariesrGrget_export_symbols)
rNrrext_pathrZ
extra_argsrrEZobjectsrrrrrsN	"
										zbuild_ext.build_extensioncCsg}g}i}|jr+tjdn|jsRd|jksRd|jkr[d}nd}xr|D]j}tjj|\}}	|	dkr|j|d||j||d||<qh|j|qhW|s|S|jp|j	}
|
dg}|j
|j|jr*|jdn|jsWx!|jD]}|j|q=WnxE|D]=}||}
tjd	||
|j|d
|
|gq^W|S)zWalk the list of source files in 'sources', looking for SWIG
        interface (.i) files.  Run SWIG on all that are found, and
        return a modified 'sources' list with SWIG source files replaced
        by the generated C (or C++) files.
        z/--swig-cpp is deprecated - use --swig-opts=-c++z-c++z.cppz.cz.i_wraprQz-pythonzswigging %s to %sz-o)
rLr
rrMrur{splitextrzrK	find_swigrrZspawn)rNr	extensionZnew_sourcesrZswig_targetsZ
target_extsourcebaserrKZswig_cmdotargetrrrrs>		

		

zbuild_ext.swig_sourcescCstjdkrdStjdkrixWdD]5}tjjd|d}tjj|r)|Sq)WdSntd	tjd
S)zReturn the name of the SWIG executable.  On Unix, this is
        just "swig" -- it should be in the PATH.  Tries a bit harder on
        Windows.
        posixrKr1.31.21.1z	c:\swig%szswig.exez>I don't know how to find (much less run) SWIG on platform '%s'N)rrr)rur}r{r|isfileZDistutilsPlatformError)rNZversfnrrrrOs
zbuild_ext.find_swigcCs|j|}|jd}|j|d}|jsstjj|dd|g}tjj|j|Sdj|dd}|jd}tjj	|j
|}tjj||S)	zReturns the path of the filename for a given extension.

        The file is located in `build_lib` or directly in the package
        (inplace option).
        rbrQNrbuild_pyrrr)get_ext_fullnamertget_ext_filenamerrur{r|r?rabspathZget_package_dir)rNrfullnameZmodpathfilenamerBrZpackage_dirrrrrgs	#zbuild_ext.get_ext_fullpathcCs&|jdkr|S|jd|SdS)zSReturns the fullname of a given extension name.

        Adds the `package.` prefixNrb)rB)rNrrrrrszbuild_ext.get_ext_fullnamecCsoddlm}|jd}|d}tjdkr[|jr[tjj|d|Stjj||S)zConvert the name of an extension (eg. "foo.bar") into the name
        of the file from which it will be loaded (eg. "foo/bar.so", or
        "foo\bar.pyd").
        r)rrb
EXT_SUFFIXr_d)distutils.sysconfigrrtrur}r-r{r|)rNrrrZ
ext_suffixrrrrszbuild_ext.get_ext_filenamecCsCd|jjdd}||jkr<|jj|n|jS)aReturn the list of symbols that a shared extension has to
        export.  This either uses 'ext.export_symbols' or, if it's not
        provided, "PyInit_" + module_name.  Only relevant on Windows, where
        the .pyd file (DLL) must export the module "PyInit_" function.
        ZPyInit_rbrQr)r}rtrrz)rNrZ
initfunc_namerrrrszbuild_ext.get_export_symbolscCs0tjdkrddlm}t|j|s}d}|jrM|d}n|tjd?tjd?d@f}|j|gS|jSntjd	d
dkrd}|tjd?tjd?d@f}|j|gStjd	d
d
krddl	m
}d}|tjd?tjd?d@f}g}xS|jdjD]<}|j
drr|j|dd	qC|j|qCW|j|dg|Stjdkr|jStjd	ddkr|jSddl	m
}|jdr%djtjd?tjd?d@tj}|j|gS|jSd	S)zReturn the list of libraries to link against when building a
        shared extension.  On most platforms, this is just 'ext.libraries';
        on Windows, we add the Python library (eg. python20.dll).
        rUr)MSVCCompilerz
python%d%drNr[r\zpython%d.%dr])rPSHLIBSz-lrmdarwinaixrcz
python{}.{}{})rwrdistutils.msvccompilerrrrrJr-
hexversionrFrprPrrtrrzformatabiflags)rNrrtemplateZ	pythonlibrPZextrar_rrrrsJ
	

zbuild_ext.get_libraries)rrr)rrr)rrr)r r!r")r#r$r%)r'r(r))r*r+r,)zdebugr.r/)zforcer1r2)r3r4r5)r6Nr7)r8Nr9)r:Nr;)zuserNr=)__name__
__module____qualname__ZdescriptionrurvZsep_byr	Zuser_optionsZboolean_optionsrZhelp_optionsrOrrrrrrrrrrrrrrrrrrr"st



	@N	
R6	
r)__doc__rwrureZdistutils.corerZdistutils.errorsrrrrZdistutils.dep_utilrZdistutils.extensionrZdistutils.utilr	rpr
Zsiterr}rr
intrrrrrrrrr<module>s"$