Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib64/python3.7/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/distutils/__pycache__/unixccompiler.cpython-37.opt-2.pyc

B

~ f|;�@s�ddlZddlZddlZddlmZddlmZddlmZm	Z	m
Z
ddlmZm
Z
mZmZddlmZejdkrzddlZGdd	�d	e�ZdS)
�N)�	sysconfig)�newer)�	CCompiler�gen_preprocess_options�gen_lib_options)�DistutilsExecError�CompileError�LibError�	LinkError)�log�darwinc
s�eZdZdZddgdgdgddgdgddgdd�Zejdd�d	krNd
ged
<ddd
dddgZdZdZ	dZ
dZdZdZ
ZZeZejdkr�dZ�fdd�Zd.dd�Zdd�Zd/d d!�Zd0d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd1d,d-�Z�ZS)2�
UnixCCompilerZunixNZccz-shared�arz-cr)�preprocessor�compiler�compiler_so�compiler_cxx�	linker_so�
linker_exe�archiver�ranlib�rrz.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%s�cygwinz.execsFt|j|��|||�\}}}t�d�}|r<||kr<|�|�|||fS)NZLIBDIR)�super�	__class__�
_fix_lib_argsr�get_config_var�remove)�self�	libraries�library_dirs�runtime_library_dirsZlibdir)r��</opt/alt/python37/lib64/python3.7/distutils/unixccompiler.pyrUs

zUnixCCompiler._fix_lib_argsc
Cs�|�d||�}|\}}}t||�}	|j|	}
|r>|
�d|g�|rN||
dd�<|r\|
�|�|
�|�|js~|dks~t||�r�|r�|�tj	�
|��y|�|
�Wn*tk
r�}zt
|��Wdd}~XYnXdS)Nz-or)Z_fix_compile_argsrr�extend�append�forcer�mkpath�os�path�dirname�spawnrr)r�sourceZoutput_fileZmacrosZinclude_dirs�
extra_preargs�extra_postargs�
fixed_args�ignore�pp_optsZpp_args�msgr"r"r#�
preprocess_s$




zUnixCCompiler.preprocessc	
Csp|j}tjdkr t�|||�}y |�|||d|g|�Wn*tk
rj}zt|��Wdd}~XYnXdS)Nrz-o)r�sys�platform�_osx_support�compiler_fixupr+rr)	r�obj�srcZextZcc_argsr.r1rr2r"r"r#�_compileys

zUnixCCompiler._compilerc
Cs�|�||�\}}|j||d�}|�||�r�|�tj�|��|�|j|g||j	�|j
r�y|�|j
|g�Wq�tk
r�}zt|��Wdd}~XYq�Xnt
�d|�dS)N)�
output_dirzskipping %s (up-to-date))�_fix_object_args�library_filename�
_need_linkr'r(r)r*r+r�objectsrrr	r�debug)rr?Zoutput_libnamer;r@�target_lang�output_filenamer2r"r"r#�create_static_lib�szUnixCCompiler.create_static_libc
Cs�|�||�\}}|�|||�}|\}}}t||||�}t|ttd�f�sPtd��|dk	rftj�	||�}|�
||��r�||j|d|g}|	r�dg|dd�<|
r�|
|dd�<|r�|�|�|�
tj�|��y�|tjkr�|jdd�}n|jdd�}|
dk�rv|j�rvd}tj�|d�dk�rDd}xd||k�rB|d7}�q(Wtj�||�d	k�r`d}nd}|j||||<tjd
k�r�t�||�}|�||�Wn,tk
�r�}zt|��Wdd}~XYnXnt�d|�dS)Nz%'output_dir' must be a string or Nonez-oz-grzc++�env��=Z	ld_so_aixrzskipping %s (up-to-date))r<rr�
isinstance�str�type�	TypeErrorr(r)�joinr>r?r$r'r*rZ
EXECUTABLErrr�basenamer4r5r6r7r+rr
rr@)rZtarget_descr?rBr;rr r!Zexport_symbolsr@r-r.Z
build_temprAr/Zlib_optsZld_argsZlinker�i�offsetr2r"r"r#�link�sN


zUnixCCompiler.linkcCsd|S)Nz-Lr")r�dirr"r"r#�library_dir_option�sz UnixCCompiler.library_dir_optioncCsd|kpd|kS)NZgcczg++r")rZ
compiler_namer"r"r#�_is_gcc�szUnixCCompiler._is_gcccCs�tj�t�d��}tjdd�dkr,d|Stjdd�dkrFd|Stjdd�d	krz|�|�rnd
d|gSdd|gS|�|�r�t�d�d
kr�d|Sd|Snd|SdS)NZCCrrz-L�Zfreebsdz-Wl,-rpath=�zhp-uxz-Wl,+sz+sZGNULDZyesz-Wl,--enable-new-dtags,-Rz-Wl,-Rz-R)r(r)rLrrr4r5rR)rrPrr"r"r#�runtime_library_dir_option�s


z(UnixCCompiler.runtime_library_dir_optioncCsd|S)Nz-lr")r�libr"r"r#�library_optionszUnixCCompiler.library_optioncCs�|j|dd�}|j|dd�}|j|dd�}|j|dd�}tjdkrpt�d�}t�d|�}	|	dkrfd	}
n
|	�d
�}
�x|D�]}tj	�
||�}tj	�
||�}
tj	�
||�}tj	�
||�}tjdk�rD|�d�s�|�d��rD|�d
��sDtj	�
|
|d
d�|�}tj	�
|
|d
d�|�}
tj	�
|
|d
d�|�}tj	�
|
|d
d�|�}tj	�|
��rV|
Stj	�|��rh|Stj	�|��rz|Stj	�|�rx|SqxWdS)N�shared)Zlib_type�dylib�
xcode_stub�staticrZCFLAGSz-isysroot\s*(\S+)�/rEz/System/z/usr/z/usr/local/)
r=r4r5rr�re�search�groupr(r)rK�
startswith�exists)r�dirsrVr@Zshared_fZdylib_fZxcode_stub_fZstatic_fZcflags�mZsysrootrPrXrYr[rZr"r"r#�find_library_files>



zUnixCCompiler.find_library_file)NNNNN)NrN)
NNNNNrNNNN)r)�__name__�
__module__�__qualname__Z
compiler_typeZexecutablesr4r5Zsrc_extensionsZ
obj_extensionZstatic_lib_extensionZshared_lib_extensionZdylib_lib_extensionZxcode_stub_lib_extensionZstatic_lib_formatZshared_lib_formatZdylib_lib_formatZxcode_stub_lib_formatZ
exe_extensionrr3r:rCrOrQrRrUrWrd�
__classcell__r"r")rr#r
-sF





>*r
)r(r4r]Z	distutilsrZdistutils.dep_utilrZdistutils.ccompilerrrrZdistutils.errorsrrr	r
rr5r6r
r"r"r"r#�<module>s


Hacked By AnonymousFox1.0, Coded By AnonymousFox