ó âqLc@sÓdZdZddlZddlZddlZddlZddlZddl Zddl Zd„Z d„Z d„Z d„Zd„Zd „Zd d „Zd „Zd „Zd„Zd„Zd„ZdS(sYSCons.Tool.FortranCommon Stuff for processing Fortran, common to all fortran dialects. sEsrc/engine/SCons/Tool/FortranCommon.py 5023 2010/06/14 22:05:46 sconsiÿÿÿÿNcCsy|d}Wntk r"dSX|s-dSxM|D]E}|jr4tjjt|jdƒƒd}||krydSq4q4WdS(sKReturn 1 if any of code in source has fortran files in it, 0 otherwise.tFORTRANSUFFIXESii(tKeyErrortsourcestostpathtsplitexttstr(tenvtsourcet fsuffixeststext((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/FortranCommon.pyt isfortran)s   #  c Cs|djƒ}|jƒ rF|jƒ rFdt|jƒGHggfSd}tj|tjƒ}|j|j ƒƒ}t j j |ƒ}|j dd|d|ƒ}|j dd|d|ƒ}g|D]} | jƒ|^qÅ}x*|D]"} |j|jj| |ƒƒqèW||fS(NisCould not locate s#(?i)^\s*MODULE\s+(?!PROCEDURE)(\w+)s$FORTRANMODSUFFIXttargetRs$FORTRANMODDIR(trfiletexistst is_derivedRtnametretcompiletMtfindalltget_text_contentstSConstUtiltuniquetsubsttlowertappendtfstFile( R RRtnodet mod_regextcretmodulestsuffixtmoddirtxtm((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/FortranCommon.pyt_fortranEmitter=s #  cCs.t|||ƒ\}}tjj|||ƒS(N(R'RtDefaultstStaticObjectEmitter(R RR((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/FortranCommon.pytFortranEmitterPscCs.t|||ƒ\}}tjj|||ƒS(N(R'RR(tSharedObjectEmitter(R RR((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/FortranCommon.pytShFortranEmitterTscCsƒt|ƒdkst‚|d}|jƒ}g|D]}|jƒ^q5}tjj||ƒrr|j|ƒn |j|ƒdS(szsuffixes are fortran source files, and ppsuffixes the ones to be pre-processed. Both should be sequences, not strings.iN(tlentAssertionErrortupperRRtcase_sensitive_suffixestextend(tsuffixest ppsuffixesR tsupt_tupper_suffixes((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/FortranCommon.pytComputeFortranSuffixesXs  cCs„tjjd|d|ƒ}tjjd|d|ƒ}tjjd|d|ƒ}tjjd|d|ƒ}||||fS( s Create dialect specific actions.s$%sCOM s $%sCOMSTRs $%sPPCOM s $%sPPCOMSTRs $SH%sCOM s $SH%sCOMSTRs $SH%sPPCOM s $SH%sPPCOMSTR(RtAction(tdialectt CompActiont CompPPActiont ShCompActiontShCompPPAction((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/FortranCommon.pytCreateDialectActionsds ic CsÝt||ƒtjjjd|ƒ}x(||D]}tjjj||ƒq1W|jd||ƒt |ƒ\}}} } tjj |ƒ\} } xN|D]F}| j ||ƒ| j || ƒ| j |t ƒ| j |tƒqœWxN|D]F}| j ||ƒ| j || ƒ| j |t ƒ| j |tƒqíWd||krdtjjdƒ|d|tcreateObjBuilderst add_actiont add_emitterR*R,RtCLVar( RR9R2R3tsupport_moduletfscanR#t compactiont compppactiont shcompactiontshcompppactiont static_objt shared_obj((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/FortranCommon.pytDialectAddToEnvmsF   ! cCs¸y|d}Wn tk r0dddg}nXy|d}Wntk r^ddg}nXt|d||d d ƒd |d RSR_ReRkRqRr(((sh/home/als/proj/qrscanner/ext/qrscanner/zxing/scons/scons-local-2.0.0.final.0/SCons/Tool/FortranCommon.pyts(            6