build_clib.pyc
1 o 2 6�Hc? � @ sL d dl m mZ d dlmZ d dlmZ d dlm Z G dd� dej�ZdS )� N)�DistutilsSetupError)�log)�newer_pairwise_groupc @ s e Zd ZdZdd� ZdS )� 3 build_clibav 4 Override the default build_clib behaviour to do the following: 5 6 1. Implement a rudimentary timestamp-based dependency system 7 so 'compile()' doesn't run every time. 8 2. Add more keys to the 'build_info' dictionary: 9 * obj_deps - specify dependencies for each object compiled. 10 this should be a dictionary mapping a key 11 with the source filename to a list of 12 dependencies. Use an empty string for global 13 dependencies. 14 * cflags - specify a list of additional flags to pass to 15 the compiler. 16 c C sn |D ]�\}}|� d�}|d u st|ttf�std| ��t|�}t�d|� |� dt� �}t|t�s8td| ��g }|� dt� �}t|ttf�sNtd| ��|D ](}|g} | �|� |� |t� �} 17 t| 18 ttf�sntd| ��| �| 19 � |� | � qP| j 20 j|| jd�}t ||�g g fkr�|� d�}|� d �} |� d 21 �}| j 22 j|| j|| || jd� | j 23 j||| j| jd� qd 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'� )� 24 output_dir�macros�include_dirs�cflags)r r 25 r �extra_postargs�debug)r r )�get� 26 isinstance�list�tupler r �info�dict�extend�append�compiler�object_filenames� 27 build_tempr �compiler �create_static_libr )�self� libraries�lib_name� 28 build_infor r �dependenciesZglobal_deps�sourceZsrc_depsZ 29 extra_depsZexpected_objectsr 30 r r � r"