ó
¨9Vc           @   sý   d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d d l m Z d d l	 m
 Z
 e e j j  Z e
 j   d   Z e Z d e f d     YZ d e f d	     YZ e e j _ e e j _ d
 e  j k rů e e  j d
 _ n  d S(   i˙˙˙˙Ni   (   t   _get_unpatched(   t   msvc9_supportc          C   s<   d }  y t  |  d d g j t SWn t k
 r7 n Xt S(   s0   
    Return True if Cython can be imported.
    s   Cython.Distutils.build_extt   fromlistt	   build_ext(   s   Cython.Distutils.build_ext(   t
   __import__R   t   Truet	   Exceptiont   False(   t   cython_impl(    (    s8   /tmp/pip-build-5Z5nTX/setuptools/setuptools/extension.pyt   _have_cython   s    t	   Extensionc           B   s   e  Z d  Z d   Z RS(   s7   Extension that uses '.c' files in place of '.pyx' filesc         C   sq   t    r d S|  j p d } | j   d k r4 d n d } t j t j d |  } t t | |  j	   |  _	 d S(   sÜ   
        Replace sources with .pyx extensions to sources with the target
        language extension. This mechanism allows language authors to supply
        pre-converted sources but to prefer the .pyx sources.
        Nt    s   c++s   .cpps   .cs   .pyx$(
   R	   t   languaget   lowert	   functoolst   partialt   ret   subt   listt   mapt   sources(   t   selft   langt
   target_extR   (    (    s8   /tmp/pip-build-5Z5nTX/setuptools/setuptools/extension.pyt   _convert_pyx_sources_to_lang#   s    	(   t   __name__t
   __module__t   __doc__R   (    (    (    s8   /tmp/pip-build-5Z5nTX/setuptools/setuptools/extension.pyR
       s   t   Libraryc           B   s   e  Z d  Z RS(   s=   Just like a regular Extension, but built as a library instead(   R   R   R   (    (    (    s8   /tmp/pip-build-5Z5nTX/setuptools/setuptools/extension.pyR   1   s   s   distutils.command.build_ext(   t   sysR   R   t   distutils.coret	   distutilst   distutils.errorst   distutils.extensiont   distR    R   R   t   coreR
   t
   _Extensiont   patch_for_specialized_compilerR	   t
   have_pyrexR   t	   extensiont   modules(    (    (    s8   /tmp/pip-build-5Z5nTX/setuptools/setuptools/extension.pyt   <module>   s"   
	