U
ifW: @ sx d Z ddlZddlmZmZmZmZmZmZ ddl m
Z
mZmZ ddl
mZ ddlmZ ddlmZ G dd d e
ZdS )
zdistutils.bcppcompiler
Contains BorlandCCompiler, an implementation of the abstract CCompiler class
for the Borland C++ compiler.
N)DistutilsExecErrorDistutilsPlatformErrorCompileErrorLibError LinkErrorUnknownFileError) CCompilergen_preprocess_optionsgen_lib_options)
write_file)newer)logc
@ s e Zd ZdZdZi ZdgZdddgZee ZdZ dZ
d Zd
ZZ
dZdd
dZdddZdddZd ddZd!ddZd"ddZd#ddZdS )$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.exer c C s t | ||| d| _d| _d| _d | _ddddg| _ddddg| _d d
ddg| _d d
ddg| _ g | _
d
ddg| _d
dddg| _d S )
Nz bcc32.exezilink32.exeztlib.exez/tWMz/O2z/qz/g0z/Odz/Tpdz/Gnz/xz/r)
r __init__cclinkerlibZpreprocess_optionscompile_optionscompile_options_debugldflags_sharedldflags_shared_debugZldflags_staticldflags_exeldflags_exe_debug)selfverboseZdry_runforce r ;/opt/alt/python38/lib64/python3.8/distutils/bcppcompiler.pyr 5 s zBCPPCompiler.__init__Nc C s | ||||||\}} }}
}|p$g }|d |rB|| j n|| j | D ]<}
z||
\}}W n tk
r Y qRY nX tj|}tj|
}
| tj
|
|dkrqR|dkrz| dd|
|g W qR tk
r } zt
|W 5 d }~X Y qRX qR|| jkrd}n|| jkr*d}nd}d|
}z,| | jg| |
||g | |g W qR tk
r } zt
|W 5 d }~X Y qRX qR| S ) Nz-c.res.rcZbrcc32z-fo z-P-o)Z_setup_compileappendextendr r KeyErrorospathnormpathmkpathdirnamespawnr r
_c_extensions_cpp_extensionsr )r Zsources
output_dirmacrosinclude_dirsdebug
extra_preargsextra_postargsZdependsobjectspp_optsZbuildZcompile_optsobjsrcextmsgZ input_optZ
output_optr r r compileQ sV
zBCPPCompiler.compilec
C s | ||\}}| j||d}| ||r~|dg| }|r:z| | jg| W q tk
rz } zt|W 5 d }~X Y qX ntd| d S )N)r- z/uskipping %s (up-to-date)) _fix_object_argslibrary_filename
_need_linkr* r r r r
r0 ) r r3 Zoutput_libnamer- r0 target_langoutput_filenameZlib_argsr8 r r r create_static_lib s zBCPPCompiler.create_static_libc
C s | ||\}}| |||\}}}|r8tdt| |d k rNtj||}| ||r|t j
krd}| r~| jd d }q| jd d }n&d}| r| j
d d }n| jd d }|d krd}ntj|\}}tj|\}}tj|d }tj|d| }dg}|pg D ]}|d||f q| t||fd | ttjj|}|g}g }|D ]>}tjtj|\}}|d
kr|| n
|| q`|D ]}|dtj| q|d || |d
|g |d |D ]4}| ||| }|d kr|| n
|| q|d |d |d
|g |d
|| |
rp|
|d d<