o
    U=ºi¿  ã                   @   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   ZaCCz-Aez-Aaz-AAZ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+   úcC:\Users\psant\Downloads\PAF backend\school\venv\Lib\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))Z_fix_object_argsZlibrary_filenameZ
_need_linkr   ÚunlinkÚOSErrorÚmkpathr   ÚdirnameÚobjectsr   ÚarchiverÚlenr   Zranlibr   r   r   r   Údebug)r"   r5   Zoutput_libnamer/   r8   Ztarget_langZoutput_filenameZtmp_objectsr   r(   r)   r+   r+   r,   ÚUnixCCompiler_create_static_libI   sN   ÿÿ
þÿúÿÿû
€þÿr9   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-   r9   r+   r+   r+   r,   Ú<module>   s"    5
ÿCÿ