[W:@sdZddlZddlmZmZmZmZmZmZddl m Z m Z m Z ddl mZddlmZddlmZGdd d e ZdS) zdistutils.bcppcompiler Contains BorlandCCompiler, an implementation of the abstract CCompiler class for the Borland C++ compiler. N)DistutilsExecErrorDistutilsPlatformError CompileErrorLibError LinkErrorUnknownFileError) CCompilergen_preprocess_optionsgen_lib_options) write_file)newer)logc @seZdZdZdZiZdgZdddgZeeZdZ dZ d Z d Z Z d Zd d d d dZdddd dddddZdd dddZdddddd dddddd Zd ddZd dddZdddddddZdS) BCPPCompilerzConcrete class that implements an interface to the Borland C/C++ compiler, as defined by the CCompiler abstract class. Zbcppz.cz.ccz.cppz.cxxz.objz.libz.dllz%s%sz.exercCstj||||d|_d|_d|_d|_ddddg|_ddddg|_d d dd g|_d d dd g|_ g|_ d dd g|_ d dd d g|_ dS) Nz bcc32.exez ilink32.exeztlib.exez/tWMz/O2z/qz/g0z/Odz/Tpdz/Gnz/xz/r) r__init__cclinkerlibZpreprocess_optionscompile_optionscompile_options_debugldflags_sharedldflags_shared_debugZldflags_static ldflags_exeldflags_exe_debug)selfverboseZdry_runforcer,/usr/lib/python3.4/distutils/bcppcompiler.pyr5s     zBCPPCompiler.__init__Nc Cs |j||||||\}} }} } |p6g} | jd|r_| j|jn| j|jx| D]} y| | \}}Wntk rwvYnXtjj|}tjj| } |j tjj | |dkrqvn|dkrZy|j dd| |gWqvt k rS}zt |WYdd}~XqvXqvn||jkrrd}n||jkrd}nd}d| }y4|j |jg| | ||g||gWqvt k r}zt |WYdd}~XqvXqvW| S) Nz-cz.resz.rcZbrcc32z-foz-Pz-o)Z_setup_compileappendextendrrKeyErrorospathnormpathmkpathdirnamespawnrr _c_extensions_cpp_extensionsr)rZsources output_dirmacros include_dirsdebug extra_preargsextra_postargsZdependsobjectspp_optsZbuildZ compile_optsobjsrcextmsgZ input_optZ output_optrrrcompileQsF         .#zBCPPCompiler.compilec Cs|j||\}}|j|d|}|j||r|dg|}|rXny|j|jg|Wqtk r}zt|WYdd}~XqXntjd|dS)Nr*z/uzskipping %s (up-to-date)) _fix_object_argslibrary_filename _need_linkr'rrrr r-) rr0Zoutput_libnamer*r- target_langoutput_filenameZlib_argsr5rrrcreate_static_libs"zBCPPCompiler.create_static_libc Cs|j||\}}|j|||\}}}|rUtjdt|n|dk rytjj||}n|j||r|t j krd}| r|j dd}q|j dd}n5d}| r|j dd}n|jdd}|dkrd}ntjj|\}}tjj|\}}tjj|d}tjj|d|}dg}x+|pgD]}|jd||fqW|jt||fd |ttjj|}|g}g}x[|D]S}tjjtjj|\}}|d kr@|j|q|j|qWx+|D]#}|jd tjj|qXW|jd |j||jd |g|jdxL|D]D}|j||| }|dkr|j|q|j|qW|jd|jd|jd |g|jd |j|| rh| |dds .