mò &U²Ic@s¸dZdZdkZdkZdkZdklZlZdkl Z dk l Z dk l Z lZlZdklZde fd „ƒYZd Zd Zd Zd „Zd„ZdS(sŽdistutils.emxccompiler Provides the EMXCCompiler class, a subclass of UnixCCompiler that handles the EMX port of the GNU C compiler to OS/2. s=$Id: emxccompiler.py 34786 2003-12-02 12:17:59Z aimacintyre $N(sgen_preprocess_optionssgen_lib_options(s UnixCCompiler(s write_file(sDistutilsExecErrors CompileErrorsUnknownFileError(slogt EMXCCompilerc Bs•tZdZdZdZdZdZdZdZdZ dddd „Z d „Z ddddddddddd „ Z dd d „Zdd„ZRS(Ntemxs.objs.libs.dlls%s%ss.ress.exeic CsÑti||||ƒtƒ\}}|i d||fƒ|t j o|i dd|dƒnt ƒ\|_ |_|i |id|i |ifƒ|iddddd d d d ƒd g|_dS(Ns%Python's GCC status: %s (details: %s)s<Python's pyconfig.h doesn't seem to support your compiler. s Reason: %s.s<Compiling may fail because of undefined preprocessor macros.s: gcc %s, ld %s tcompilers5gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wallt compiler_sot linker_exesgcc -Zomf -Zmt -Zcrtdllt linker_sosgcc -Zomf -Zmt -Zcrtdll -Zdlltgcc(t UnixCCompilert__init__tselftverbosetdry_runtforcetcheck_config_htstatustdetailst debug_printt CONFIG_H_OKtwarnt get_versionst gcc_versiont ld_versiont compiler_typetset_executablest dll_libraries(R R R R RR((t3/data/zmath/lib/python2.4/distutils/emxccompiler.pyR*s $  cCsš|djo?y|idd|gƒWq–tj o}t|‚q–XnKy)|i|i||d|g|ƒWntj o}t|‚nXdS(Ns.rctrcs-rs-o( textR tspawntsrctDistutilsExecErrortmsgt CompileErrorRtcc_argstobjtextra_postargs(R R"RRR!R#tpp_optsR((Rt_compileMs )cCs‘ti| pgƒ} ti|pgƒ}ti|pgƒ}|i|iƒ|dj oâ||i joÒt i i |dƒ}t i it i i|ƒƒ\}}t i i||dƒ}dt i it i i|ƒƒdddg}x|D]}|id|ƒqøW|it||fd|ƒ|i|ƒn| p| idƒnti||||||||d| | | | | ƒdS( Nis.defs$LIBRARY %s INITINSTANCE TERMINSTANCEsDATA MULTIPLE NONSHAREDtEXPORTSs "%s"s writing %ss-s($tcopyt extra_preargst librariestobjectstextendR Rtexport_symbolstNonet target_desct EXECUTABLEtostpathtdirnamettemp_dirtsplitexttbasenametoutput_filenametdll_namet dll_extensiontjointdef_filetcontentstsymtappendtexecutet write_filetdebugRtlinkt output_dirt library_dirstruntime_library_dirsR#t build_tempt target_lang(R R.R*R6RBR)RCRDR,R@R(R#RERFR7R8R;R3R<R:((RRA[s> $/   tcCsø|djo d}ng}xÔ|D]Ì}tiitii|ƒƒ\}}||i dgjot d||f‚n|otii|ƒ}n|djo'|itii|||iƒƒq$|itii|||iƒƒq$W|S(NRGs.rcs"unknown file type '%s' (from '%s')(RBR-t obj_namestsource_filenamestsrc_nameR0R1R4tnormcasetbaseRR tsrc_extensionstUnknownFileErrort strip_dirR5R=R9t res_extensiont obj_extension(R RIRORBRHRRLRJ((Rtobject_filenames¶s  $ c CsÃd|}d|}ytididƒ}Wntj o g}nXxr||D]f}ti i ||ƒ}ti i ||ƒ} ti i|ƒo|SqUti i| ƒo| SqUqUWdS(Ns%s.libs lib%s.libt LIBRARY_PATHt;(tlibtshortlibtlonglibR0tenvirontsplittemx_dirstKeyErrortdirstdirR1R9t shortlibptlonglibptexistsR-( R R\RUR@RZR^RWRVR]R_((Rtfind_library_fileÒs     (t__name__t __module__RRQtstatic_lib_extensiontshared_lib_extensiontstatic_lib_formattshared_lib_formatRPt exe_extensionRR%R-RARRRa(((RRs# '[toksnot okt uncertaincCsÞdkl}dk}|itidƒdjotdfSn|iƒ}y&t |ƒ}|i ƒ}|i ƒWn,tj o }td||iffSn;X|i|dƒdjotd|fSntd |fSdS( s¡Check if the current Python installation (specifically, pyconfig.h) appears amenable to building extensions with GCC. Returns a tuple (status, details), where 'status' is one of the following constants: CONFIG_H_OK all is well, go ahead and compile CONFIG_H_NOTOK doesn't look good CONFIG_H_UNCERTAIN not sure -- unable to read pyconfig.h 'details' is a human-readable string explaining the situation. Note there are two ways to conclude "OK": either 'sys.version' contains the string "GCC" (implying that this Python was built with GCC), or the installed "pyconfig.h" contains the string "__GNUC__". (s sysconfigNtGCCissys.version mentions 'GCC'scouldn't read '%s': %st__GNUC__s'%s' mentions '__GNUC__'s '%s' does not mention '__GNUC__'(t distutilst sysconfigtstringtfindtsystversionRtget_config_h_filenametfntopentftreadtstclosetIOErrortexctCONFIG_H_UNCERTAINtstrerrortCONFIG_H_NOTOK(RoRvRnRxRtR{((RR òs     c Cs´dkl}dkl}dk}|dƒ}|ohti|ddƒ}|i ƒ}|i ƒ|i d|ƒ}|o||idƒƒ}q¤d}nd}d}||fS( sa Try to find out the versions of gcc and ld. If not possible it returns None for it. (s StrictVersion(sfind_executableNRs -dumpversiontrs(\d+\.\d+\.\d+)i(tdistutils.versiont StrictVersiontdistutils.spawntfind_executabletretgcc_exeR0tpopentoutRwt out_stringRytsearchtresulttgroupRR-R( RƒRRR„R…RŠRRˆR‡((RR$s        (t__doc__t __revision__R0RqR'tdistutils.ccompilertgen_preprocess_optionstgen_lib_optionstdistutils.unixccompilerRtdistutils.file_utilR?tdistutils.errorsRR RNRmtlogRRR~R|R R(RRR”RRRR~R RRqR|RR R?R'R0RNR((Rt?s   Ï 2