Spade
Mini Shell
| Directory:~$ /proc/self/root/usr/lib64/python3.6/distutils/__pycache__/ |
| [Home] [System Details] [Kill Me] |
3
k��h�:�@s�dZddlZddlZddlZddlmZddlmZddlm Z m
Z
mZddlm
Z
mZmZmZddlmZejdkr~ddlZGd d
�d
e �ZdS)a9distutils.unixccompiler
Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
* macros defined with -Dname[=value]
* macros undefined with -Uname
* include search directories specified with -Idir
* libraries specified with -lllib
* library search directories specified with -Ldir
* compile handled by 'cc' (or similar) executable with -c
option:
compiles .c to .o
* link static library handled by 'ar' command (possibly with
'ranlib')
* link shared library handled by 'cc -shared'
�N)� sysconfig)�newer)� CCompiler�gen_preprocess_options�gen_lib_options)�DistutilsExecError�CompileError�LibError� LinkError)�log�darwinc
s�eZdZdZddgdgdgddgdgddgdd�Zejdd�d krNd
ged
<ddd
dddgZdZdZ dZ
dZdZdZ
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�rrz.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%s�cygwinz.execs@t�j|||�\}}}tjd�}|r6||kr6|j|�|||fS)z'Remove
standard library path from
rpath�LIBDIR)�super�
_fix_lib_argsr�get_config_var�remove)�self� libraries�library_dirs�runtime_library_dirsZlibdir)� __class__��%/usr/lib64/python3.6/unixccompiler.pyrUs
zUnixCCompiler._fix_lib_argscCs�|jd||�}|\}}}t||�} |j| }
|r>|
jd|g�|rN||
dd�<|r\|
j|�|
j|�|js~|dks~t||�r�|r�|jtj j
|��y|j|
�Wn*tk
r�}zt
|��WYdd}~XnXdS)Nz-or)Z_fix_compile_argsrr�extend�append�forcer�mkpath�os�path�dirname�spawnrr)r�sourceZoutput_fileZmacrosZinclude_dirs�
extra_preargs�extra_postargs�
fixed_args�ignore�pp_optsZpp_args�msgr#r#r$�
preprocess^s$
zUnixCCompiler.preprocessc Csp|j}tjdkr
tj|||�}y |j|||d|g|�Wn*tk
rj}zt|��WYdd}~XnXdS)Nrz-o)r�sys�platform�_osx_support�compiler_fixupr,rr) r�obj�srcZextZcc_argsr/r2rr3r#r#r$�_compilexs
zUnixCCompiler._compilercCs�|j||�\}}|j||d�}|j||�r�|jtjj|��|j|j|g||j �|j
r�y|j|j
|g�Wq�tk
r�}zt|��WYdd}~Xq�Xnt
jd|�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<rA�target_lang�output_filenamer3r#r#r$�create_static_lib�szUnixCCompiler.create_static_libcCs�|j||�\}}|j|||�}|\}}}t||||�}t|ttd�f�sPtd��|dk rftjj ||�}|j
||��r�||j|d|g}| r�dg|dd�<|
r�|
|dd�<|r�|j|�|j
tjj|��y�|tjkr�|jdd�}n|jdd�}|
dk�rR|j�rRd}tjj|d�dk�rDd}xd||k�rB|d7}�q(W|j|||<tjd k�rjtj||�}|j||�Wn,tk
�r�}zt|��WYdd}~XnXntjd
|�dS)Nz%'output_dir' must be a string or
Nonez-oz-grzc++�env��=rzskipping %s (up-to-date))r=rr�
isinstance�str�type� TypeErrorr)r*�joinr?r@r%r(r+rZ
EXECUTABLErrr�basenamer5r6r7r8r,rr
rrA)rZtarget_descr@rCr<rr r!Zexport_symbolsrAr.r/Z
build_temprBr0Zlib_optsZld_argsZlinker�ir3r#r#r$�link�sH
zUnixCCompiler.linkcCsd|S)Nz-Lr#)r�dirr#r#r$�library_dir_option�sz
UnixCCompiler.library_dir_optioncCsd|kpd|kS)N�gcczg++r#)rZ
compiler_namer#r#r$�_is_gcc�szUnixCCompiler._is_gcccCs�tjjtjd��}tjdd�dkr,d|Stjdd�dkrFd|Stjdd�d krz|j|�rnd
d|gSdd|gStjdd�dks�tjdd�d
kr�d|gS|j|�r�tjd�dkr�d|Sd|Snd|SdS)N�CCrrz-L�Zfreebsdz-Wl,-rpath=�zhp-uxz-Wl,+sz+sZirix646Zosf1V5z-rpath�GNULD�yesz-Wl,--enable-new-dtags,-Rz-Wl,-Rz-R)r)r*rMrrr5r6rS)rrPrr#r#r$�runtime_library_dir_option�s
$
z(UnixCCompiler.runtime_library_dir_optioncCsd|S)Nz-lr#)r�libr#r#r$�library_option szUnixCCompiler.library_optioncCs�|j|dd�}|j|dd�}|j|dd�}|j|dd�}tjdkrptjd�}tjd|�} | dkrfd }
n
| jd
�}
�x|D�]}tj j
||�}tj j
||�}
tj j
||�}tj j
||�}tjdko�|jd�s�|jd�o�|jd
��rBtj j
|
|d
d�|�}tj j
|
|d
d�|�}
tj j
|
|d
d�|�}tj j
|
|d
d�|�}tj j|
��rT|
Stj j|��rf|Stj j|��rx|Stj j|�rx|SqxWdS)N�shared)Zlib_type�dylib�
xcode_stub�staticr�CFLAGSz-isysroot\s+(\S+)�/rFz/System/z/usr/z/usr/local/)
r>r5r6rr�re�search�groupr)r*rL�
startswith�exists)r�dirsrZrAZshared_fZdylib_fZxcode_stub_fZstatic_fZcflags�mZsysrootrPr\r]r_r^r#r#r$�find_library_files>
zUnixCCompiler.find_library_file)NNNNN)NrN)
NNNNNrNNNN)r)�__name__�
__module__�__qualname__Z
compiler_typeZexecutablesr5r6Zsrc_extensionsZ
obj_extensionZstatic_lib_extensionZshared_lib_extensionZdylib_lib_extensionZxcode_stub_lib_extensionZstatic_lib_formatZshared_lib_formatZdylib_lib_formatZxcode_stub_lib_formatZ
exe_extensionrr4r;rDrOrQrSrYr[ri�
__classcell__r#r#)r"r$r
-sF
6,r
)�__doc__r)r5rbZ distutilsrZdistutils.dep_utilrZdistutils.ccompilerrrrZdistutils.errorsrrr r
rr6r7r
r#r#r#r$�<module>s