ó
!Æ^c           @   s‡   d  Z  d d l m Z m Z d d l m Z d „  Z d „  Z d „  Z e d „  ƒ Z	 e d „  ƒ Z
 e d	 „  ƒ Z e d
 „  ƒ Z d S(   s)   base for all c/c++ programs and librariesiÿÿÿÿ(   t   Utilst   Errors(   t   confc         C   s]   g  } xP t  j |  ƒ D]? } t | t ƒ s7 | j } n  | j | | j d ƒ d ƒ q W| S(   sØ   
	Returns the file extensions for the list of files given as input

	:param lst: files to process
	:list lst: list of string or :py:class:`waflib.Node.Node`
	:return: list of file extensions
	:rtype: list of string
	t   .i   (   R    t   to_listt
   isinstancet   strt   namet   appendt   rfind(   t   lstt   rett   x(    (    s9   /git_repos/PolyLV2/poly_mclk_in/waflib/Tools/c_aliases.pyt   get_extensions
   s    	"c          K   s�  t  |  d ƒ } |  d } g  } x1 d j ƒ  D]# } | | k r- | j d ƒ Pq- q- Wd | k sx d | k sx d | k rˆ | j d ƒ n  d | k s  d	 | k r° | j d
 ƒ n  x1 d j ƒ  D]# } | | k r½ | j d ƒ Pq½ q½ Wd | k r | j d ƒ n  d | k r| j d ƒ d S| d k r™t } x4 | D], } | d k r6| j | | ƒ t } q6q6W| r™|  j d g  ƒ r™t j d |  ƒ ‚ q™n  | S(   s  
	Computes and returns the features required for a task generator by
	looking at the file extensions. This aimed for C/C++ mainly::

		snif_features(source=['foo.c', 'foo.cxx'], type='shlib')
		# returns  ['cxx', 'c', 'cxxshlib', 'cshlib']

	:param source: source files to process
	:type source: list of string or :py:class:`waflib.Node.Node`
	:param type: object type in *program*, *shlib* or *stlib*
	:type type: string
	:return: the list of features for a task generator processing the source files
	:rtype: list of string
	t   sourcet   typs   cxx cpp c++ cc Ct   cxxt   ct   valat   gst   st   St   asms   f f90 F F90 for FORt   fct   dt   javat   programt   shlibt   stlibt   featuress;   Cannot link from %r, try passing eg: features="c cprogram"?(   R   R   R   (   R   R   R   R   R   (   R   t   splitR   t   Falset   Truet   getR   t   WafError(   t   kwt   extsR   t   featsR   t	   will_link(    (    s9   /git_repos/PolyLV2/poly_mclk_in/waflib/Tools/c_aliases.pyt   sniff_features   s:    
$c         C   s@   | |  d <t  j |  j d g  ƒ ƒ t  j t |  �  ƒ |  d <d S(   sÏ   
	Inserts data in the input dict *kw* based on existing data and on the type of target
	required (typ).

	:param kw: task generator parameters
	:type kw: dict
	:param typ: type of target
	:type typ: string
	R   R   N(   R    R   R!   R'   (   R#   R   (    (    s9   /git_repos/PolyLV2/poly_mclk_in/waflib/Tools/c_aliases.pyt   set_featuresN   s    

c         O   s   t  | d ƒ |  | | Ž  S(   sÖ   
	Alias for creating programs by looking at the file extensions::

		def build(bld):
			bld.program(source='foo.c', target='app')
			# equivalent to:
			# bld(features='c cprogram', source='foo.c', target='app')

	R   (   R(   (   t   bldt   kR#   (    (    s9   /git_repos/PolyLV2/poly_mclk_in/waflib/Tools/c_aliases.pyR   [   s    c         O   s   t  | d ƒ |  | | Ž  S(   sÚ   
	Alias for creating shared libraries by looking at the file extensions::

		def build(bld):
			bld.shlib(source='foo.c', target='app')
			# equivalent to:
			# bld(features='c cshlib', source='foo.c', target='app')

	R   (   R(   (   R)   R*   R#   (    (    s9   /git_repos/PolyLV2/poly_mclk_in/waflib/Tools/c_aliases.pyR   i   s    c         O   s   t  | d ƒ |  | | Ž  S(   sâ   
	Alias for creating static libraries by looking at the file extensions::

		def build(bld):
			bld.stlib(source='foo.cpp', target='app')
			# equivalent to:
			# bld(features='cxx cxxstlib', source='foo.cpp', target='app')

	R   (   R(   (   R)   R*   R#   (    (    s9   /git_repos/PolyLV2/poly_mclk_in/waflib/Tools/c_aliases.pyR   w   s    c         O   s   t  | d ƒ |  | | Ž  S(   sÑ   
	Alias for creating object files by looking at the file extensions::

		def build(bld):
			bld.objects(source='foo.c', target='app')
			# equivalent to:
			# bld(features='c', source='foo.c', target='app')

	t   objects(   R(   (   R)   R*   R#   (    (    s9   /git_repos/PolyLV2/poly_mclk_in/waflib/Tools/c_aliases.pyR+   …   s    N(   t   __doc__t   waflibR    R   t   waflib.ConfigureR   R   R'   R(   R   R   R   R+   (    (    (    s9   /git_repos/PolyLV2/poly_mclk_in/waflib/Tools/c_aliases.pyt   <module>   s   		4	