mς &U²Ic@svdZdZdkZdkZdkTdklZdkTdkl Z dk l Z d„Z defd „ƒYZ dS( s΄distutils.command.build_clib Implements the Distutils 'build_clib' command, to build a C/C++ library that is included in the module distribution and needed by an extension module.s6$Id: build_clib.py 37828 2004-11-10 22:23:15Z loewis $N(t*(sCommand(scustomize_compiler(slogcCsdkl}|ƒdS(N(sshow_compilers(tdistutils.ccompilertshow_compilers(R((t9/data/zmath/lib/python2.4/distutils/command/build_clib.pyRs t build_clibcBsƒtZdZdddddgZdd gZdddefgZd„Zd„Z d„Z d„Z d„Z d„Z d„ZRS(Ns/build C/C++ libraries used by Python extensionss build-clibtbs%directory to build C/C++ libraries tos build-temptts,directory to put temporary build by-productstdebugtgs"compile with debugging informationtforcetfs2forcibly build everything (ignore file timestamps)s compiler=tcsspecify the compiler types help-compilerslist available compilerscCsUd|_d|_d|_d|_d|_d|_d|_d|_ d|_ dS(Ni( tNonetselfRt build_tempt librariest include_dirstdefinetundefRR tcompiler(R ((Rtinitialize_options9s        cCs¬|idddd d d ƒ|ii|_|io|i|iƒn|idjo|iipg|_nt|iƒtjot i |it i ƒ|_ndS( NtbuildRRRRR (s build_temps build_clib(s build_temps build_temp(scompilerscompiler(sdebugsdebug(sforcesforce( R tset_undefined_optionst distributionRtcheck_library_listRR ttypet StringTypetstringtsplittostpathsep(R ((Rtfinalize_optionsKs   cCs|ipdSndkl}|d|id|id|iƒ|_t|iƒ|idj o|ii |iƒn|i dj o1x.|i D]\}}|ii||ƒq”Wn|idj o(x%|iD]}|ii|ƒqΥWn|i|iƒdS(N(s new_compilerRtdry_runR (R RRt new_compilerRR R tcustomize_compilerRR tset_include_dirsRtnametvaluet define_macroRtmacrotundefine_macrotbuild_libraries(R R$R'R%R!((Rtrunis$       cCst|ƒtj o td‚nxί|D]Χ}t|ƒtj o t|ƒdjo td‚nt|dƒtj otdd‚nd|djp$ti djo-ti |djotdd |d‚nt|d ƒt j otd d ‚q'q'Wd S(s:Ensure that the list of libraries (presumably provided as a command option 'libraries') is valid, i.e. it is a list of 2-tuples, where the tuples are (library_name, build_info_dict). Raise DistutilsSetupError if the structure is invalid anywhere; just returns otherwise.s+'libraries' option must be a list of tuplesis*each element of 'libraries' must a 2-tupleis+first element of each tuple in 'libraries' s#must be a string (the library name)t/sbad library name '%s': s$may not contain directory separatorsis,second element of each tuple in 'libraries' s!must be a dictionary (build info)N( RRtListTypetDistutilsSetupErrortlibt TupleTypetlenRRtseptDictionaryType(R RR.((RR„s & 5cCsC|ipdSng}x$|iD]\}}|i|ƒq"W|S(N(R RR t lib_namestlib_namet build_infotappend(R R3R5R4((Rtget_library_namesͺs  cCs‡|i|iƒg}xj|iD]_\}}|idƒ}|djpt |ƒt t fjot d|‚n|i |ƒq W|S(Ntsourcessfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames(R RRt filenamesR4R5tgetR8R RR,R/R-textend(R R5R9R8R4((Rtget_source_filesΉs &c Csψxρ|D]ι\}}|idƒ}|djpt|ƒttfjot ddd|‚nt |ƒ}t i d|ƒ|idƒ}|idƒ}|ii|d|id|d|d |iƒ}|ii||d|id |iƒqWdS( NR8s&in 'libraries' option (library '%s'), s&'sources' must be present and must be sa list of source filenamessbuilding '%s' librarytmacrosRt output_dirR(RR4R5R:R8R RR,R/R-tlisttlogtinfoR=RR RtcompileRRtobjectstcreate_static_libR(R RR5R=R8RCRR4((RR)Λs" &    (s build-clibRs%directory to build C/C++ libraries to(s build-tempRs,directory to put temporary build by-products(sdebugRs"compile with debugging information(sforceR s2forcibly build everything (ignore file timestamps)(s compiler=R sspecify the compiler type(t__name__t __module__t descriptiont user_optionstboolean_optionsR Rt help_optionsRRR*RR7R<R)(((RR!s     &  (t__doc__t __revision__RRttypestdistutils.coretCommandtdistutils.errorstdistutils.sysconfigR"t distutilsR@RR(R"RLR@RORRRR((Rt?s