
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
U
    ¡ê,aV  ã                   @   sP   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 )
é    N)ÚCommand)Ú*)Úcustomize_compiler)Úlogc                  C   s   ddl m}  | ƒ  d S )Nr   ©Úshow_compilers)Údistutils.ccompilerr   r   © r	   úA/opt/alt/python38/lib64/python3.8/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 )NZbuild)r   r   )r   r   )r   r   )r   r   )r   r   )
Zset_undefined_optionsZdistributionr   Úcheck_library_listr   Ú
isinstanceÚstrÚsplitÚosÚpathsepr   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	rv| j	D ]\}}| j 
||¡ q^| jd k	r˜| jD ]}| j |¡ q†|  | 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ƒ‚|D ]z}t |tƒs8t|ƒdkr8tdƒ‚|\}}t |tƒsRtdƒ‚d|ksntjdkr~tj|kr~td|d  ƒ‚t |tƒstdƒ‚qd S )	Nz+'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))	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   s,   | j s
d S g }| j D ]\}}| |¡ q|S )N)r   Úappend)r   Z	lib_namesÚlib_namer2   r	   r	   r
   Úget_library_namesš   s    zbuild_clib.get_library_namesc                 C   sZ   |   | j¡ g }| jD ]>\}}| d¡}|d ks>t|ttfƒsJtd| ƒ‚| |¡ q|S )NÚsourcesúfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames)r   r   Úgetr   r+   r-   r,   Úextend)r   Ú	filenamesr4   r2   r6   r	   r	   r
   Úget_source_files¦   s    
þÿzbuild_clib.get_source_filesc                 C   s˜   |D ]Ž\}}|  d¡}|d ks,t|ttfƒs8td| ƒ‚t|ƒ}t d|¡ |  d¡}|  d¡}| jj|| j	||| j
d�}| jj||| j| j
d� qd S )Nr6   r7   z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   r4   r2   r6   r<   r   Zobjectsr	   r	   r
   r%   µ   s,    
þÿ

ü	
þzbuild_clib.build_libraries)Ú__name__Ú
__module__Ú__qualname__ZdescriptionZuser_optionsZboolean_optionsr   Zhelp_optionsr   r"   r(   r   r5   r;   r%   r	   r	   r	   r
   r      s(   ÷ ÿÿ$r   )
r    Zdistutils.corer   Zdistutils.errorsZdistutils.sysconfigr   Z	distutilsr   r   r   r	   r	   r	   r
   Ú<module>   s   