3
Ävh„ ã @ sF d dl jjZd dlmZ d dlmZ d dlm Z G dd„ dejƒZdS )é N)ÚDistutilsSetupError)Úlog)Únewer_pairwise_groupc @ s e Zd ZdZdd„ ZdS )Ú
build_clibav
Override the default build_clib behaviour to do the following:
1. Implement a rudimentary timestamp-based dependency system
so 'compile()' doesn't run every time.
2. Add more keys to the 'build_info' dictionary:
* obj_deps - specify dependencies for each object compiled.
this should be a dictionary mapping a key
with the source filename to a list of
dependencies. Use an empty string for global
dependencies.
* cflags - specify a list of additional flags to pass to
the compiler.
c C s~ �xv|D �]l\}}|j dƒ}|d ks4t|ttfƒ r@td| ƒ‚t|ƒ}tjd|ƒ |j dtƒ ƒ}t|tƒsxtd| ƒ‚g }|j dtƒ ƒ}t|ttfƒs¤td| ƒ‚xX|D ]P}|g} | j|ƒ |j |tƒ ƒ}
t|
ttfƒsætd| ƒ‚| j|
ƒ |j | ƒ qªW | j
j|| jd�}t
||ƒg g fk�r^|j dƒ}|j d ƒ}
|j d
ƒ}| j
j|| j||
|| jd�}| j
j||| j| jd� qW d S )
NÚsourceszfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenameszbuilding '%s' libraryÚobj_depsz\in 'libraries' option (library '%s'), 'obj_deps' must be a dictionary of type 'source: list'Ú )Ú
output_dirÚmacrosÚinclude_dirsÚcflags)r r
r Zextra_postargsÚdebug)r r
)ÚgetÚ
isinstanceÚlistÚtupler r ÚinfoÚdictÚextendÚappendZcompilerZobject_filenamesZ
build_tempr Úcompiler
Zcreate_static_libr )ÚselfZ librariesZlib_nameZ
build_infor r ZdependenciesZglobal_depsÚsourceZsrc_depsZ
extra_depsZexpected_objectsr
r r Zobjects© r ú /usr/lib/python3.6/build_clib.pyÚbuild_libraries s`
zbuild_clib.build_librariesN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r r r r r r s r )
Zdistutils.command.build_clibZcommandr ZorigZdistutils.errorsr Z distutilsr Zsetuptools.dep_utilr r r r r Ú