U
    ÉZj2  ã                   @   s–   d Z ddlZddlZddlZddlZddlmZmZmZ ddl	m
Z
 ddlmZ ddlmZ ddlmZ dd	„ Zee
d
eƒ ddd„Zee
deƒ dS )z>
unixccompiler - can handle very long argument lists for ar.

é    N)ÚCompileErrorÚDistutilsExecErrorÚLibError)ÚUnixCCompiler)Úreplace_method)Ú_commandline_dep_string)Úlogc              
   C   sÒ  | j }|d dkrFd|kr$| d¡ d|kr6| d¡ |dg7 }|| _ dtjkrÜddlm} t t tjd ¡¡}	t t |dƒd ¡¡}
t | j ¡}|	|kr¶| 	|
|	¡}t |¡| _ t | j
¡}|	|krÜ| j
t |	¡ | _
dtj | j d ¡|f }t| d	d
ƒ�rdd|d g}ng }z*| j| j | |d|g | | |d� W n6 tk
�rx } zt|ƒ}t|ƒd‚W 5 d}~X Y nX |�rÎtjdk�r¢t ddd|d g¡ t|d dƒ�}| t|||ƒ¡ W 5 Q R X dS )z9Compile a single source files with a Unix-style compiler.r   ZaCCz-Aez-Aaz-AAÚOPT)Úget_config_varsz%s: %sZ_auto_dependsFz-MMDz-MFz.dz-o©ÚdisplayNZzosZchtagz-tcZIBM1047Úa)Úcompiler_soÚremoveÚosÚenvironÚ	sysconfigr
   ÚshlexÚjoinÚsplitÚreplaceÚ	linker_soÚpathÚbasenameÚgetattrÚspawnr   Ústrr   ÚsysÚplatformÚ
subprocessÚcheck_outputÚopenÚwriter   )ÚselfÚobjÚsrcÚextZcc_argsZextra_postargsZpp_optsZccompr
   ÚoptZgcv_optZccomp_sZllink_sr   ÚdepsÚeÚmsgÚf© r,   ú`/var/www/html/TRUCKING_PROJECT/venv/lib/python3.8/site-packages/numpy/distutils/unixccompiler.pyÚUnixCCompiler__compile   sJ    



ÿÿ
r.   Ú_compilec              
   C   sJ  |   ||¡\}}| j||d�}|  ||¡�r:zt |¡ W n tk
rN   Y nX |  tj |¡¡ || j	 }|rÄ|dd… }|dd… }dtj 
| jd ¡t|ƒ|f }| j| j|g | |d� ql| j�rFdtj 
| jd ¡|f }z| j| j|g |d� W n6 tk
�r6 }	 zt|	ƒ}
t|
ƒd‚W 5 d}	~	X Y nX nt d|¡ dS )	aŒ  
    Build a static library in a separate sub-process.

    Parameters
    ----------
    objects : list or tuple of str
        List of paths to object files used to build the static library.
    output_libname : str
        The library name as an absolute or relative (if `output_dir` is used)
        path.
    output_dir : str, optional
        The path to the output directory. Default is None, in which case
        the ``output_dir`` attribute of the UnixCCompiler instance.
    debug : bool, optional
        This parameter is not used.
    target_lang : str, optional
        This parameter is not used.

    Returns
    -------
    None

    )Ú
output_dirNé2   z %s: adding %d object files to %sr   r   z%s:@ %szskipping %s (up-to-date))Z_fix_object_argsZlibrary_filenameZ
_need_linkr   ÚunlinkÚOSErrorÚmkpathr   ÚdirnameÚobjectsr   ÚarchiverÚlenr   Zranlibr   r   r   r   Údebug)r#   r6   Zoutput_libnamer0   r9   Ztarget_langZoutput_filenameZtmp_objectsr   r)   r*   r,   r,   r-   ÚUnixCCompiler_create_static_libI   sD    ÿ
 þÿÿÿ
r:   Zcreate_static_lib)Nr   N)Ú__doc__r   r   r   r   Údistutils.errorsr   r   r   Zdistutils.unixccompilerr   Znumpy.distutils.ccompilerr   Znumpy.distutils.misc_utilr   Znumpy.distutilsr   r.   r:   r,   r,   r,   r-   Ú<module>   s$   5     ÿ
Cÿ