ó >¡Gc@s5dZdZddlZddlZddlZddlZddlTddlmZddl Tddl m Z m Z ddl mZmZddlmZdd lmZy0dd lmZmZmZdd lmZWnek rõdZnXdd lmZ e j!Z!e j"Z"d e jfd„ƒYZdS(s{Pyrex.Distutils.build_ext Implements a version of the Distutils 'build_ext' command, for building Pyrex extension modules.s$Id:$iÿÿÿÿN(t*(tCommand(tcustomize_compilertget_python_version(tnewert newer_group(tlog(tmkpath(tCompilationOptionstdefault_optionstcompile(t PyrexError(t build_extR cBs¡eZdZejjZejjZejjZejjZej dddddefddgƒej dddgƒd „Z d „Z d „Z d„ZRS(sBbuild C/C++ and Pyrex extensions (compile/link to build directory)s pyrex-cplussgenerate C++ source filesspyrex-create-listingswrite errors to a listing filespyrex-include-dirs=spath to the Pyrex include filesspyrex-c-in-temps'put generated C files in temp directorys pyrex-gen-pxis*generate .pxi file for public declarationscCsAtjj|ƒd|_d|_d|_d|_d|_dS(Ni( t _build_extR tinitialize_optionst pyrex_cplustpyrex_create_listingtNonetpyrex_include_dirstpyrex_c_in_tempt pyrex_gen_pxi(tself((s=/usr/lib/python2.7/site-packages/Pyrex/Distutils/build_ext.pyR<s     cCsbtjj|ƒ|jdkr+g|_n3t|jƒtkr^tj|jt j ƒ|_ndS(N( R R tfinalize_optionsRRttypet StringTypetstringtsplittostpathsep(R((s=/usr/lib/python2.7/site-packages/Pyrex/Distutils/build_ext.pyRDs  cCsM|j|jƒx6|jD]+}|j|j|ƒ|_|j|ƒqWdS(N(tcheck_extensions_listt extensionst pyrex_sourcestsourcestbuild_extension(Rtext((s=/usr/lib/python2.7/site-packages/Pyrex/Distutils/build_ext.pytbuild_extensionsMsc Cs¨tdkrtdtj‚ng}g}i}|jpIt|ddƒ}|jp‚t|ddƒp‚|jo‚|jj ƒdk}|j pt|ddƒ}|j } y4x-|j D]"} | | kr¶| j | ƒq¶q¶WWnt k rðnXx-|jD]"} | | krû| j | ƒqûqûW|r0d} nd} |j rv|js[t|d dƒrvtjj|jd ƒ} nd } x}|D]u} tjj| ƒ\}}|d krë|j tjj| || ƒƒ|j | ƒ|d || %stuse_listing_filet include_patht output_filetcplust generate_pxitoptionsN(R RtDistutilsPlatformErrorRtnameRtgetattrRtlanguagetlowerRRtappendtAttributeErrort include_dirstinplaceRtpathtjoint build_temptsplitexttforceRRtinfoRtdirnameRtpyrex_default_optionst pyrex_compile(RR t extensiont new_sourcesRt pyrex_targetstcreate_listingR)Rtincludestit target_extt target_dirtsourcetbaseR"ttargetR+tresult((s=/usr/lib/python2.7/site-packages/Pyrex/Distutils/build_ext.pyRTsf                N(s pyrex-cplusNsgenerate C++ source files(spyrex-create-listingNswrite errors to a listing file(spyrex-c-in-tempNs'put generated C files in temp directory(s pyrex-gen-pxiNs*generate .pxi file for public declarations(t__name__t __module__t descriptionR R tsep_byt user_optionstboolean_optionst help_optionstextendRRRR#R(((s=/usr/lib/python2.7/site-packages/Pyrex/Distutils/build_ext.pyR !s,        (#t__doc__t __revision__tsysRRtrettypestdistutils.coreRtdistutils.errorstdistutils.sysconfigRRtdistutils.dep_utilRRt distutilsRtdistutils.dir_utilRtPyrex.Compiler.MainRR R<R R=tPyrex.Compiler.ErrorsR t ImportErrorRtdistutils.commandR R textension_name_retshow_compilers(((s=/usr/lib/python2.7/site-packages/Pyrex/Distutils/build_ext.pyts$0