File: //usr/local/lib/python3.10/dist-packages/numpy/distutils/__pycache__/unixccompiler.cpython-310.pyc
o
���g2 � @ s� d Z ddlZddlZddlZddlZddlmZmZmZ ddl m
Z
ddlmZ ddl
mZ ddlmZ dd � Zee
d
e� ddd�Zee
d
e� dS )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 dkr#d|v r|�d� d|v r|�d� |dg7 }|| _ dtjv rnddlm} t�t�tjd ��} t�t�|d�d ��}
t�| j �}| |vr[|� |
| �}t�|�| _ t�| j
�}| |vrn| j
t�| � | _
dtj�| j d �|f }
t
| d d
�r�dd|d
g}ng }z| j| j | |d|g | | |
d� W n ty� } z t|�}t|�d�d}~ww |r�tjdkr�t�ddd|d
g� t|d
d��}|�t|||�� W d � dS 1 s�w Y dS dS )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 �H/usr/local/lib/python3.10/dist-packages/numpy/distutils/unixccompiler.py�UnixCCompiler__compile sR
�
�
��
"��r: �_compilec
C s> | � ||�\}}| j||d�}| �||�r�zt�|� W n ty% Y nw | �tj�|�� || j }|ra|dd� }|dd� }dtj�
| jd �t|�|f }| j
| j|g | |d� |s6| jr�dtj�
| jd �|f }z| j
| j|g |d� W dS ty� } z t| �}
t|
�d�d} ~ ww dS t�d|� dS ) 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:@ %szskipping %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<