o
    "g2                     @   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r#d|v r|d d|v r|d |dg7 }|| _ dtjv rnddlm} tttjd }	tt|dd }
t| j }|	|vr[|	|
|	}t|| _ t| j
}|	|vrn| j
t|	 | _
dtj| j d |f }t| d	d
rdd|d g}ng }z| j| j | |d|g | | |d W n ty } z	t|}t|dd}~ww |rtjdkrtddd|d g t|d d}|t||| W d   dS 1 sw   Y  dS dS )z9Compile a single source files with a Unix-style compiler.r   aCCz-Aez-Aaz-AAOPT)get_config_varsz%s: %s_auto_dependsFz-MMDz-MFz.dz-odisplayNzoschtagz-tc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extcc_argsextra_postargspp_optsccompr   optgcv_optccomp_sllink_sr   depsemsgf r8   _/var/www/html/ecg_monitoring/venv/lib/python3.10/site-packages/numpy/distutils/unixccompiler.pyUnixCCompiler__compile   sR   






"r:   _compilec              
   C   s>  |  ||\}}| j||d}| ||rzt| W n	 ty%   Y nw | tj| || j	 }|ra|dd }|dd }dtj
| jd t||f }| j| j|g | |d |s6| jrdtj
| jd |f }z| j| j|g |d W dS  ty }	 z	t|	}
t|
dd}	~	ww dS 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_dirN2   z %s: adding %d object files to %sr   r   z%s:@ %szskipping %s (up-to-date))_fix_object_argslibrary_filename
_need_linkr   unlinkOSErrormkpathr   dirnameobjectsr   archiverlenr    ranlibr   r!   r   r   debug)r(   rE   output_libnamer<   rI   target_langoutput_filenametmp_objectsr   r5   r6   r8   r8   r9   UnixCCompiler_create_static_libI   sN   

rN   create_static_lib)Nr   N)__doc__r   r"   r$   r   distutils.errorsr   r   r   distutils.unixccompilerr   numpy.distutils.ccompilerr   numpy.distutils.misc_utilr   numpy.distutilsr   r:   rN   r8   r8   r8   r9   <module>   s"    5
C