
;>"^§  ã               @   s­   d  Z  d d l m Z m Z m Z d d l Z d d l Z d d l m Z	 e j
 d d k rc e Z e j d e j ƒ j Z e j d e j ƒ j Z Gd d	 „  d	 e	 ƒ Z d S)
zŒdistutils.extension

Provides the Extension class, used to describe C/C++ extension
modules in setup scripts.

Overridden to support f2py.

é    )ÚdivisionÚabsolute_importÚprint_functionN)Ú	Extensioné   z.*[.](cpp|cxx|cc)\Zz".*[.](f90|f95|f77|for|ftn|f|pyf)\Zc               @   sm   e  Z d  Z d Z d d d d d d d d d d d d d d d d d d d „ Z d d „  Z d d „  Z d S)	r   a  
    Parameters
    ----------
    name : str
        Extension name.
    sources : list of str
        List of source file locations relative to the top directory of
        the package.
    extra_compile_args : list of str
        Extra command line arguments to pass to the compiler.
    extra_f77_compile_args : list of str
        Extra command line arguments to pass to the fortran77 compiler.
    extra_f90_compile_args : list of str
        Extra command line arguments to pass to the fortran90 compiler.
    Nc             C   s  t  j |  | g  d | d | d | d | d | d | d |	 d |
 d	 | d
 | ƒ
| |  _ | pa g  |  _ t |  j t ƒ r³ d d  l } d } | j | t d d ƒ|  j j	 ƒ  |  _ | p¼ g  |  _
 | |  _ | pÔ g  |  _ | pã g  |  _ | pò g  |  _ | pg  |  _ d  S)NÚinclude_dirsÚdefine_macrosÚundef_macrosÚlibrary_dirsÚ	librariesÚruntime_library_dirsÚextra_objectsÚextra_compile_argsÚextra_link_argsÚexport_symbolsr   z4swig_opts is specified as a string instead of a listÚ
stacklevelé   )Úold_ExtensionÚ__init__ÚsourcesÚ	swig_optsÚ
isinstanceÚ
basestringÚwarningsÚwarnÚSyntaxWarningÚsplitÚdependsÚlanguageÚf2py_optionsÚmodule_dirsÚextra_f77_compile_argsÚextra_f90_compile_args)ÚselfÚnamer   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r   Úmsg© r&   úK/home/birch/.local/lib/python3.5/site-packages/numpy/distutils/extension.pyr   '   s4    		zExtension.__init__c             C   s.   x' |  j  D] } t t | ƒ ƒ r
 d Sq
 Wd S)NTF)r   Ú
cxx_ext_reÚstr)r#   Úsourcer&   r&   r'   Úhas_cxx_sourcesa   s    zExtension.has_cxx_sourcesc             C   s(   x! |  j  D] } t | ƒ r
 d Sq
 Wd S)NTF)r   Úfortran_pyf_ext_re)r#   r*   r&   r&   r'   Úhas_f2py_sourcesg   s    zExtension.has_f2py_sources)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r+   r-   r&   r&   r&   r'   r      s(   (r   )r1   Ú
__future__r   r   r   ÚsysÚreÚdistutils.extensionr   r   Úversion_infor)   r   ÚcompileÚIÚmatchr(   r,   r&   r&   r&   r'   Ú<module>   s   