o
    Ô­j2  ã                   @   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
ƒr‰dd|d g}ng }z| j| j | |d|g | | |d� W n tyµ } z	t|ƒ}t|ƒd‚d}~ww |rëtjdkrÈt ddd|d g¡ t|d dƒ�}| t|||ƒ¡ W d  ƒ dS 1 säw   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   úZ/var/www/html/CropPilot/venv/lib/python3.10/site-packages/numpy/distutils/unixccompiler.pyÚUnixCCompiler__compile   sR   



ÿ
ÿ
€þ
"ÿúr:   Ú_compilec              
   C   s>  |   ||¡\}}| j||d�}|  ||¡r—z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r•d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_dirNé2   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ÿ