m fDc@sdkZdkZdkZdkZdkZdkZdkZdkZdkZdk Z dkl Z l Z l Z l Z dZdZdZedZdZdZdfd YZd ZdS( N(sdebugserrorstracesfatalcCs?x8|D]0}tiitii||o|SqqWdS(Nt(t path_listtdirtostpathtexiststjointfile(RRR((t+/home/samy/kbilliards/wafadmin/Configure.pyt find_paths " cCsNxG|D]?}tiitii||otii||SqqWdS(NR(RRRRRRR(RRR((Rt find_files "c Csvdk}dk}x]|D]U}xL|i|D];\}}}x)|D]!}|i||o|SqEqEWq/WqWdS(NR( RtfnmatchRtptwalkRtsubdirstfilestnameR( RRRRRR RR R((Rt find_file_extscCs|do|d7}n|djo^ytid}Wntj o dSnXt|ti jot i |ti }qnxG|D]?}tiitii||otii||SqqWdS(NtWINDOWSs.exetPATHR(tlenvRRtNoneRtenvirontKeyErrorttypettypest StringTypetstringtsplittpathsepRRRR(RRRR((Rt find_programs   "cCs0|dodSntid|iiS(NRRswhich %s 2>/dev/null(RRtpopentprogtreadtstrip(RR ((Rtfind_program_using_which-s cCsdS(NR((R((Rt sub_config2st ConfigurecBstZddZdZddZdZdZddZddZ d Z d Z d Z d d Z dZddZddddZddZddddZdZdZddZddZddZdZdZdddZRS(NcCsMd|_d|_h|_h|_d|_ti|_ |i ddS(NRsconfig.htdefault( Rtselftenvt m_envnamet m_allenvstdefinest configheaderRtgetcwdtcwdtsetenv(R'R(((Rt__init__6s     cCs#|idp|idndS(Nttoolss_you should add at least a checkTool() call in your wscript, otherwise you cannot build anything(R'R(terror(R'((Rt__del__FscCsTy)|i|}|o d|GHn|SWn$ti}||i|<|SnXdS(Ns<warning, the environment %s may have been configured already(R'R*RR(tfromenvt Environment(R'RR4R(((RtretrieveJs    cCs|i||_||_dS(N(R'R6RR(tenvname(R'R((RR/TscCs~ti}tiidx@|iD]5}t|}|i |o|i |}q&q&W|dd}|i |dS(sfor what is this functiontbksystOSs.envN( R5R(tsysRtappendR'tmodulestmodulet __import__Rtgeneratetfilenametstore(R'R=R@R(((RtexecuteXs   Rc Cs~tiitiid} ytitiiWnnXyti| WnnXttii| dd}|i ||i |ii}titi} | i| tii| d|| idtest.log tCPPN(RLRRRR'R(RMRNRORPtRunnert exec_commandtstrRf(R'RORfRM((RtTryCPPs %  cCs||i| int main() { } R{(RR{RtListTypetiR't checkHeaderRotuppertreplaceRrRsRORgtis_foundt checkMessageRp(R'R{RoRORR((RRs , cCs|djo d|iidd}n|i|o|i|Sn|pd|}nd|}|i || }|i d|||i |||S( sfind a functionRR}RER~s1 #ifdef __cplusplus extern "C" #endif char %s(); s int main() { %s(); } tfunctionN( RoRRRR'RrRstheadersRORgRRRp(R'RRRotlanguageROR((Rt checkFunctions   cCs/t|i||}|id||||S(sfind an applicationRFN(RR'R(RRReR(R'RRRe((Rt checkProgramscCs|djo d|iidd}n|i|o|i|Sn| o|od|}d|}n!| o| od}d}nd}|i |||i d|d|i d | }|id |||i|||S( sfind a libraryRR}RER~s1 #ifdef __cplusplus extern "C" #endif char %s(); s int main() { %s(); } tLIB_STt t LIBPATH_STtlibraryN(RotlibnameRRR'RrRsRtfuncnameROtlibpathRgR(RRRp(R'RRRRoRORR((Rt checkLibrary s     5c Cst|tijo&x|D]}|i|qWdSnd|iiddidd}|i |o|i |Sn|i i d|y"ti|ti\}}}Wnd|d GHdSnXti||||}|i|}|i|||S( s check if a waf tool is availableNR}RER~t+tPR1sno tool named 's' found(RttoolRRRR't checkToolRRRoRrRsR(t appendValuetimpt find_moduleRVt g_tooldirRRtdesct load_moduleR=tdetectReRp( R'RRRR=ReRRRo((RR+s&(" cCsdS(s*check if a a user provided module is givenN((R'R((Rt checkModuleAscCsd|d|GHdS(sprints an error messagesconfiguration error: RN(R=Rl(R'R=Rl((RR2EscCsytitiWntj onX|iptdnxD|iD]9}|i|}|i i ti i ti|dqLWdS(s%save config results into a cache filesnothing to store in Configure !s .cache.pyN(RRKRVt g_cachedirtOSErrorR'R*tfatalRyttmpenvR(RARR(R'RRyR((RRAIs   c Csd|d|}d}t|}|G|djo|d| GdGnti}|o|dd|n|d d d S( sLprint an checking message. This function is used by other checking functionss Checking for Rs1 i#i!t:tGREENsok tYELLOWs not foundN( RtmsgtsrtspRwtlRVtpprintR tstatetoption( R'RRRRRRRR ((RRTs   cCs |i|S(s!deprecated, replaced by checkToolN(R'RR(R'R((RRascCs|i}tii|i||_tii|id}yti |}Wnd}t ||inX|i |||_dS(Ntwscriptsno module or function configure was found in wscript [%s]: * make sure such a function is defined * run configure from the root of the project(R'R.tcurrentRRRRtcurRHRtmodRRt configure(R'RRRRR((RR$es  cCs|p|i}ny|oGd||f}|Gtid||fio dndGHntid|ii |i d|