%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/distutils/command/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/distutils/command/build_ext.pyo


Pac@s/dZdZddlZddlZddlZddlZddlTddlmZm	Z	ddl
mZddlTddl
mZmZddlmZdd	lmZdd
lmZddlmZejdkrdd
lmZeeZnejdZdZdefdYZ 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$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]*)*$cCsddlm}|dS(Ni(tshow_compilers(tdistutils.ccompilerR(R((s7/usr/local/lib/python2.7/distutils/command/build_ext.pyR st	build_extcBs?eZdZdejZdFdGdd	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((s7/usr/local/lib/python2.7/distutils/command/build_ext.pytinitialize_optionsls(																			c
	Csddlm}|jdd.d/d0d1d2d3|jdkrP|jj|_n|jj|_|j	}|j	d
d}|j
dkr|jj
pg|_
nt|j
tr|j
j
tj|_
n|j
j|||kr|j
j|n|jd|jd
|jdkr5g|_n|jdkrPg|_n3t|jtkrtj
|jtj|_n|jdkrg|_n3t|jtkrtj
|jtj|_ntjdkr|jjtjjtjd|jr)tjj|jd|_ntjj|jd|_|j
jtjjtjdtdkr|j dkrd}n
|j d}xd4d5fD]L}tjjtj|}|rtjj||}n|jj|qWqtdkr+|jjtjjtjddqtdkr_|jjtjjtjddq|jjtjjtjddntjdkr|jjtjjtjdntj!d  d!kstj!d  d"krJtj"j#tjjtjd#r7|jjtjjtj$d$d%t%d&qJ|jjd'n|j&d(r|j's~|jj|j&d)q|jjd'n|j(r|j(j
d*}t)d+||_(n|j*r|j*j
d*|_*n|j+dkrg|_+n|j+j
d,|_+|j,rtjjt-d-}tjjt-d$}	tjj.|rm|j
j|ntjj.|	r|jj|	|jj|	qndS(6Ni(t	sysconfigtbuildR#R%R.RRR$t
plat_specificiR*R-R
tlibstDebugtReleasetPCi	twin32titPCbuildsVS9.0isVS8.0isVS7.1tVC6tos2tConfigitcygwintatheostbintlibtpythontconfigt.tPy_ENABLE_SHAREDtLIBDIRt,cSs
|dfS(Nt1((tsymbol((s7/usr/local/lib/python2.7/distutils/command/build_ext.pyt<lambda>R<t tinclude(R#R#(R%R%(R.R.(RR(RR(R$R$(R=(R:sVS9.0(/t	distutilsR4tset_undefined_optionsR&R!tdistributiontext_packagetext_modulesR"tget_python_incR't
isinstancetstrtsplittostpathseptappendtensure_string_listR*R+ttypet
StringTypetstringR,tnametpathtjointsystexec_prefixRR%tMSVC_VERSIONR$tplatformt
executablet
startswithtprefixRtget_config_vartpython_buildR(tmapR)R1R Rtisdir(
R2R4t
py_includetplat_py_includetsuffixtdtnew_libtdefinestuser_includetuser_lib((s7/usr/local/lib/python2.7/distutils/command/build_ext.pytfinalize_optionss	

"	"	
%&$

				c	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(	Ni(tnew_compilert
build_clibR.tverbosetdry_runRR
($R
RwR"RRthas_c_librariestget_finalized_commandR*textendtget_library_namesR+R[RxR.RyRzRRRYR`R$Rt
initializeR'R!tset_include_dirsR(tdefine_macroR)tundefine_macrot
set_librariestset_library_dirsR,tset_runtime_library_dirsR-tset_link_objectstbuild_extensions(R2RwRxR`tvaluetmacro((s7/usr/local/lib/python2.7/distutils/command/build_ext.pytruns>			
!c
Cs!t|tstdnxt|D]\}}t|trIq(nt|tskt|dkrwtdn|\}}tjd|t|t	ot
j|stdnt|tstdnt||d}x<dD]4}|j
|}|dk	rt|||qqW|j
d|_d|krYtjdn|j
d}|rg|_g|_x|D]}	t|	tot|	dkstdnt|	dkr|jj|	dqt|	dkr|jj|	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-tuplesvold-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(R'R+R*RRR(ii(RVtlisttDistutilsSetupErrort	enumerateRttupletlenR	twarnRWtextension_name_retmatchtdicttgetR!tsetattrtruntime_library_dirst
define_macrostundef_macrosR[(
R2R"Rtexttext_namet
build_infotkeytvalRR((s7/usr/local/lib/python2.7/distutils/command/build_ext.pytcheck_extensions_listVsT
	"				
		
!	cCs>|j|jg}x!|jD]}|j|jq W|S(N(RR"R}R(R2t	filenamesR((s7/usr/local/lib/python2.7/distutils/command/build_ext.pytget_source_filess
cCsG|j|jg}x*|jD]}|j|j|jq W|S(N(RR"R[tget_ext_fullpathR`(R2toutputsR((s7/usr/local/lib/python2.7/distutils/command/build_ext.pytget_outputss
cCs5|j|jx|jD]}|j|qWdS(N(RR"tbuild_extension(R2R((s7/usr/local/lib/python2.7/distutils/command/build_ext.pyRsc
Cs|j}|dks-t|ttfkrHtddd|jnt|}|j|j}||j	}|j
pt||dstj
d|jdStjd|j|j||}|jpg}|j}x!|jD]}|j|fqW|jj|d|jd|d	|jd
|j
d|d|j	}||_|jro|j|jn|jp{g}|jp|jj|}	|jj||d
|j|d|j d|j!d|d|j"|d
|j
d|jd|	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	TupleTypeRR`RRRRRR	Rtinfotswig_sourcesRRRR[R.tcompileR%R't_built_objectsRR}Rtlanguagetdetect_languagetlink_shared_objectt
get_librariesR+Rtget_export_symbols(
R2RRtext_pathRt
extra_argsRR)tobjectsR((s7/usr/local/lib/python2.7/distutils/command/build_ext.pyRsN	$

			
							cCsg}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(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	RR1RYRatsplitextR[R/t	find_swigR}Rtspawn(R2Rt	extensiontnew_sourcesRtswig_targetst
target_exttsourcetbaseRR/tswig_cmdtottarget((s7/usr/local/lib/python2.7/distutils/command/build_ext.pyRs>		

		

cCstjdkrdStjdkrixgdD]5}tjjd|d}tjj|r)|Sq)WdSn#tjd	kr|dStd
tjdS(
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(RYR`RaRbtisfiletDistutilsPlatformError(R2tverstfn((s7/usr/local/lib/python2.7/distutils/command/build_ext.pyRPs
c	Cstjdtjd}|j|}|j|}|jd}|j|}tjj|d}|j	stjj
|d |g}tjj
|j|Sdj
|dd!}|jd}tjj
|j|}tjj
||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..RGiitbuild_py(R_t	maketransRYtsept	translatetget_ext_fullnameRXtget_ext_filenameRaRRbR#R|tabspathtget_package_dir(	R2Rtall_dotstfullnametmodpathtfilenameR&Rtpackage_dir((s7/usr/local/lib/python2.7/distutils/command/build_ext.pyRqs	cCs&|jdkr|S|jd|SdS(sSReturns the fullname of a given extension name.

        Adds the `package.` prefixRGN(R&R!(R2R((s7/usr/local/lib/python2.7/distutils/command/build_ext.pyRscCsddlm}tj|d}tjdkrZ|t|dd |t|d<n|d}tjdkr|jrtjj	|d	|Stjj	||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(RjRGR?iitSOR
t_d(
tdistutils.sysconfigRjR_RXRYR`RRRaRb(R2RRjRtso_ext((s7/usr/local/lib/python2.7/distutils/command/build_ext.pyRs)cCsCd|jjdd}||jkr<|jj|n|jS(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.
        tinitRGi(R`RXRR[(R2Rt
initfunc_name((s7/usr/local/lib/python2.7/distutils/command/build_ext.pyRscCs[tjdkrddlm}t|j|s}d}|jrM|d}n|tjd?tjd?d@f}|j|gS|jSntjd	krd}|tjd?tjd?d@f}|j|gStjd
 dkrd}|tjd?tjd?d@f}|j|gStjd
 d
krddl	m
}d}|tjd?tjd?d@f}g}xM|jdjD]6}|j
dr|j|dq||j|q|W|j|dg|Stjdkr|jStjd dkr|jSddl	m
}|jdrPd}|tjd?tjd?d@f}|j|gS|jSdS(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%dRiiitos2emxiRAspython%d.%dRB(R4tSHLIBSs-litmtdarwinitaixRHN(RcRftdistutils.msvccompilerRRVR.Rt
hexversionR*RPR4RjRXRhR[(R2RRttemplatet	pythonlibR4textraRD((s7/usr/local/lib/python2.7/distutils/command/build_ext.pyRsT
	

(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(RRs'compile/link with debugging information(RRs2forcibly 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(R Ns#add user include, library and rpath(t__name__t
__module__tdescriptionRYRZtsep_byRR!tuser_optionstboolean_optionsRthelp_optionsR3RvRRRRRRRRRRRRR(((s7/usr/local/lib/python2.7/distutils/command/build_ext.pyR%st



				@	N	
			S	:	!	 				(!t__doc__t__revision__RcRYR_trettypestsiteRRtdistutils.coreRtdistutils.errorsRRRtdistutils.dep_utilRtdistutils.extensionRtdistutils.utilRRPR	R`RRtintReRRRR(((s7/usr/local/lib/python2.7/distutils/command/build_ext.pyt<module>s$0

		

Zerion Mini Shell 1.0