<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
B
    ReV                 @   sT   d Z ddlZddlmZ ddlT ddlmZ ddlmZ dd Z	G d	d
 d
eZ
dS )zdistutils.command.build_clib

Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module.    N)Command)*)customize_compiler)logc              C   s   ddl m}  |   d S )Nr   )show_compilers)distutils.ccompilerr   )r    r   /builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/build_clib.pyr      s    r   c               @   sl   e Zd ZdZdddddgZddgZd	d
defgZdd Zdd Z	dd Z
dd Zdd Zdd Zdd Zd
S )
build_clibz/build C/C++ libraries used by Python extensions)zbuild-clib=bz%directory to build C/C++ libraries to)zbuild-temp=tz,directory to put temporary build by-products)debuggz"compile with debugging information)forcefz2forcibly build everything (ignore file timestamps))z	compiler=czspecify the compiler typer   r   zhelp-compilerNzlist available compilersc             C   s:   d | _ d | _d | _d | _d | _d | _d | _d| _d | _d S )Nr   )	r
   
build_temp	librariesinclude_dirsdefineundefr   r   compiler)selfr   r   r	   initialize_options4   s    zbuild_clib.initialize_optionsc             C   sh   |  dddddd | jj| _| jr0| | j | jd krH| jjpDg | _t| jtrd| jtj	| _d S )Nbuild)r   r
   )r   r   )r   r   )r   r   )r   r   )
set_undefined_optionsdistributionr   check_library_listr   
isinstancestrsplitospathsep)r   r   r   r	   finalize_optionsD   s    

zbuild_clib.finalize_optionsc             C   s   | j s
d S ddlm} || j| j| jd| _t| j | jd k	rN| j| j | j	d k	rzx | j	D ]\}}| j
|| q`W | jd k	rx| jD ]}| j| qW | | j  d S )Nr   )new_compiler)r   dry_runr   )r   r   r$   r   r%   r   r   r   Zset_include_dirsr   Zdefine_macror   Zundefine_macrobuild_libraries)r   r$   namevalueZmacror   r   r	   run^   s     



zbuild_clib.runc             C   s   t |tstdx|D ]z}t |ts:t|dkr:td|\}}t |tsTtdd|ksptjdkrtj|krtd|d  t |tstdqW d	S )
a`  Ensure that the list of libraries is valid.

        `library` is presumably provided as a command option 'libraries'.
        This method checks that it is a list of 2-tuples, where the tuples
        are (library_name, build_info_dict).

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z+'libraries' option must be a list of tuples   z*each element of 'libraries' must a 2-tuplezNfirst element of each tuple in 'libraries' must be a string (the library name)/z;bad library name '%s': may not contain directory separatorsr   zMsecond element of each tuple in 'libraries' must be a dictionary (build info)N)	r   listDistutilsSetupErrortuplelenr   r!   sepdict)r   r   libr'   
build_infor   r   r	   r   v   s"    




zbuild_clib.check_library_listc             C   s0   | j s
d S g }x| j D ]\}}|| qW |S )N)r   append)r   Z	lib_nameslib_namer3   r   r   r	   get_library_names   s    zbuild_clib.get_library_namesc             C   s^   |  | j g }xH| jD ]>\}}|d}|d ks@t|ttfsLtd| || qW |S )Nsourceszfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames)r   r   getr   r,   r.   r-   extend)r   	filenamesr5   r3   r7   r   r   r	   get_source_files   s    
zbuild_clib.get_source_filesc             C   s   x|D ]\}}| d}|d ks.t|ttfs:td| t|}td| | d}| d}| jj|| j	||| j
d}| jj||| j| j
d qW d S )Nr7   zfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenameszbuilding '%s' librarymacrosr   )
output_dirr<   r   r   )r=   r   )r8   r   r,   r.   r-   r   infor   compiler   r   Zcreate_static_libr
   )r   r   r5   r3   r7   r<   r   Zobjectsr   r   r	   r&      s$    




zbuild_clib.build_libraries)__name__
__module____qualname__descriptionuser_optionsboolean_optionsr   help_optionsr   r#   r)   r   r6   r;   r&   r   r   r   r	   r
      s    
$r
   )__doc__r!   distutils.corer   distutils.errorsdistutils.sysconfigr   	distutilsr   r   r
   r   r   r   r	   <module>   s   