b-Qc @sddlmZyddlmZWnek r=eZnXddlZddlZddlm Z ddl m Z ddl m Z ddlmZyddlmZWn>ek rddlmZed [dd lmZnXdd lmZdd lTeZeZd Zejdkr/eZnFejdkruy ddlmZeZeZWquek rqquXndZ defdYZesejdkrddddddddddd Z"n-dZddddddddddd Z"dS(i(t build_extN(t copy_file(tLibrary(t new_compiler(tcustomize_compiler(t _CONFIG_VARS(tget_config_vartLDSHARED(t _config_vars(tlog(t*tsharedtdarwintnt(tRTLD_NOWcCstr |SdS(Nt(t have_rtld(ts((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pytif_dl&sRcBseZdZdZeek r@eed r@dZndZdZ dZ dZ dZ d Z d Zd Zed ZRS( cCs@|jd}|_tj|||_|r<|jndS(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.pyR1s   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|ptj|tqqWdS(Ntbuild_pyt.itverbosetdry_run(tget_finalized_commandt extensionstget_ext_fullnametnametget_ext_filenametsplittjointget_package_dirtostpathtbasenamet build_libRRRt _needs_stubt write_stubtcurdirtTrue( RRtexttfullnametfilenametmodpathtpackaget package_dirt dest_filenamet src_filename((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR9s!  t pyrex_sourcescGs+tj||p|}tj|||S(N(Rt swig_sourcest _du_build_ext(Rtsourcest otherargs((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR6QscCstj||}||jkr|j|}t|trhtjj|\}}|jj |t St r|j rtjj |\}}tjj|d|Sn|S(Nsdl-(RR!text_mapt isinstanceRR%R&tsplitexttshlib_compilertlibrary_filenametlibtypet use_stubst_links_to_dynamicR"R#(RR.R/R-tfntd((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR!Ys cCs,tj|d|_g|_i|_dS(N(Rtinitialize_optionstNoneR=tshlibsR:(R((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRDes   c Cstj||jpg|_|j|jg|jD]}t|tr9|^q9|_|jrs|jnx&|jD]}|j|j |_ q}Wx|jD]}|j }||j |<||j |j dd<|jr|j |pt}|_|otot|t |_|j|}|_tjjtjj|j|}|r||jkr|jj|n|rtrtj|jkr|jjtjqqWdS(NRi(Rtfinalize_optionsRtcheck_extensions_listR;RRFtsetup_shlib_compilerRR t _full_nameR:R"tlinks_to_dynamictFalseRAR@R)R!t _file_nameR%R&tdirnameR#R(t library_dirstappendR+truntime_library_dirs(RR-R.tltdR/tlibdir((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRGks*     %$cCstd|jd|jd|j}|_tjdkrtj}z,dtdt startswithtcreate_static_lib(RRRRRcRORQRoRRRRRR/R'R-((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRjs  (#tdistutils.command.build_extRR7tPyrex.Distutils.build_extRt ImportErrorR%RXtdistutils.file_utilRtsetuptools.extensionRtdistutils.ccompilerRtdistutils.sysconfigRt sysconfigRRRt distutilsR tdistutils.errorsRLRR@R?RYR,R tdlRRRERj(((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pytsT