ACC SHELL

Path : /usr/lib/python/distutils/command/
File Upload :
Current File : //usr/lib/python/distutils/command/build_ext.pyc

tMc@s1dZdZddkZddkZddkZddkZddkTddklZl	Z	ddk
lZddkTddk
lZlZddklZdd	klZdd
klZddklZeidjo#dd
klZeeZneidZdZdefdYZ dS(sdistutils.command.build_ext

Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP).s:$Id: build_ext.py 75395 2009-10-13 21:17:34Z tarek.ziade $iN(t*(t	USER_BASEt	USER_SITE(tCommand(tcustomize_compilertget_python_version(tnewer_group(t	Extension(tget_platform(tlogtnt(tget_build_versions3^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$cCsddkl}|dS(Ni(tshow_compilers(tdistutils.ccompilerR(R((s1/usr/lib/python2.6/distutils/command/build_ext.pyR st	build_extcBs?eZdZdeiZdFdGdd	d
efddd
dfdddefdHdIdJdddefdKdLdMdNdOdQdRdSdTgZdd$d'd-d3gZ	d5dPd6e
fgZd7Zd8Z
d9Zd:Zd;Zd<Zd=Zd>Zd?Zd@ZdAZdBZdCZdDZdEZRS(Us8build C/C++ extensions (compile/link to build directory)s (separated by '%s')s
build-lib=tbs(directory for compiled extension modulessbuild-temp=tts1directory for temporary files (build by-products)s
plat-name=tps>platform name to cross-compile for, if supported (default: %s)tinplacetis=ignore build-lib and put compiled extensions into the source s,directory alongside your pure Python moduless
include-dirs=tIs.list of directories to search for header filessdefine=tDsC preprocessor macros to definesundef=tUs!C preprocessor macros to undefines
libraries=tls!external C libraries to link withs
library-dirs=tLs.directories to search for external C librariessrpath=tRs7directories to search for shared C libraries at runtimes
link-objects=tOs2extra explicit link objects to include in the linktdebugtgs'compile/link with debugging informationtforcetfs2forcibly build everything (ignore file timestamps)s	compiler=tcsspecify the compiler typesswig-cpps)make SWIG create C++ files (default is C)s
swig-opts=s!list of SWIG command line optionssswig=spath to the SWIG executabletusers#add user include, library and rpaths
help-compilerslist available compilerscCsd|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_dS(Ni(tNonet
extensionst	build_libt	plat_namet
build_tempRtpackagetinclude_dirstdefinetundeft	librariestlibrary_dirstrpathtlink_objectsRRtcompilertswigtswig_cppt	swig_optsR (tself((s1/usr/lib/python2.6/distutils/command/build_ext.pytinitialize_optionsls(																			c	
Cs:ddkl}|idd/d0d1d2d3d4|idjo|ii|_n|ii|_|i	}|i	d
d}|i
djo|ii
pg|_
nt|i
to|i
i
ti|_
n|i
i|||jo|i
i|nt|ito|ig|_n|idjo
g|_n|idjo
g|_n6t|itjoti
|iti|_n|idjo
g|_n6t|itjoti
|iti|_ntidjo|iitiitid
|iotii|id|_ntii|id|_|i
itiitidtdjos|idjo
d}n|id}tiitid}|otii||}n|ii|qtdjo,|iitiitidddqtdjo)|iitiitiddq|iitiitiddntidjo&|iitiitidnti d djpti d d jolti!i"tiitid!o3|iitiiti#d"d#t$d$qj|iid%n|i%d&ti i"d'p&ti i"d(pti i"d)of|i%d&oVti!i"tiitid!o|ii|i%d*q|iid%n|i&o+|i&i
d+}t'd,||_&n|i(o|i(i
d+|_(n|i)djo
g|_)n|i)i
d-|_)|i*otiit+d.}tiit+d"}tii,|o|i
i|ntii,|o$|ii||ii|q6ndS(5Ni(t	sysconfigtbuildR#R%R.RRR$t
plat_specificiR
tlibstDebugtReleasetPCi	twin32titPCbuildisVS8.0twin32releaseisVS7.1tVC6tos2tConfigitcygwintatheostbintlibtpythontconfigt.tPy_ENABLE_SHAREDtlinuxtgnutsunostLIBDIRt,cSs
|dfS(t1((tsymbol((s1/usr/lib/python2.6/distutils/command/build_ext.pyt<lambda>st tinclude(s	build_libs	build_lib(s
build_temps
build_temp(scompilerscompiler(sdebugsdebug(sforcesforce(s	plat_names	plat_name(-t	distutilsR4tset_undefined_optionsR&R!tdistributiontext_packagetext_modulesR"tget_python_incR't
isinstancetstrtsplittostpathseptappendR*R+ttypet
StringTypetstringR,tnametpathtjointsystexec_prefixRR%tMSVC_VERSIONR$tplatformt
executablet
startswithtprefixRtget_config_varR(tmapR)R1R Rtisdir(	R2R4t
py_includetplat_py_includetsuffixtnew_libtdefinestuser_includetuser_lib((s1/usr/lib/python2.6/distutils/command/build_ext.pytfinalize_optionss	



"
"




&(%

&%



c
Cs3ddkl}|ipdS|iioC|id}|ii|ipg|i	i
|in|d|id|i
d|id|i|_t|itidjo*|itjo|ii|in|idj	o|ii|in|idj	o1x.|iD]\}}|ii||q*Wn|idj	o(x%|iD]}|ii|qkWn|idj	o|ii|in|i	dj	o|ii|i	n|idj	o|ii |in|i!dj	o|ii"|i!n|i#dS(	Ni(tnew_compilert
build_clibR.tverbosetdry_runRR
($R
RxR"RVthas_c_librariestget_finalized_commandR*textendtget_library_namesR+R_RyR.RzR{RRR]RcR$Rt
initializeR'R!tset_include_dirsR(tdefine_macroR)tundefine_macrot
set_librariestset_library_dirsR,tset_runtime_library_dirsR-tset_link_objectstbuild_extensions(R2RxRyRctvaluetmacro((s1/usr/lib/python2.6/distutils/command/build_ext.pytrunsB
		
#

c
Cs:t|tp
tdnxt|D]\}}t|toq*nt|tpt|djo
tdn|\}}tid|t|t	o
t
i|p
tdnt|tp
tdnt||d}x>dD]6}|i
|}|dj	ot|||qqW|i
d|_d|jotidn|i
d}|og|_g|_x|D]}	t|	tot|	djp
tdnt|	djo|ii|	dqt|	djo|ii|	qqWn|||<q*WdS(sEnsure 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.
        s:'ext_modules' option must be a list of Extension instancesisMeach element of 'ext_modules' option must be an Extension instance or 2-tuplesuold-style (ext_name, build_info) tuple found in ext_modules for extension '%s'-- please convert to Extension instancesRfirst element of each tuple in 'ext_modules' must be the extension name (a string)sOsecond element of each tuple in 'ext_modules' must be a dictionary (build info)tsourcesR'R+R*t
extra_objectstextra_compile_argstextra_link_argsR,tdef_files9'def_file' element of build info dict no longer supportedtmacrosis9'macros' element of build info dict must be 1- or 2-tupleiN(sinclude_dirsslibrary_dirss	librariess
extra_objectssextra_compile_argssextra_link_args(ii(RZtlisttDistutilsSetupErrort	enumerateRttupletlenR	twarnR[textension_name_retmatchtdicttgetR!tsetattrtruntime_library_dirst
define_macrostundef_macrosR_(
R2R"Rtexttext_namet
build_infotkeytvalRR((s1/usr/lib/python2.6/distutils/command/build_ext.pytcheck_extensions_listVsZ


$
	



		#
cCs>|i|ig}x!|iD]}|i|iq W|S(N(RR"R~R(R2t	filenamesR((s1/usr/lib/python2.6/distutils/command/build_ext.pytget_source_filess
cCsG|i|ig}x*|iD]}|i|i|iq W|S(N(RR"R_tget_ext_fullpathRc(R2toutputsR((s1/usr/lib/python2.6/distutils/command/build_ext.pytget_outputss
cCs5|i|ix|iD]}|i|qWdS(N(RR"tbuild_extension(R2R((s1/usr/lib/python2.6/distutils/command/build_ext.pyRs
c
Cs	|i}|djpt|ttfjotddd|int|}|i|i}||i	}|i
pt||dpti
d|idStid|i|i||}|ipg}|i}x!|iD]}|i|fqW|ii|d|id|d	|id
|i
d|d|i	}||_|io|i|in|ipg}|ip|ii|}	|ii||d
|i|d|i d|i!d|d|i"|d
|i
d|id|	dS(Ns*in 'ext_modules' option (extension '%s'), s&'sources' must be present and must be sa list of source filenamestnewers$skipping '%s' extension (up-to-date)sbuilding '%s' extensiont
output_dirRR'Rtextra_postargstdependsR*R+Rtexport_symbolsR%ttarget_lang(#RR!R`tListTypet	TupleTypeRRcRRRRRR	Rtinfotswig_sourcesRRRR_R.tcompileR%R't_built_objectsRR~Rtlanguagetdetect_languagetlink_shared_objectt
get_librariesR+Rtget_export_symbols(
R2RRtext_pathRt
extra_argsRR)tobjectsR((s1/usr/lib/python2.6/distutils/command/build_ext.pyRsP	&


			

						c
Csg}g}h}|iotidn|ip d|ijpd|ijo
d}nd}xt|D]l}tii|\}}	|	djo4|i|d||i||d||<qn|i|qnW|p|S|ip
|i	}
|
dg}|i
|i|io|idn|ip%x"|iD]}|i|qKWnxE|D]=}||}
tid	||
|i|d
|
|gqmW|S(sWalk 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.
        s/--swig-cpp is deprecated - use --swig-opts=-c++s-c++s.cpps.cs.it_wrapis-pythonsswigging %s to %ss-o(
R0R	RR1R]RdtsplitextR_R/t	find_swigR~Rtspawn(R2Rt	extensiontnew_sourcesRtswig_targetst
target_exttsourcetbaseRR/tswig_cmdtottarget((s1/usr/lib/python2.6/distutils/command/build_ext.pyRsD







cCstidjodStidjoJxldD]7}tiid|d}tii|o|Sq,WdSn&tid	jodStd
tidS(
sReturn the name of the SWIG executable.  On Unix, this is
        just "swig" -- it should be in the PATH.  Tries a bit harder on
        Windows.
        tposixR/R
s1.3s1.2s1.1s	c:\swig%ssswig.exeR@s>I don't know how to find (much less run) SWIG on platform '%s'N(s1.3s1.2s1.1(R]RcRdRetisfiletDistutilsPlatformError(R2tverstfn((s1/usr/lib/python2.6/distutils/command/build_ext.pyRPs	c	Cstidtid}|i|}|i|}|id}|i|}tii|d}|i	p4tii
|d |g}tii
|i|Sdi
|dd!}|id}tii
|i|}tii
||S(sReturns the path of the filename for a given extension.

        The file is located in `build_lib` or directly in the package
        (inplace option).
        t/s..RHiitbuild_py(Rbt	maketransR]tsept	translatetget_ext_fullnameR\tget_ext_filenameRdRReR#R}tabspathtget_package_dir(	R2Rtall_dotstfullnametmodpathtfilenameR&Rtpackage_dir((s1/usr/lib/python2.6/distutils/command/build_ext.pyRqs
cCs(|idjo|S|id|SdS(sSReturns the fullname of a given extension name.

        Adds the `package.` prefixRHN(R&R!(R2R((s1/usr/lib/python2.6/distutils/command/build_ext.pyRscCsddkl}ti|d}tidjo*|t|dd |t|d<n|d}tidjo&|iotti	i
|d	|Sti	i
||S(
sConvert 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").
        i(RmRHR@iitSOR
t_d(tdistutils.sysconfigRmRbR\R]RcRRtapplyRdRe(R2RRmRtso_ext((s1/usr/lib/python2.6/distutils/command/build_ext.pyRs*cCsEd|iidd}||ijo|ii|n|iS(sReturn the list of symbols that a shared extension has to
        export.  This either uses 'ext.export_symbols' or, if it's not
        provided, "init" + module_name.  Only relevant on Windows, where
        the .pyd file (DLL) must export the module "init" function.
        tinitRHi(RcR\RR_(R2Rt
initfunc_name((s1/usr/lib/python2.6/distutils/command/build_ext.pyRscCsStidjo}ddkl}t|i|pOd}|io|d}n|tid?tid?d@f}|i|gS|iSntid	jo7d}|tid?tid?d@f}|i|gStid
 djo7d}|tid?tid?d@f}|i|gStid
 d
joddk	l
}d}|tid?tid?d@f}g}xO|idiD]8}|i
do|i|dq|i|qW|i|dg|Stidjo|iSddk	l
}|ido7d}|tid?tid?d@f}|i|gS|iSdS(sReturn the list of libraries to link against when building a
        shared extension.  On most platforms, this is just 'ext.libraries';
        on Windows and OS/2, we add the Python library (eg. python20.dll).
        R;i(tMSVCCompilers
python%d%dRiiitos2emxiRBspython%d.%dRC(R4tSHLIBSs-litmtdarwinRIN(RfRitdistutils.msvccompilerRRZR.Rt
hexversionR*RTR4RmR\RkR_(R2RRttemplatet	pythonlibR4textraRE((s1/usr/lib/python2.6/distutils/command/build_ext.pyRsR

(s
build-lib=Rs(directory for compiled extension modules(sbuild-temp=Rs1directory for temporary files (build by-products)(sdefine=RsC preprocessor macros to define(sundef=Rs!C preprocessor macros to undefine(s
libraries=Rs!external C libraries to link with(srpath=Rs7directories to search for shared C libraries at runtime(s
link-objects=Rs2extra explicit link objects to include in the link(sdebugRs'compile/link with debugging information(sforceRs2forcibly build everything (ignore file timestamps)(s	compiler=Rsspecify the compiler typeN(sswig-cppNs)make SWIG create C++ files (default is C)(s
swig-opts=Ns!list of SWIG command line options(sswig=Nspath to the SWIG executable(suserNs#add user include, library and rpath(t__name__t
__module__tdescriptionR]R^tsep_byRR!tuser_optionstboolean_optionsRthelp_optionsR3RwRRRRRRRRRRRRR(((s1/usr/lib/python2.6/distutils/command/build_ext.pyR%st



				@	N	
			S	:	!	 				(!t__doc__t__revision__RfR]RbtrettypestsiteRRtdistutils.coreRtdistutils.errorsRRRtdistutils.dep_utilRtdistutils.extensionRtdistutils.utilRRTR	RcRRtintRhRRRR(((s1/usr/lib/python2.6/distutils/command/build_ext.pyt<module>s$0

		

ACC SHELL 2018