a
´iV ã @ sP d dl Z d dlmZ d dlT d dlmZ d dlmZ dd„ ZG dd „ d eƒZ dS )
é N)ÚCommand)Ú*)Úcustomize_compiler)Úlogc C s ddl m} | ƒ d S )Nr ©Úshow_compilers)Údistutils.ccompilerr r © r ú4/usr/lib64/python3.9/distutils/command/build_clib.pyr s r c @ sf e Zd ZdZg d¢ZddgZdddefgZdd „ Zd
d„ Z dd
„ Z
dd„ Zdd„ Zdd„ Z
dd„ ZdS )Ú
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)ÚdebugÚgz"compile with debugging information)ÚforceÚfz2forcibly 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Ú librariesÚinclude_dirsÚdefineÚundefr r Úcompiler©Úselfr r r
Úinitialize_options4 s zbuild_clib.initialize_optionsc C sh | dddddd¡ | jj| _| jr0| | j¡ | jd u rH| jjpDg | _t| jtƒrd| j tj ¡| _d S )NZbuild)r r )r r )r r )r r )r r )
Zset_undefined_optionsZdistributionr Úcheck_library_listr Ú
isinstanceÚstrÚsplitÚosÚpathsepr r r r
Úfinalize_optionsD s û
zbuild_clib.finalize_optionsc C s¨ | j s
d S ddlm} || j| j| jd�| _t| jƒ | jd urN| j | j¡ | j d urv| j D ]\}}| j
||¡ q^| jd ur˜| 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_macroÚbuild_libraries)r r# ÚnameÚvalueZmacror r r
Úrun^ s" þ
zbuild_clib.runc C s– t |tƒstdƒ‚|D ]z}t |tƒs8t|ƒdkr8tdƒ‚|\}}t |tƒsRtdƒ‚d|v sntjdkr~tj|v r~td|d ƒ‚t |tƒstdƒ‚qd 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&