ó ţžv]c @soddlZddlZddlZddlmZddlmZddlm Z ddl m Z m Z ddl mZddlmZddlmZdd lmZejrůddlZgejƒD]$\ZZZeejkrĚe^qĚZndd lmZyddlmZe d ƒWne!k r@eZnXe d ƒdd l m"Z#d„Z$e%Z&e%Z'dZ(ej)dkrŽe*Z'nIej+dkr×y#ddl,Z,e-e,dƒZ'Z&Wq×e!k rÓq×Xnd„Z.d„Z/defd„ƒYZe'sej+dkr>ddddddddddd„ Z1n-dZ(ddddddddddd„ Z1dS(i˙˙˙˙N(t build_ext(t copy_file(t new_compiler(tcustomize_compilertget_config_var(tDistutilsError(tlog(tLibrary(tsix(tEXTENSION_SUFFIXESsCython.Compiler.MaintLDSHARED(t _config_varscCsstjdkretjƒ}z,dtdDRcCs5x.tD]&}d|kr|S|dkr|SqWdS(s;Return the file extension for an abi3-compliant Extension()s.abi3s.pydN(R (tsuffix((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pytget_abi3_suffixGs    RcBs€eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „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(tselft old_inplace((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyR#Qs   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'texttfullnametfilenametmodpathtpackaget package_dirt dest_filenamet src_filename((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyR$Ys   cCstj||ƒ}||jkrý|j|}tjoLt|dƒoLtƒ}|r‚tdƒ}|t|ƒ }|tƒ}nt |t ƒrźt j j |ƒ\}}|jj|tƒStrý|jrýt j j|ƒ\}}t j j|d|ƒSn|S(Ntpy_limited_apit EXT_SUFFIXsdl-(R"R/text_mapRtPY3tgetattrR Rtlent isinstanceRR3R4tsplitexttshlib_compilertlibrary_filenametlibtypet use_stubst_links_to_dynamicR0R1(R%R<R=R;tuse_abi3tso_exttfntd((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyR/os"    cCs,tj|ƒd|_g|_i|_dS(N(R"tinitialize_optionstNoneRKtshlibsRE(R%((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyRT„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_optionsR,tcheck_extensions_listRIRRVtsetup_shlib_compilerR-R.t _full_nameRER0tlinks_to_dynamictFalseRNROR7R/t _file_nameR3R4tdirnameR1R6t library_dirstappendR9truntime_library_dirs(R%R;R<tltdtnsR=tlibdir((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyRWŠs.       $cCsdtd|jd|jd|jƒ}|_t|ƒ|jdk rW|j|jƒn|j dk r“x*|j D]\}}|j ||ƒqpWn|j dk rĆx!|j D]}|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*ReRKRt include_dirsRUtset_include_dirstdefinet define_macrotundeftundefine_macrot librariest set_librariesR_tset_library_dirstrpathtset_runtime_library_dirst link_objectstset_link_objectstlink_shared_objectt__get__(R%RR.tvaluetmacro((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyRY§s(% cCs&t|tƒr|jStj||ƒS(N(RIRtexport_symbolsR"tget_export_symbols(R%R;((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyRxÂscCs„|jƒ|j}z`t|tƒr4|j|_ntj||ƒ|jrr|jdƒj }|j ||ƒnWd||_XdS(NR'( t_convert_pyx_sources_to_langRRIRRKR"tbuild_extensionR7R+R6R8(R%R;t _compilertcmd((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyRzÇ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((t.0tlibname(tlibnamestpkg(sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pys Űs(tdicttfromkeysRVRZR1R0tanyRl(R%R;tlib((RR€sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyR[Ôs(&cCstj|ƒ|jƒS(N(R"t get_outputst_build_ext__get_stubs_outputs(R%((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyR…ÝscsE‡fd†ˆjDƒ}tj|ˆjƒƒ}td„|DƒƒS(Nc3s<|]2}|jrtjjˆj|jjdƒŒVqdS(R(N(R7R3R4R1R6RZR0(R}R;(R%(sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pys ăscss|]\}}||VqdS(N((R}tbasetfnext((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pys és(R,t itertoolstproductt!_build_ext__get_output_extensionstlist(R%t ns_ext_basestpairs((R%sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyt__get_stubs_outputsŕs  ccs(dVdV|jdƒjr$dVndS(Ns.pys.pycR's.pyo(R+toptimize(R%((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyt__get_output_extensionsëscCs´tjd|j|ƒtjj||jjdƒŒd}|rftjj|ƒrft|dƒ‚n|j st |dƒ}|j djddd t d ƒd tjj |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iReR*t install_lib(RtinfoRZR3R4R1R0texistsRR*topentwritetif_dlR5R]tclosetdistutils.utilR“R:R+Rtunlink(R%t output_dirR;tcompilet stub_filetfR“R((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyR8ńsP        (t__name__t __module__R#R$R/RTRWRYRxRzR[R…R†R‹R\R8(((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyRPs         ic Cs8|j|j||||||||| | | | ƒ dS(N(tlinktSHARED_LIBRARY( R%tobjectstoutput_libnameRRlR_RaRwtdebugt extra_preargstextra_postargst build_tempt target_lang((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyRs#s    tstaticc Cs„|dkst‚tjj|ƒ\}} tjj| ƒ\}}|jdƒjdƒrg|d}n|j||||| ƒdS(NtxR„i( RUtAssertionErrorR3R4R0RJRLt startswithtcreate_static_lib(R%RĽRŚRRlR_RaRwR§R¨RŠRŞRŤR=R5R;((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyRs2s  (2R3RR‰tdistutils.command.build_extRt _du_build_exttdistutils.file_utilRtdistutils.ccompilerRtdistutils.sysconfigRRtdistutils.errorsRt distutilsRtsetuptools.extensionRtsetuptools.externRtPY2timpt get_suffixesRt_ttpt C_EXTENSIONR timportlib.machinerytCython.Distutils.build_extR"t __import__t ImportErrorR RRR\RRNRMRR:R.tdlthasattrR™R RURs(((sB/tmp/pip-install-vZZv26/setuptools/setuptools/command/build_ext.pyts\     :         Đ