Your IP : 3.139.86.53


Current Path : /lib/python2.7/site-packages/setuptools/command/
Upload File :
Current File : //lib/python2.7/site-packages/setuptools/command/build_ext.pyo

�
�fc@s%ddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZddlmZddlmZdd	lmZyddlmZed
�Wnek
r�eZnXe
d�ddlmZd
�ZeZeZdZ ej!dkr;e"ZnIej#dkr�y#ddl$Z$e%e$d�ZZWq�ek
r�q�Xnd�Z&d�Z'defd��YZes�ej#dkr�ddddddddddd�
Z)n-dZ ddddddddddd�
Z)d�Z*dS(i����N(t	build_ext(t	copy_file(tnew_compiler(tcustomize_compilertget_config_var(tDistutilsError(tlog(tLibrary(tsixsCython.Compiler.MaintLDSHARED(t_config_varscCsstjdkretj�}z,dtd<dtd<dtd<t|�Wdtj�tj|�Xn
t|�dS(Ntdarwins0gcc -Wl,-x -dynamiclib -undefined dynamic_lookupR	s -dynamiclibtCCSHAREDs.dylibtSO(tsystplatformt_CONFIG_VARStcopyRtcleartupdate(tcompilerttmp((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyt_customize_compiler_for_shlibs



tsharedRtnttRTLD_NOWcCstr
|SdS(Nt(t	have_rtld(ts((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyt<lambda>>RcCsNxGd�tj�D�D]/\}}}d|kr6|S|dkr|SqWdS(s;Return the file extension for an abi3-compliant Extension()css(|]}|dtjkr|VqdS(iN(timptC_EXTENSION(t.0R((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pys	<genexpr>Css.abi3s.pydN(Rtget_suffixes(tsuffixt_((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pytget_abi3_suffixAs
&RcBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
ed�ZRS(
cCs@|jd}|_tj|�||_|r<|j�ndS(s;Build extensions in build directory, then copy if --inplaceiN(tinplacet
_build_exttruntcopy_extensions_to_source(tselftold_inplace((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR'Ks

	c
Cs�|jd�}x�|jD]�}|j|j�}|j|�}|jd�}dj|d �}|j|�}tj	j|tj	j
|��}tj	j|j|�}	t|	|d|j
d|j�|jr|j|p�tj|t�qqWdS(Ntbuild_pyt.i����tverbosetdry_run(tget_finalized_commandt
extensionstget_ext_fullnametnametget_ext_filenametsplittjointget_package_dirtostpathtbasenamet	build_libRR-R.t_needs_stubt
write_stubtcurdirtTrue(
R)R+texttfullnametfilenametmodpathtpackagetpackage_dirt
dest_filenametsrc_filename((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR(Ss
	cCstj||�}||jkr�|j|}tjoLt|d�oLt�}|r�td�}|t|� }|t�}nt	|t
�r�tjj
|�\}}|jj|t�Str�|jr�tjj|�\}}tjj|d|�Sn|S(Ntpy_limited_apit
EXT_SUFFIXsdl-(R&R3text_mapRtPY3tgetattrR$t_get_config_var_837tlent
isinstanceRR7R8tsplitexttshlib_compilertlibrary_filenametlibtypet	use_stubst_links_to_dynamicR4R5(R)R@RAR?tuse_abi3tso_exttfntd((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR3is"
		cCs,tj|�d|_g|_i|_dS(N(R&tinitialize_optionstNoneRPtshlibsRI(R)((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRY~s
		cCs�tj|�|jpg|_|j|j�g|jD]}t|t�r9|^q9|_|jrs|j�nx&|jD]}|j|j	�|_
q}Wx#|jD]}|j
}||j|<||j|jd�d<|jr�|j
|�p�t}|otot|t�}||_||_|j|�}|_tjjtjj|j|��}|r�||jkr�|jj|�n|r�tr�tj|jkr�|jjtj�q�q�WdS(NR,i����(R&tfinalize_optionsR0tcheck_extensions_listRNRR[tsetup_shlib_compilerR1R2t
_full_nameRIR4tlinks_to_dynamictFalseRSRTR;R3t
_file_nameR7R8tdirnameR5R:tlibrary_dirstappendR=truntime_library_dirs(R)R?R@tltdtnsRAtlibdir((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR\�s.
	
	
		$cCsdtd|jd|jd|j�}|_t|�|jdk	rW|j|j�n|j	dk	r�x*|j	D]\}}|j
||�qpWn|jdk	r�x!|jD]}|j|�q�Wn|j
dk	r�|j|j
�n|jdk	r
|j|j�n|jdk	r,|j|j�n|jdk	rN|j|j�ntj|�|_dS(NRR.tforce(RRR.RjRPRtinclude_dirsRZtset_include_dirstdefinetdefine_macrotundeftundefine_macrot	librariest
set_librariesRdtset_library_dirstrpathtset_runtime_library_dirstlink_objectstset_link_objectstlink_shared_objectt__get__(R)RR2tvaluetmacro((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR^�s(%
cCs&t|t�r|jStj||�S(N(RNRtexport_symbolsR&tget_export_symbols(R)R?((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR}�scCs�|j�|j}z`t|t�r4|j|_ntj||�|jrr|jd�j	}|j
||�nWd||_XdS(NR+(t_convert_pyx_sources_to_langRRNRRPR&tbuild_extensionR;R/R:R<(R)R?t	_compilertcmd((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR�s
		csntjg|jD]}|j^q��dj|jjd�d dg��t��fd�|jD��S(s?Return true if 'ext' links to a dynamic lib in the same packageR,i����Rc3s|]}�|�kVqdS(N((R tlibname(tlibnamestpkg(s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pys	<genexpr>�s(tdicttfromkeysR[R_R5R4tanyRq(R)R?tlib((R�R�s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR`�s(&cCstj|�|j�S(N(R&tget_outputst_build_ext__get_stubs_outputs(R)((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR��scsE�fd��jD�}tj|�j��}td�|D��S(Nc3s<|]2}|jrtjj�j|jjd��VqdS(R,N(R;R7R8R5R:R_R4(R R?(R)(s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pys	<genexpr>�scss|]\}}||VqdS(N((R tbasetfnext((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pys	<genexpr>�s(R0t	itertoolstproductt!_build_ext__get_output_extensionstlist(R)tns_ext_basestpairs((R)s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyt__get_stubs_outputs�s
ccs(dVdV|jd�jr$dVndS(Ns.pys.pycR+s.pyo(R/toptimize(R)((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyt__get_output_extensions�scCs�tjd|j|�tjj||jjd��d}|rftjj|�rft|d��n|j	st
|d�}|jdjddd	td
�dtjj
|j�dd
dtd�dddtd�ddtd�dddg��|j�n|r�ddlm}||gdddtd|j	�|jd �j}|dkr�||gd|dtd|j	�ntjj|�r�|j	r�tj|�q�ndS(!Ns writing stub loader for %s to %sR,s.pys already exists! Please delete.tws
sdef __bootstrap__():s-   global __bootstrap__, __file__, __loader__s%   import sys, os, pkg_resources, imps, dls:   __file__ = pkg_resources.resource_filename(__name__,%r)s   del __bootstrap__s    if '__loader__' in globals():s       del __loader__s#   old_flags = sys.getdlopenflags()s   old_dir = os.getcwd()s   try:s(     os.chdir(os.path.dirname(__file__))s$     sys.setdlopenflags(dl.RTLD_NOW)s(     imp.load_dynamic(__name__,__file__)s   finally:s"     sys.setdlopenflags(old_flags)s     os.chdir(old_dir)s__bootstrap__()Ri����(tbyte_compileR�iRjR.tinstall_lib(RtinfoR_R7R8R5R4texistsRR.topentwritetif_dlR9Rbtclosetdistutils.utilR�R>R/R�tunlink(R)t
output_dirR?tcompilet	stub_filetfR�R�((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR<�sP	
			

(t__name__t
__module__R'R(R3RYR\R^R}RR`R�R�R�RaR<(((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRJs								
					ic

Cs8|j|j|||||||||	|
||�
dS(N(tlinktSHARED_LIBRARY(
R)tobjectstoutput_libnameR�RqRdRfR|tdebugt
extra_preargstextra_postargst
build_tempttarget_lang((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRxs
tstaticc
Csrtjj|�\}}
tjj|
�\}}|jd�jd�rU|d}n|j|||||�dS(NtxR�i(R7R8R4RORQt
startswithtcreate_static_lib(R)R�R�R�RqRdRfR|R�R�R�R�R�RAR9R?((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRx,s
cCs"tjdkrd}nt|�S(s�
    In https://github.com/pypa/setuptools/pull/837, we discovered
    Python 3.3.0 exposes the extension suffix under the name 'SO'.
    iiR
(iii(Rtversion_infoR(R2((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRLDs	(+R7RR�Rtdistutils.command.build_extRt
_du_build_exttdistutils.file_utilRtdistutils.ccompilerRtdistutils.sysconfigRRtdistutils.errorsRt	distutilsRtsetuptools.extensionRtsetuptools.externRtCython.Distutils.build_extR&t
__import__tImportErrorR
RRRaRRSRRRR>R2tdlthasattrR�R$RZRxRL(((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyt<module>sX


		
			�			

?>