qLc@sdZdZddkZddkZddkZddkZddkZddkZddk Zddk Zddk Zddk ZgZ eiiiZeiiiZeiiiZeiiiZeiiiZeiihddZdddd d d d d dddddddddddgZdgZddgZdddgZxeD]ZeieeqfWxeD]ZeieeqWx.eD]&ZeieeeieeqWde fd YZ!d!Z"d"Z#d#Z$d$Z%d%Z&d&Z'd'Z(d(Z)d)Z*d*Z+d+Z,d,e fd-YZ-d.e fd/YZ.d0Z/d1Z0d2Z1d3Z2dS(4sSCons.Tool SCons tool selection. This looks for modules that define a callable object that can modify a construction environment as appropriate for a given tool (or tool chain). Note that because this subsystem just *selects* a callable that can modify a construction environment, it's possible for people to define their own "tool specification" in an arbitrary callable function. No one needs to use or tie in to this subsystem in order to roll their own tool definition. s@src/engine/SCons/Tool/__init__.py 5023 2010/06/14 22:05:46 sconsiNtnametSourceFileScanners.cs.Cs.cxxs.cpps.c++s.ccs.hs.Hs.hxxs.hpps.hhs.Fs.fpps.FPPs.ms.mms.Ss.spps.SPPs.ds.idls.IDLs.texs.ltxs.latextToolcBs/eZgdZdZdZdZRS(cKsg||_|t|_||_|i}|i|_|i|_t|do|i|_ndS(Ntoptions( RtDefaultToolpathttoolpathtinit_kwt _tool_moduletgeneratetexiststhasattrR(tselfRRtkwtmodule((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pyt__init__Xs      c Csti}|itit_zy[ti|i|i\}}}zti|i|||SWd|o|inXWntj o}t |d|ijot i i |nyddk }Wntj oq7XxQ|iD]A}y#|i|}|i|iSWqtj o }qXqWnXWd|t_Xd|i} yti| SWntj oyXtidi} yiti|i| \}}}ti| |||} tt i|i| |o|in| SWntj o}t |d|ijot i i |nyVddk }|itidid}|i| } tt i|i| | SWqtj o.}d|i|f} t i i | qXnXWq tj o.}d|i|f} t i i | q XnXdS(NsNo module named %sis SCons.Tool.s SCons.ToolisNo tool named '%s': %s(tsystpathRtimpt find_moduleRt load_moduletcloset ImportErrortstrtSConstErrorstEnvironmentErrort zipimportt zipimportertmodulestKeyErrort__path__tsetattrR( R t oldpythonpathtfileRtdescteRtaPathtimportert full_nametsmpathR tm((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pyRdsh !     cOs|idj o@|dj o&|}|ii}|i|qP|i}n|id|igt|donddk}d|jo-ddkl }|i i d||ds $LIBEMITTERR?s $LIBPREFIXR@s $LIBSUFFIXRAs $OBJSUFFIXRBt StaticObjecttLibrary(RRtActiontDetecttappendRF(R4t static_libt action_listt ranlib_action((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pytcreateStaticLibBuilders  cCsy|dd}Wn~tj orddk}|ii|iig}|iid|dddd d d d td ddd}||dds $SHLIBEMITTERR?s $SHLIBPREFIXR@s $SHLIBSUFFIXRDRAs $SHOBJSUFFIXRBt SharedObject(RRERGt SharedCheckt ShLinkActionRFRI(R4t shared_libRRT((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pytcreateSharedLibBuilders   cCsy|dd}Wn~tj orddk}|ii|iig}|iid|dddd d d d td ddd}||dds$LDMODULEEMITTERR?s$LDMODULEPREFIXR@s$LDMODULESUFFIXRDRAs $SHOBJSUFFIXRBRX(RRERGRYtLdModuleLinkActionRFRI(R4t ld_moduleRRT((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pytcreateLoadableModuleBuilders   cCsy|dd}Wnntj obtiidhdhddddd d d gd td d}||dd<||ddR?s $OBJPREFIXR@s $OBJSUFFIXRBtCFiletCXXFiletsource_scannert single_sourceiRCRXs $SHOBJPREFIXs $SHOBJSUFFIX(RRRFR(R4t static_objt shared_obj((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pytcreateObjBuilderss0    c Csy|dd}WnYtj oMtiidhdhdhdd 6}||dd<|iddnXy|dd }WnYtj oMtiidhdhdhd d 6}||dd <|id d nX||fS(sDThis is a utility function that creates the CFile/CXXFile Builders in an Environment if they are not there already. If they are there already, we return the existing ones. This is a separate function because soooo many Tools use this functionality. The return is a 2-tuple of (CFile, CXXFile) R;RaR=R>R@s $CFILESUFFIXt CFILESUFFIXs.cRbs$CXXFILESUFFIXt CXXFILESUFFIXs.ccN(RRRFR,t SetDefault(R4tc_filetcxx_file((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pytcreateCFileBuildersEs" c Csy|dd}Wnxtj oltiii}tiidd}tiid|dddd d d d |i}||ddRAs $JAVASUFFIXRBtJavaFileRzRp( RRRqRrRsRPRFRtR{(R4tjava_class_fileRvt javac_com((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pytCreateJavaClassFileBuilders   c Csy|dd}Wnutj oitiii}tiidd}tiid|dhd|id|i}||ddRzRp(RRRqRrRsRPRFtDir(R4tjava_class_dirRvR((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pytCreateJavaClassDirBuilders  c Csly|dd}WnStj oGtiidhdhdhdd6}||ddR@s $JAVASUFFIXs.javat JAVASUFFIX(RRRFR,(R4t java_file((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pytCreateJavaFileBuilderstToolInitializerMethodcBs)eZdZdZdZdZRS(s This is added to a construction environment in place of a method(s) normally called for a Builder (env.Object, env.StaticObject, etc.). When called, it has its associated ToolInitializer object search the specified list of tools and apply the first one that exists to the construction environment. It then calls whatever builder was (presumably) added to the construction environment in place of this particular instance. cCs||_||_dS(s Note: we store the tool name as __name__ so it can be used by the class that attaches this to a construction environment. N(R9t initializer(R RR((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pyRs cCsZt||i}|ii|t||i}||jodS|ii||S(s Returns the appropriate real Builder for this method name after having the associated ToolInitializer object apply the appropriate Tool module. N(tgetattrR9Rt apply_toolsR,tremove_methods(R R4tbuilder((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pyt get_builders cOs4|i|}|djo ggfS|||S(s N(RR,(R R4R+R R((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pyR7s  (R9R:t__doc__RRR7(((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pyRs   tToolInitializercBs)eZdZdZdZdZRS(s A class for delayed initialization of Tools modules. Instances of this class associate a list of Tool modules with a list of Builder method names that will be added by those Tool modules. As part of instantiating this object for a particular construction environment, we also add the appropriate ToolInitializerMethod objects for the various Builder methods that we want to use to delay Tool searches until necessary. cCstii|p |g}ntii|p |g}n||_||_||_h|_x7|D]/}t||}||i|<|i|qkWdS(N( RtUtiltis_ListR4ttoolstnamestmethodsRt AddMethod(R R4RRRtmethod((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pyRs       cCs+x$|iiD]}|i|qWdS(s Removes the methods that were added by the tool initialization so we no longer copy and re-bind them when the construction environment gets cloned. N(Rtvaluest RemoveMethod(R R4R((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pyRscCsLxE|iD]:}tii|}|i|o|i|dSq WdS(s Searches the list of associated Tool modules for one that exists, and applies that to the construction environment. N(RRRR (R R4ttttool((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pyRs   (R9R:RRRR(((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pyRs   cCsIt|dgddgd}d}|i||i|dS(Ntinstallt_InternalInstallt_InternalInstallAsc_s|i||S(N(R(R R+R ((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pytInstallsc_s|i||S(N(R(R R+R ((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pyt InstallAss(RR(R4RR((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pyt Initializerss    cCs6x/|D]'}t|}|i|o|SqWdS(N(RR R,(RR4RR((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pytFindTools   cCs|d}tt||S(NcSst|i|S(N(RR (RR4((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pyt ToolExists"s(tlisttfilter(RR4R((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pyt FindAllTools!s cCs"g}t|djodddddg}ddd d d d d dg}dd d dddg}ddddg}dddddddg}dddg}dd g}nt|d!joFddg}d d g}d dg}dg}ddg}dg}nt|d"joXd#dg}d$d d g}d%ddg}d&dg}ddd'ddg}d(g}nt|d)jodd*dg}d+d d g}d,ddg}d&dg}d-d.d/ddd'dddg }d0g}nt|d1joXd2dg}d3d d g}d4ddg}d&dg}ddd'ddg}dg}n:t|d5joXd6dg}d7d d g}d8ddg}d&dg}ddd9ddg}dg}nt|d:joLd;dg}d d g}ddg}d&g}ddddg}dg}npdddg}d dd d d g}ddd d dg}dddg}ddd<dddd'g}ddg}t||p|d=} | o/| djo"d} d} d} d} d}n| dYjo d} nt||p|d=} t||p|d=} t||p|d=} t||p|d=} t||p|d=}t|d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXg|}| | | | | |g|}g}|D]}|o ||qq~S(ZNtwin32tmslinktgnulinktilinktlinkloctilink32tmsvctmingwtgcctintelcticlticctcctbcc32sg++sc++tmasmtnasmtgast386asmtgfortrantg77tifltcvftf95tf90tfortrantmslibtarttlibtmsvstmidltos2tirixtsgilinktsgiccssgic++tastf77tsgiartsunostsunlinktsunccssunc++tsunf95tsunf90tsunf77tsunarthpuxthplinkthpccshpc++taixtaixlinktaixccsaixc++taixf77tdarwint applelinktifortitdmdt filesystemtm4twixtlextyacctrpcgentswigtjartjavactjavahtrmictdvipdftdvipstgsttextlatextpdflatextpdftexttartziptrpmt BitKeepertCVStPerforcetRCStSCCS(RRR(RRR,R(tplatformR4tother_plat_toolstlinkerst c_compilerst cxx_compilerst assemblerstfortran_compilerstarst c_compilert cxx_compilertlinkert assemblertfortran_compilerRt other_toolsRt_[1]tx((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pyt tool_list&s                                    (3Rt __revision__RRt SCons.BuilderRt SCons.Errorst SCons.Node.FSt SCons.ScannertSCons.Scanner.CtSCons.Scanner.DtSCons.Scanner.LaTeXtSCons.Scanner.ProgRtScannertCtCScannertDtDScannertLaTeXt LaTeXScannertPDFLaTeXScannertProgRItBaseRt CSuffixest DSuffixest IDLSuffixest LaTeXSuffixesR@t add_scannertobjectRRKRVR\R`RgRmRxR~RRRRRRRRR (((sc/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/__init__.pytsl             e     ) %    03