ó û^‚Rc@s dZdZddlZddlmZmZmZmZmZddl m Z m Z ddl m Z ddlmZddlmZd e fd „ƒYZdS( sƒdistutils.bcppcompiler Contains BorlandCCompiler, an implementation of the abstract CCompiler class for the Borland C++ compiler. s$Id$iÿÿÿÿN(tDistutilsExecErrort CompileErrortLibErrort LinkErrortUnknownFileError(t CCompilertgen_preprocess_options(t write_file(tnewer(tlogt BCPPCompilerc BsúeZdZdZiZdgZdddgZeeZdZdZ dZ d Z Z d Z d d d d „Zdddd dddd „Zdd dd„Zdddddd ddddd„ Zd d„Zd dd„Zdddddd„ZRS(sConcrete class that implements an interface to the Borland C/C++ compiler, as defined by the CCompiler abstract class. tbcpps.cs.ccs.cpps.cxxs.objs.libs.dlls%s%ss.exeicCsÂtj||||ƒd|_d|_d|_d|_ddddg|_ddddg|_d d dd g|_ d d dd g|_ g|_ d dd g|_ d dd d g|_ dS( Ns bcc32.exes ilink32.exestlib.exes/tWMs/O2s/qs/g0s/Ods/Tpds/Gns/xs/r(Rt__init__tcctlinkertlibtNonetpreprocess_optionstcompile_optionstcompile_options_debugtldflags_sharedtldflags_shared_debugtldflags_statict ldflags_exetldflags_exe_debug(tselftverbosetdry_runtforce((s,/usr/lib/python2.7/distutils/bcppcompiler.pyR 5s     c Csß|j||||||ƒ\}} }} } |p6g} | jdƒ|r_| j|jƒn| j|jƒxi| D]a} y| | \}}Wntk r¦qvnXtjj|ƒ}tjj| ƒ} |j tjj | ƒƒ|dkröqvn|dkrDy|j dd| |gƒWqvt k r=}t |‚qvXqvn||jkr\d}n||jkrtd}nd}d| }y4|j |jg| | ||g||gƒWqvt k rÖ}t |‚qvXqvW| S( Ns-cs.ress.rctbrcc32s-fots-Ps-o(t_setup_compiletappendtextendRRtKeyErrortostpathtnormpathtmkpathtdirnametspawnRRt _c_extensionst_cpp_extensionsR (Rtsourcest output_dirtmacrost include_dirstdebugt extra_preargstextra_postargstdependstobjectstpp_optstbuildt compile_optstobjtsrctexttmsgt input_optt output_opt((s,/usr/lib/python2.7/distutils/bcppcompiler.pytcompileQsF          .c Cs©|j||ƒ\}}|j|d|ƒ}|j||ƒr•|dg|}|rXny|j|jg|ƒWq¥tk r‘}t|‚q¥Xntjd|ƒdS(NR,s/usskipping %s (up-to-date)( t_fix_object_argstlibrary_filenamet _need_linkR(RRRR R/( RR3toutput_libnameR,R/t target_langtoutput_filenametlib_argsR:((s,/usr/lib/python2.7/distutils/bcppcompiler.pytcreate_static_lib’sc Cs¾|j||ƒ\}}|j|||ƒ\}}}|rUtjdt|ƒƒn|dk rytjj||ƒ}n|j ||ƒrª|t j krÀd}| r³|j }qã|j }n#d}| rÙ|j}n |j}|dkrød}n³tjj|ƒ\}}tjj|ƒ\}}tjj|dƒ}tjj|d|ƒ}dg}x+|plgD]}|jd||fƒqmW|jt||fd |ƒttjj|ƒ}|g}g}x[|D]S}tjjtjj|ƒƒ\}}|d kr|j|ƒqÖ|j|ƒqÖWx+|D]#}|jd tjj|ƒƒq4W|jd ƒ|j|ƒ|jd |gƒ|jdƒxL|D]D}|j||| ƒ}|dkrÓ|j|ƒqœ|j|ƒqœW|jdƒ|jdƒ|jd |gƒ|jd ƒ|j|ƒ| r>| |d*n| rT|j| ƒn|jtjj|ƒƒy|j|jg|ƒWqºtk r¦}t|‚qºXntj d|ƒdS(Ns7I don't know what to do with 'runtime_library_dirs': %stc0w32tc0d32Ris%s.deftEXPORTSs %s=_%ss writing %ss.ress/L%ss/L.t,s,,timport32tcw32mtsskipping %s (up-to-date)(!R>t _fix_lib_argsR twarntstrRR#R$tjoinR@Rt EXECUTABLERRRRtsplittsplitextR'R texecuteRtmapR%tnormcaseR!tfind_library_fileR&R(RRRR/( Rt target_descR3RCR,t librariest library_dirstruntime_library_dirstexport_symbolsR/R0R1t build_tempRBt startup_objtld_argstdef_filetheadttailtmodnameR9ttemp_dirtcontentstsymtobjects2t resourcestfiletbasetlRtlibfileR:((s,/usr/lib/python2.7/distutils/bcppcompiler.pytlink«s|            $  !          c Cs›|r-|d}|d|d||f}n|d|f}xW|D]K}xB|D]:}tjj||j|ƒƒ}tjj|ƒrQ|SqQWqDWdSdS(Nt_dt_bcpp(R#R$ROR?texistsR( RtdirsRR/tdlibt try_namestdirtnameRk((s,/usr/lib/python2.7/distutils/bcppcompiler.pyRV4s     RcCs|dkrd}ng}xý|D]õ}tjjtjj|ƒƒ\}}||jddgkr{td||f‚n|r–tjj|ƒ}n|dkrÅ|jtjj |||ƒƒq"|dkrô|jtjj ||dƒƒq"|jtjj |||j ƒƒq"W|S(NRs.rcs.ress"unknown file type '%s' (from '%s')( RR#R$RRRUtsrc_extensionsRtbasenameR ROt obj_extension(Rtsource_filenamest strip_dirR,t obj_namestsrc_nameRiR9((s,/usr/lib/python2.7/distutils/bcppcompiler.pytobject_filenamesNs$  $ # #c Cs|jd||ƒ\}}}t||ƒ}dg|} |dk rZ| jd|ƒn|rm|| d*n|rƒ| j|ƒn| j|ƒ|js´|dks´t||ƒr|rÖ|jtj j |ƒƒny|j | ƒWqt k r } | GHt | ‚qXndS(Ns cpp32.exes-oi(t_fix_compile_argsRRR R!RRR&R#R$R'R(RR( Rtsourcet output_fileR-R.R0R1t_R4tpp_argsR:((s,/usr/lib/python2.7/distutils/bcppcompiler.pyt preprocessjs$     $N(t__name__t __module__t__doc__t compiler_typet executablesR)R*RuRwtstatic_lib_extensiontshared_lib_extensiontstatic_lib_formattshared_lib_formatt exe_extensionR RR=RERlRVR|R‚(((s,/usr/lib/python2.7/distutils/bcppcompiler.pyR sJ     B  |  (R…t __revision__R#tdistutils.errorsRRRRRtdistutils.ccompilerRRtdistutils.file_utilRtdistutils.dep_utilRt distutilsR R (((s,/usr/lib/python2.7/distutils/bcppcompiler.pyts  (