a
    hÝEb2  ã                   @   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|v r$| d¡ d|v r6| d¡ |dg7 }|| _ dtjv rÜddlm} t t tjd ¡¡}	t t |dƒd ¡¡}
t | j ¡}|	|vr¶| 	|
|	¡}t |¡| _ t | j
¡}|	|v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 n8 t�yz } zt|ƒ}t|ƒd‚W Y d}~n
d}~0 0 |�rætjdk�r¤t ddd|d g¡ t|d dƒ�"}| t|||ƒ¡ W d  ƒ n1 �sÜ0    Y  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,   ú]/home/ja/django-apps/lartica_env/lib/python3.9/site-packages/numpy/distutils/unixccompiler.pyÚUnixCCompiler__compile   sJ    



ÿÿ
 r.   Ú_compilec              
   C   sJ  |   ||¡\}}| j||d�}|  ||¡�r:zt |¡ W n tyL   Y n0 |  tj |¡¡ || j	 }|rÂ|dd… }|dd… }dtj 
| jd ¡t|ƒ|f }| j| j|g | |d� qj| j�rFdtj 
| jd ¡|f }z| j| j|g |d� W n8 t�y6 }	 zt|	ƒ}
t|
ƒd‚W Y d}	~	n
d}	~	0 0 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   sB    ÿ
þÿÿÿ
"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ÿ