ó Àfc @s%ddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z m Z ddlmZddlmZddlmZdd lmZyddlmZed ƒWnek ríeZnXe d ƒdd l mZd „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>RcCsNxGd„tjƒDƒD]/\}}}d|kr6|S|dkr|SqWdS(s;Return the file extension for an abi3-compliant Extension()css(|]}|dtjkr|VqdS(iN(timpt C_EXTENSION(t.0R((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pys 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 „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((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+texttfullnametfilenametmodpathtpackaget package_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¼t j j |ƒ\}}|jj|tƒStrý|jrýt j j|ƒ\}}t j 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|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.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 Õ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&t get_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 Ýscss|]\}}||VqdS(N((R tbasetfnext((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pys ã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ƒ}|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”iRjR.t install_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ŠRRaR<(((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_tempt target_lang((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRxs    tstaticc Cs„|dkst‚tjj|ƒ\}} tjj| ƒ\}}|jdƒjdƒrg|d}n|j||||| ƒdS(NtxRˆi( RZtAssertionErrorR7R8R4RORQt 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 (+R7RRRtdistutils.command.build_extRt _du_build_exttdistutils.file_utilRtdistutils.ccompilerRtdistutils.sysconfigRRtdistutils.errorsRt distutilsRtsetuptools.extensionRtsetuptools.externRtCython.Distutils.build_extR&t __import__t ImportErrorR RRRaRRSRRRR>R2tdlthasattrRR$RZRxRL(((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pytsX             Ð