ó
1,^c           @   s_   d  d l  j j Z d  d l m Z d  d l m Z d  d l m	 Z	 d e j f d „  ƒ  YZ d S(   iÿÿÿÿN(   t   DistutilsSetupError(   t   log(   t   newer_pairwise_groupt
   build_clibc           B   s   e  Z d  Z d „  Z RS(   sv  
    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   s4  x-| D]%\ } } | j  d ƒ } | d  k sD t | t t f ƒ rW t d | ƒ ‚ n  t | ƒ } t j d | ƒ | j  d t ƒ  ƒ } t | t ƒ sª t d | ƒ ‚ n  g  } | j  d t ƒ  ƒ } t | t t f ƒ sí t d | ƒ ‚ n  x{ | D]s } | g }	 |	 j	 | ƒ | j  | t ƒ  ƒ }
 t |
 t t f ƒ sMt d | ƒ ‚ n  |	 j	 |
 ƒ | j
 |	 ƒ qô W|  j j | d |  j ƒ} t | | ƒ g  g  f k r| j  d ƒ } | j  d	 ƒ } | j  d
 ƒ } |  j j | d |  j d | d	 | d | d |  j ƒ} n  |  j j | | d |  j d |  j ƒq Wd  S(   Nt   sourcessf   in 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenamess   building '%s' libraryt   obj_depss\   in 'libraries' option (library '%s'), 'obj_deps' must be a dictionary of type 'source: list't    t
   output_dirt   macrost   include_dirst   cflagst   extra_postargst   debug(   t   gett   Nonet
   isinstancet   listt   tupleR    R   t   infot   dictt   extendt   appendt   compilert   object_filenamest
   build_tempR   t   compileR   t   create_static_libR   (   t   selft	   librariest   lib_namet
   build_infoR   R   t   dependenciest   global_depst   sourcet   src_depst
   extra_depst   expected_objectsR   R	   R
   t   objects(    (    s<   lib/python2.7/site-packages/setuptools/command/build_clib.pyt   build_libraries   s`    "						(   t   __name__t
   __module__t   __doc__R&   (    (    (    s<   lib/python2.7/site-packages/setuptools/command/build_clib.pyR      s   (
   t   distutils.command.build_clibt   commandR   t   origt   distutils.errorsR    t	   distutilsR   t   setuptools.dep_utilR   (    (    (    s<   lib/python2.7/site-packages/setuptools/command/build_clib.pyt   <module>   s   