Hacked By AnonymousFox

Current Path : /proc/thread-self/root/proc/self/root/opt/alt/python37/lib64/python3.7/distutils/__pycache__/
Upload File :
Current File : //proc/thread-self/root/proc/self/root/opt/alt/python37/lib64/python3.7/distutils/__pycache__/bcppcompiler.cpython-37.pyc

B

� fW:�@sxdZddlZddlmZmZmZmZmZmZddl	m
Z
mZmZddl
mZddlmZddlmZGdd	�d	e
�ZdS)
z�distutils.bcppcompiler

Contains BorlandCCompiler, an implementation of the abstract CCompiler class
for the Borland C++ compiler.
�N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError�	LinkError�UnknownFileError)�	CCompiler�gen_preprocess_options�gen_lib_options)�
write_file)�newer)�logc
@s�eZdZdZdZiZdgZdddgZeeZdZ	dZ
d	Zd
ZZ
dZdd
d�Zddd�Zddd�Zd dd�Zd!dd�Zd"dd�Zd#dd�ZdS)$�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.exercCs�t�||||�d|_d|_d|_d|_ddddg|_ddddg|_d	d
ddg|_d	d
ddg|_	g|_
d
ddg|_d
dddg|_dS)
Nz	bcc32.exezilink32.exeztlib.exez/tWMz/O2z/qz/g0z/Odz/Tpdz/Gnz/xz/r)
r�__init__�cc�linker�libZpreprocess_options�compile_options�compile_options_debug�ldflags_shared�ldflags_shared_debugZldflags_static�ldflags_exe�ldflags_exe_debug)�self�verboseZdry_run�force�r�;/opt/alt/python37/lib64/python3.7/distutils/bcppcompiler.pyr5szBCPPCompiler.__init__Nc	Cs�|�||||||�\}}	}}
}|p$g}|�d�|rB|�|j�n|�|j��xD|	D�]:}
y||
\}}Wntk
r�wVYnXtj�|�}tj�|
�}
|�	tj�
|
��|dkr�qV|dk�ry|�dd|
|g�WqVtk
�r}zt
|��Wdd}~XYqVXqV||jk�rd}n||jk�r,d}nd}d|
}y,|�|jg||
||g||g�WqVtk
�r�}zt
|��Wdd}~XYqVXqVW|	S)	Nz-cz.resz.rcZbrcc32z-fo�z-Pz-o)Z_setup_compile�append�extendrr�KeyError�os�path�normpath�mkpath�dirname�spawnrr�
_c_extensions�_cpp_extensionsr)rZsources�
output_dir�macros�include_dirs�debug�
extra_preargs�extra_postargsZdepends�objects�pp_optsZbuildZcompile_opts�obj�src�ext�msgZ	input_optZ
output_optrrr�compileQsF

(zBCPPCompiler.compilec	
Cs�|�||�\}}|j||d�}|�||�r~|dg|}|r:y|�|jg|�Wq�tk
rz}zt|��Wdd}~XYq�Xnt�d|�dS)N)r*z/uzskipping %s (up-to-date))	�_fix_object_args�library_filename�
_need_linkr'rrrr
r-)	rr0Zoutput_libnamer*r-�target_lang�output_filenameZlib_argsr5rrr�create_static_lib�szBCPPCompiler.create_static_libc 
Cs�|�||�\}}|�|||�\}}}|r8t�dt|��|dk	rNtj�||�}|�||��r�|t	j
kr�d}|	r~|jdd�}q�|jdd�}n&d}|	r�|j
dd�}n|jdd�}|dkr�d}n�tj�|�\}}tj�|�\}}tj�|d�}tj�|d|�}dg}x&|�pgD]}|�d||f��qW|�t||fd	|�ttjj|�}|g}g}xF|D]>}tj�tj�|��\}}|d
k�r�|�|�n
|�|��qfWx$|D]}|�dtj�|���q�W|�d�|�|�|�d
|g�|�d�x<|D]4}|�|||	�}|dk�r(|�|�n
|�|��qW|�d�|�d�|�d
|g�|�d
�|�|�|
�r�|
|dd�<|�r�|�|�|�tj�|��y|�|jg|�Wn,tk
�r�}zt|��Wdd}~XYnXnt�d|�dS)Nz7I don't know what to do with 'runtime_library_dirs': %sZc0w32Zc0d32rrz%s.defZEXPORTSz  %s=_%sz
writing %sz.resz/L%sz/L.�,z,,Zimport32Zcw32mtzskipping %s (up-to-date)) r7Z
_fix_lib_argsr
�warn�strr"r#�joinr9rZ
EXECUTABLErrrr�split�splitextr&rZexecuter�mapr$�normcaser �find_library_filer%r'rrrr-) rZtarget_descr0r;r*Z	librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsr-r.r/Z
build_tempr:Zstartup_objZld_argsZdef_file�head�tail�modnamer4Ztemp_dir�contentsZsymZobjects2Z	resources�file�base�lr�libfiler5rrr�link�s|
















zBCPPCompiler.linkc	Csv|r"|d}|d|d||f}n|d|f}xB|D]6}x0|D](}tj�||�|��}tj�|�r>|Sq>Wq4WdSdS)NZ_dZ_bcpp)r"r#r@r8�exists)	r�dirsrr-ZdlibZ	try_names�dir�namerMrrrrE4s


zBCPPCompiler.find_library_filercCs�|dkrd}g}x�|D]�}tj�tj�|��\}}||jddgkrTtd||f��|rdtj�|�}|dkr�|�tj�|||��q|dkr�|�tj�||d��q|�tj�|||j	��qW|S)Nrz.rcz.resz"unknown file type '%s' (from '%s'))
r"r#rBrD�src_extensionsr�basenamerr@�
obj_extension)rZsource_filenamesZ	strip_dirr*Z	obj_namesZsrc_namerKr4rrr�object_filenamesNs"
zBCPPCompiler.object_filenamesc
Cs�|�d||�\}}}t||�}dg|}	|dk	r>|	�d|�|rN||	dd�<|r\|	�|�|	�|�|js~|dks~t||�r�|r�|�tj�	|��y|�
|	�Wn2tk
r�}
zt|
�t
|
��Wdd}
~
XYnXdS)Nz	cpp32.exez-or)Z_fix_compile_argsr	rr rrr%r"r#r&r'r�printr)r�sourceZoutput_filer+r,r.r/�_r1Zpp_argsr5rrr�
preprocessis$	



zBCPPCompiler.preprocess)rrr)NNNrNNN)NrN)
NNNNNrNNNN)r)rr)NNNNN)�__name__�
__module__�__qualname__�__doc__Z
compiler_typeZexecutablesr(r)rSrUZstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionrr6r<rNrErVrZrrrrrsJ


B

|

r)r^r"Zdistutils.errorsrrrrrrZdistutils.ccompilerrr	r
Zdistutils.file_utilrZdistutils.dep_utilrZ	distutilsr
rrrrr�<module>s
 

Hacked By AnonymousFox1.0, Coded By AnonymousFox