U
ifV @ sP d dl Z d dlmZ d dlT d dlmZ d dlmZ dd ZG dd d eZ dS )
N)Command)*)customize_compiler)logc C s ddl 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 Zd ZdZdddddgZddgZd d
defgZdd
Zdd Z dd Z
dd Zdd Zdd Z
dd Zd
S )
build_clibz/build C/C++ libraries used by Python extensions)zbuild-clib=bz%directory to build C/C++ libraries to)zbuild-temp=tz,directory to put temporary build by-products)debuggz"compile with debugging information)forcefz2forcibly build everything (ignore file timestamps))z compiler=czspecify the compiler typer r z
help-compilerNzlist available compilersc C s: d | _ d | _d | _d | _d | _d | _d | _d| _d | _d S )Nr ) r
build_temp librariesinclude_dirsdefineundefr r compilerselfr r r
initialize_options4 s zbuild_clib.initialize_optionsc C sh | dddddd | jj| _| jr0| | j | jd krH| jjpDg | _t| jtrd| jtj | _d S )NZbuild)r r )r r )r r )r r )r r )
Zset_undefined_optionsZdistributionr check_library_listr
isinstancestrsplitospathsepr r r r
finalize_optionsD s
zbuild_clib.finalize_optionsc C s | j s
d S ddlm} || j| j| jd| _t| j | jd k rN| j| j | j d k rv| j D ]\}}| j
|| q^| jd k r| jD ]}| j| q|
| j d S )Nr )new_compiler)r dry_runr )r r r# r r$ r r r Zset_include_dirsr Zdefine_macror Zundefine_macrobuild_libraries)r r# namevalueZmacror r r
run^ s"
zbuild_clib.runc C s t |tstd|D ]z}t |ts8t|dkr8td|\}}t |tsRtdd|ksntjdkr~tj|kr~td|d t |tstdqd 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 listDistutilsSetupErrortuplelenr r sepdict)r r libr&