Ñò
 „Pc           @   sÁ  d  Z  d d k Z d d k Z d d k Z d d k l Z l Z l Z l Z l	 Z	 l
 Z
 e i e ƒ Z d e f d „  ƒ  YZ d e e d g  g  g  g  e e e e d „ Z d	 „  Z d
 „  Z d „  Z e Z d „  Z e Z d „  Z e e d „ ƒ Z e d ƒ d „  ƒ Z e d ƒ e d ƒ d „  ƒ ƒ Z e d ƒ d „  ƒ Z e i d e i ƒ Z  d e i f d „  ƒ  YZ! e d ƒ d „  ƒ Z" d e! f d „  ƒ  YZ# e d ƒ e d d ƒ d „  ƒ ƒ Z$ d S(   s*  
Task generators

The class :py:class:`waflib.TaskGen.task_gen` encapsulates the creation of task objects (low-level code)
The instances can have various parameters, but the creation of task nodes (Task.py)
is always postponed. To achieve this, various methods are called from the method "apply"


iÿÿÿÿN(   t   Taskt   Utilst   Logst   Errorst	   ConfigSett   Nodet   task_genc           B   s’   e  Z d  Z h  Z e i e ƒ Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z e e e ƒ Z d „  Z d „  Z d „  Z d d d	 „ Z d
 „  Z RS(   s#  
	Instances of this class create :py:class:`waflib.Task.TaskBase` when
	calling the method :py:meth:`waflib.TaskGen.task_gen.post` from the main thread.
	A few notes:

	* The methods to call (*self.meths*) can be specified dynamically (removing, adding, ..)
	* The 'features' are used to add methods to self.meths and then execute them
	* The attribute 'path' is a node representing the location of the task generator
	* The tasks created are added to the attribute *tasks*
	* The attribute 'idx' is a counter of task generators in the same path
	c         O   sa  d |  _  d |  _ g  |  _ t i t ƒ |  _ h  |  _ g  |  _ g  |  _	 d | j o% t
 i
 ƒ  |  _ d |  _ d |  _ n· | d |  _ |  i i i ƒ  |  _ |  i i |  _ yC |  i i i t |  i ƒ d ƒ d |  _ |  i i t |  i ƒ <Wn? t j
 o3 h  |  i _ d |  _ |  i i t |  i ƒ <n Xx* | i ƒ  D] \ } } t |  | | ƒ q=Wd S(   sÎ  
		The task generator objects predefine various attributes (source, target) for possible
		processing by process_rule (make-like rules) or process_source (extensions, misc methods)

		The tasks are stored on the attribute 'tasks'. They are created by calling methods
		listed in self.meths *or* referenced in the attribute features
		A topological sort is performed to ease the method re-use.

		The extra key/value elements passed in kw are set as attributes
		t    t   bldi    i   N(   t   sourcet   targett   methsR   t   defaultdictt   listt   prect   mappingst   featurest   tasksR   t   envt   idxt   Nonet   pathR   t   derivet   gett   idt   AttributeErrort   itemst   setattr(   t   selft   kt   kwt   keyt   val(    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   __init__%   s,    							C% c         C   s   d |  i  |  i i ƒ  f S(   s   for debugging purposess   <task_gen %r declared in %s>(   t   nameR   t   abspath(   R   (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   __str__c   s    c         C   sw   g  } xN |  i  i ƒ  D]= } | d j o* | i d | t t |  | ƒ ƒ f ƒ q q Wd d i | ƒ |  i i ƒ  f S(	   s   for debugging purposesR   R   t   compiled_tasksR   s   %s=%ss   bld(%s) in %ss   , (   s   envs   bldR%   s   tasks(   t   __dict__t   keyst   appendt   reprt   getattrt   joinR   R#   (   R   t   lstt   x(    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   __repr__g   s     .c         C   s“   y |  i  SWn t j
 ou t |  i t ƒ oD g  } |  i D] } | t | ƒ q= ~ } d i | ƒ } |  _  n t |  i ƒ } |  _  | SXd S(   sê   
		If not set, the name is computed from the target name::

			def build(bld):
				x = bld(name='foo')
				x.get_name() # foo
				y = bld(target='bar')
				y.get_name() # bar

		:rtype: string
		:return: name of this task generator
		t   ,N(   t   _nameR   t
   isinstanceR
   R   t   strR+   (   R   t   _[1]R-   R,   R"   (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   get_nameo   s    *c         C   s   | |  _  d  S(   N(   R0   (   R   R"   (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   set_name…   s    c         C   s#   t  | t ƒ o | i ƒ  S| Sd S(   s…   
		Ensure that a parameter is a list

		:type val: string or list of string
		:param val: input to return as a list
		:rtype: list
		N(   R1   R2   t   split(   R   R    (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   to_listŠ   s     c         C   sÓ  t  |  d d	 ƒ o t St |  _ t |  i ƒ } t i |  i	 ƒ |  _	 xe |  i	 d g D]S } t
 | } | p) | t i j o t i d | ƒ q– n | i t | ƒ ƒ qV Wh  } |  i p t i } x- | D]% } | | j o | | | | <qÍ qÍ Wg  } xD | D]< } x3 | i ƒ  D] } | | j o PqqW| i | ƒ qW| i ƒ  g  } x¦ | ož | i ƒ  }	 |	 | j o | i |	 ƒ n y | |	 }
 Wn t j
 o qVX| |	 =xB |
 D]: } x1 | D] } | | | j o PqÆqÆW| i | ƒ q¹WqVW| o t i d | ƒ ‚ n | i ƒ  | |  _ t i d |  t |  ƒ f ƒ xn | D]f } y t  |  | ƒ } Wn& t j
 o t i d | ƒ ‚ n Xt i d | t |  ƒ f ƒ | ƒ  qQWt i d |  i ƒ t S(
   sÎ  
		Create task objects. The following operations are performed:

		#. The body of this method is called only once and sets the attribute ``posted``
		#. The attribute ``features`` is used to add more methods in ``self.meths``
		#. The methods are sorted by the precedence table ``self.prec`` or `:waflib:attr:waflib.TaskGen.task_gen.prec`
		#. The methods are then executed in order
		#. The tasks created are added to :py:attr:`waflib.TaskGen.task_gen.tasks`
		t   postedt   *s:   feature %r does not exist - bind at least one method to its)   Cycle detected in the method execution %rs   task_gen: posting %s %ds'   %r is not a valid task generator methods   task_gen: -> %s (%d)s   task_gen: posted %sN(   R*   R   t   Falset   TrueR8   t   setR   R   R7   R   t   featsR    t   classesR   t   warnt   updateR   R   R   t   valuesR(   t   sortt   popt   KeyErrorR   t   WafErrort   reverset   debugR   R   R"   (   R   R'   R-   t   stR   t   prec_tblt   tmpt   at   outt   et   nlstt   yt   v(    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   post•   sx    	 
    	
    	
	 c         C   s   | i  } x- |  i D]" } | i | ƒ o |  i | Sq Wx- t i D]" } | i | ƒ o t i | SqC Wt i d | t i i ƒ  f ƒ ‚ d S(   s»   
		:param node: Input file to process
		:type node: :py:class:`waflib.Tools.Node.Node`
		:return: A method able to process the input node by looking at the extension
		:rtype: function
		sA   File %r has no mapping in %r (did you forget to load a waf tool?)N(   R"   R   t   endswithR   R   RE   R'   (   R   t   nodeR"   R   (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   get_hookæ   s    	
 
 c         C   si   t  i | d |  i i ƒ  d |  ƒ } | o | i | ƒ n | o | i | ƒ n |  i i | ƒ | S(   s°  
		Wrapper for creating task instances. The classes are retrieved from the
		context class if possible, then from the global dict Task.classes.

		:param name: task class name
		:type name: string
		:param src: input nodes
		:type src: list of :py:class:`waflib.Tools.Node.Node`
		:param tgt: output nodes
		:type tgt: list of :py:class:`waflib.Tools.Node.Node`
		:return: A task object
		:rtype: :py:class:`waflib.Task.TaskBase`
		R   t	   generator(   R    R>   R   R   t
   set_inputst   set_outputsR   R(   (   R   R"   t   srct   tgtt   task(    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   create_taskö   s    %c         C   sÉ   |  i  ƒ  } xq |  i D]f } | d j o q q | d j o t | | t |  | ƒ ƒ q t | | t i t |  | ƒ ƒ ƒ q Wt | _ t | t ƒ o |  i  i	 | i
 ƒ  | _ n | i
 ƒ  | _ | S(   sf  
		Make a copy of a task generator. Once the copy is made, it is necessary to ensure that the
		it does not create the same output files as the original, or the same files may
		be compiled several times.

		:param env: A configuration set
		:type env: :py:class:`waflib.ConfigSet.ConfigSet`
		:return: A copy
		:rtype: :py:class:`waflib.TaskGen.task_gen`
		R   R   R   R   (   s   envs   bld(   s   paths   features(   R   R&   R   R*   t   copyR:   R8   R1   R2   t   all_envsR   R   (   R   R   t   newobjR-   (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   clone  s    
 &	N(   t   __name__t
   __module__t   __doc__R   R   R   R   R   R!   R$   R.   R4   R5   t   propertyR"   R7   RQ   RT   R   R[   R_   (    (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyR      s   	>						Q	R   t   BLUEc            s®   t  i ˆ ƒ ‰ t  i | ƒ } ˆ p
 | ‰ n t i ˆ | d | d ˆ d | d | d | d |	 d | ƒ‰ ‡  ‡ ‡ ‡ ‡ ‡ f d †  } x ˆ i D] } | t i | <q“ W| S(	   s  
	Create a new mapping and a task class for processing files by extension.
	See Tools/flex.py for an example.

	:param name: name for the task class
	:type name: string
	:param rule: function to execute or string to be compiled in a function
	:type rule: string or function
	:param reentrant: re-inject the output file in the process (done automatically, set to 0 to disable)
	:type reentrant: int
	:param color: color for the task output
	:type color: string
	:param ext_in: execute the task only after the files of such extensions are created
	:type ext_in: list of string
	:param ext_out: execute the task only before files of such extensions are processed
	:type ext_out: list of string
	:param before: execute instances of this task before classes of the given names
	:type before: list of string
	:param after: execute instances of this task after classes of the given names
	:type after: list of string
	:param decider: if present, use it to create the output nodes for the task
	:type decider: function
	:param scan: scanner function for the task
	:type scan: function
	:param install_path: installation path for the output nodes
	:type install_path: string
	t   colort   ext_int   ext_outt   beforet   aftert   scant   shellc   
         sN  ˆ  o ˆ  |  | ƒ p ˆ i  } ˆ o ˆ d } n |  i ˆ | ƒ } d } t |  i i ƒ  ƒ t |  i i i ƒ  ƒ } x® | D]¦ } | i | d | ƒ} | i i | ƒ ˆ d  j o+ | t
 ˆ ƒ j  o |  i i | ƒ qn: x6 | D]. }	 | i i |	 ƒ o |  i i | ƒ Pqé qé W| d 7} q Wˆ o |  i i ˆ | i ƒ n | S(   Ni    Rf   i   (   Rg   R[   R   R   R'   t	   __class__t
   change_extt   outputsR(   R   t   intR	   R"   RR   R   t   install_files(
   R   RS   t   extt   _ext_int   tskt   cntR'   R-   R   RO   (   t   deciderR"   t	   reentrantRf   t   install_patht   cls(    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   x_fileK  s,     +  	(   R   R7   R    t   task_factoryRf   R   R   (   R"   t   ruleRv   Re   Rf   Rg   Rh   Ri   Ru   Rj   Rw   Rk   Ry   R-   (    (   Ru   R"   Rw   Rv   Rx   Rf   s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   declare_chain(  s    
<
 c         C   s   t  t |  i |  ƒ |  S(   s-  
	Decorator: register a method as a task generator method.
	The function must accept a task generator as first parameter::

		from waflib.TaskGen import taskgen_method
		@taskgen_method
		def mymethod(self):
			pass

	:param func: task generator method to add
	:type func: function
	:rtype: function
	(   R   R   R`   (   t   func(    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   taskgen_methodj  s    c             s   ‡  f d †  } | S(   sc  
	Decorator: register a task generator method that will be executed when the
	object attribute 'feature' contains the corresponding key(s)::

		from waflib.Task import feature
		@feature('myfeature')
		def myfunction(self):
			print('that is my feature!')
		def build(bld):
			bld(features='myfeature')

	:param k: feature names
	:type k: list of string
	c            s?   t  t |  i |  ƒ x% ˆ  D] } t | i |  i g ƒ q W|  S(   N(   R   R   R`   R=   R@   (   R}   R"   (   R   (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   decoŠ  s
     (    (   R   R   (    (   R   s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   feature{  s    c             s   ‡  f d †  } | S(   s™  
	Decorator: register a task generator method which will be executed
	before the functions of given name(s)::

		from waflib.TaskGen import feature, before
		@feature('myfeature')
		@before_method('fun2')
		def fun1(self):
			print('feature 1!')
		@feature('myfeature')
		def fun2(self):
			print('feature 2!')
		def build(bld):
			bld(features='myfeature')

	:param k: method names
	:type k: list of string
	c            sZ   t  t |  i |  ƒ x@ ˆ  D]8 } |  i t i | j o t i | i |  i ƒ q q W|  S(   N(   R   R   R`   R   R(   (   R}   t   fun_name(   R   (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyR   ¤  s     (    (   R   R   (    (   R   s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   before_method‘  s    c             s   ‡  f d †  } | S(   s–  
	Decorator: register a task generator method which will be executed
	after the functions of given name(s)::

		from waflib.TaskGen import feature, after
		@feature('myfeature')
		@after_method('fun2')
		def fun1(self):
			print('feature 1!')
		@feature('myfeature')
		def fun2(self):
			print('feature 2!')
		def build(bld):
			bld(features='myfeature')

	:param k: method names
	:type k: list of string
	c            sZ   t  t |  i |  ƒ x@ ˆ  D]8 } | t i |  i j o t i |  i i | ƒ q q W|  S(   N(   R   R   R`   R   R(   (   R}   R   (   R   (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyR   Á  s     (    (   R   R   (    (   R   s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   after_method®  s    c             s   ‡  f d †  } | S(   sw  
	Decorator: register a task generator method which will be invoked during
	the processing of source files for the extension given::

		from waflib import Task
		class mytask(Task):
			run_str = 'cp ${SRC} ${TGT}'
		@extension('.moo')
		def create_maa_file(self, node):
			self.create_task('mytask', node, node.change_ext('.maa'))
		def build(bld):
			bld(source='foo.moo')
	c            s5   t  t |  i |  ƒ x ˆ  D] } |  t i | <q W|  S(   N(   R   R   R`   R   (   R}   R-   (   R   (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyR   Ù  s
     (    (   R   R   (    (   R   s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt	   extensionË  s    c         C   s·   g  } | p |  i  } | i } t | |  i  i ƒ o | g } n xn t i | ƒ D]] } t | t ƒ o | | ƒ } n | } | p t i d | |  f ƒ ‚ n | i	 | ƒ qR W| S(   sý  
	Convert the input list into a list of nodes.
	It is used by :py:func:`waflib.TaskGen.process_source` and :py:func:`waflib.TaskGen.process_rule`.
	It is designed for source files, for folders, see :py:func:`waflib.Tools.ccroot.to_incnodes`:

	:param lst: input list
	:type lst: list of string and nodes
	:param path: path from which to search the nodes (by default, :py:attr:`waflib.TaskGen.task_gen.path`)
	:type path: :py:class:`waflib.Tools.Node.Node`
	:rtype: list of :py:class:`waflib.Tools.Node.Node`
	s   source not found: %r in %r(
   R   t   find_resourceR1   Rl   R   R7   R2   R   RE   R(   (   R   R,   R   RJ   t   findR-   RS   (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   to_nodesä  s    	 R9   c         C   sL   |  i  t |  d g  ƒ ƒ |  _ x' |  i D] } |  i | ƒ |  | ƒ q( Wd S(   s0  
	Process each element in the attribute ``source`` by extension.

	#. The *source* list is converted through :py:meth:`waflib.TaskGen.to_nodes` to a list of :py:class:`waflib.Node.Node` first.
	#. File extensions are mapped to methods having the signature: ``def meth(self, node)`` by :py:meth:`waflib.TaskGen.extension`
	#. The method is retrieved through :py:meth:`waflib.TaskGen.task_gen.get_hook`
	#. When called, the methods may modify self.source to append more source to process
	#. The mappings can map an extension or a filename (see the code below)
	R	   N(   R‡   R*   R	   RT   (   R   RS   (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   process_source  s    
 Rˆ   c         C   s‚  t  |  d d ƒ p d St t  |  d d ƒ p |  i p |  i ƒ } y |  i i } Wn# t j
 o h  } |  i _ n Xd } t  |  d d ƒ o1 y | | |  i f } WqÄ t j
 o qÄ Xn | pUt	 i
 | |  i t  |  d g  ƒ d t  |  d t ƒ d t  |  d d	 ƒ d
 t  |  d
 d ƒ ƒ} t  |  d
 d ƒ o |  i | _ n* t  |  d d ƒ o d „  } | | _ n t  |  d d ƒ o t	 i | ƒ n t  |  d d ƒ o t	 i | ƒ n x6 d d d d g D]" } t | | t  |  | g  ƒ ƒ qÌWt  |  d d ƒ o | | | |  i f <q n |  i | ƒ } t  |  d d ƒ oä t |  i t ƒ o |  i i ƒ  |  _ n t |  i t ƒ p |  i g |  _ n x^ |  i D]S } t | t ƒ o  | i i |  i i | ƒ ƒ q›| i i ƒ  | i i | ƒ q›Wt  |  d d ƒ o |  i i |  i | i ƒ q&n t  |  d d ƒ o" |  i |  i ƒ | _ g  |  _ n t  |  d d ƒ o |  i | _ n d S(   s¿   
	Process the attribute ``rule``. When present, :py:meth:`waflib.TaskGen.process_source` is disabled::

		def build(bld):
			bld(rule='cp ${SRC} ${TGT}', source='wscript', target='bar.txt')
	R{   NR"   t
   cache_ruleR;   t   varsRk   Re   Rd   Rj   t   depsc         S   s€   g  } xm |  i  i t |  i  d d  ƒ ƒ D]J } |  i  i i | ƒ } | p |  i  i i d | ƒ n | i | ƒ q( W| g  g S(   NR‹   s$   Could not find %r (was it declared?)(	   RU   R7   R*   R   R   R…   R   t   fatalR(   (   R   t   nodesR-   RS   (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyRj   5  s    " t   update_outputst   alwaysRi   Rh   Rf   Rg   R
   Rw   R	   t   cwd(    R*   R   R2   R
   R{   R   t   cache_rule_attrR   RD   R    Rz   R;   Rj   RŽ   t
   always_runR   R[   R1   R6   R   Rn   R(   R   t   find_or_declaret   parentt   mkdirRp   Rw   R‡   R	   t   inputsR   (   R   R"   t   cacheRx   Rj   R-   Rs   (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   process_rule  sf    	,	$	  
  !t   seqc         C   sÀ   |  i  o) |  i  d d j o |  i  i d ƒ d St |  d d ƒ o d St |  i d d ƒ oO |  i i i ƒ  x< |  i i i D]' } x |  i D] } | i | ƒ q‘ Wq Wn |  |  i _ d S(   sî  
	Add a strict sequential constraint between the tasks generated by task generators.
	It works because task generators are posted in order.
	It will not post objects which belong to other folders.

	Example::

		bld(features='javac seq')
		bld(features='jar seq')

	To start a new sequence, set the attribute seq_start, for example::

		obj = bld(features='seq')
		obj.seq_start = True

	Note that the method is executed in last position. This is more an
	example than a widely-used solution.
	iÿÿÿÿt   sequence_orderNt	   seq_startt   prev(	   R   R(   R*   R   R   Rœ   RQ   R   t   set_run_after(   R   R-   RO   (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyRš   g  s     
 s   @(\w+)@t   subst_pcc           B   s    e  Z d  Z d „  Z d „  Z RS(   sx   
	Create *.pc* files from *.pc.in*. The task is executed whenever an input variable used
	in the substitution changes.
	c            s)  t  |  i d d ƒ oi |  i d i |  i d i d ƒ d ƒ t  |  i d d ƒ o' t i |  i d i	 ƒ  |  i i ƒ n d S|  i d i d t  |  i d d ƒ ƒ } | i
 d	 d
 ƒ } g  ‰  ‡  f d †  } t i | | ƒ } y |  i i } Wn{ t j
 oo h  } xd ˆ  D]W } t  |  i | d ƒ p) |  i i | ƒ p |  i i | i ƒ  ƒ } t | ƒ | | <qWn X| | } |  i d i | d t  |  i d d ƒ ƒˆ  |  i i i |  i ƒ  <|  _ y t |  d ƒ Wn t j
 o n Xt  |  i d d ƒ o' t i |  i d i	 ƒ  |  i i ƒ n d S(   s#   Substitutes variables in a .in filet   is_copyi    t   rbt   wbt   chmodNt   encodings	   ISO8859-1t   %s   %%c            s<   |  i  } | d ƒ o" ˆ  i | d ƒ ƒ d | d ƒ Sd S(   Ni   s   %%(%s)sR   (   t   groupR(   (   t   matcht   g(   R,   (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   repl¤  s
    	R   t	   cache_sig(   R*   RU   R   Rn   t   writeR–   t   readt   osR¢   R#   t   replacet   re_m4t   subt   dctR   R   t   get_flatt   upperR2   R   t   raw_depst   uidt   dep_varst   delattr(   R   t   codeR¨   t   dR-   RJ   (    (   R,   s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   run”  s6    ''( A
)   c   	      C   s®   |  i  i } |  i } |  i i } |  i  i i i |  i ƒ  g  ƒ } | i | | ƒ } | | ƒ g  } | D] } | t	 |  i  | d ƒ qi ~ } | t
 i | ƒ ƒ |  i i ƒ  S(   sJ   
		Compute a hash (signature) of the variables used in the substitution
		R   (   RU   R   R   t   mR@   R³   R   R´   t   hash_env_varsR*   R   t   h_listt   digest(	   R   R   R   t   updRŠ   t   act_sigR3   R-   R,   (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   sig_vars¿  s    	!
0(   R`   Ra   Rb   R¹   RÀ   (    (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyRž   Ž  s   	+s   .pc.inc         C   sG   |  i  d | | i d d ƒ ƒ } |  i i t |  d d ƒ | i ƒ d S(   s«   
	Process *.pc.in* files to *.pc*. Install the results to ``${PREFIX}/lib/pkgconfig/``

		def build(bld):
			bld(source='foo.pc.in', install_path='${LIBDIR}/pkgconfig/')
	Rž   s   .pcs   .pc.inRw   s   ${LIBDIR}/pkgconfig/N(   R[   Rm   R   Rp   R*   Rn   (   R   RS   Rs   (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt
   add_pcfileÓ  s    !t   substc           B   s   e  Z RS(    (   R`   Ra   (    (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyRÂ   Þ  s   R˜   c      
   C   s9  t  i t |  d g  ƒ ƒ } t | t i ƒ o | g } n t  i t |  d g  ƒ ƒ } t | t i ƒ o | g } n t | ƒ t | ƒ j o t i d |  ƒ ‚ n x>t | | ƒ D]-\ } } | p | o t i d |  ƒ ‚ n d \ } } t | t
 ƒ o~ t | t
 ƒ on | | j oa |  i i | ƒ } |  i i ƒ  i | ƒ } t i i | i ƒ  ƒ p d | _ | i i ƒ  q	n‡ t | t
 ƒ o |  i i | ƒ } n t | t i ƒ o
 | } n t | t
 ƒ o |  i i | ƒ } n t | t i ƒ o
 | } n | p t i d | |  f ƒ ‚ n t } |  i d | | ƒ } xA d D]9 }	 t |  |	 d ƒ }
 |
 o t } t | |	 |
 ƒ qOqOW| oO | i i d ƒ o< g  } d D]! }	 |	 t i j o | |	 q²q²~ | _ q¶ q¶ Wt |  d d ƒ } | o, |  i  i! | | d t |  d t  i" ƒ ƒn g  |  _# d S(   sÌ  
	Define a transformation that substitutes the contents of *source* files to *target* files::

		def build(bld):
			bld(
				features='subst',
				source='foo.c.in',
				target='foo.c',
				install_path='${LIBDIR}/pkgconfig',
				VAR = 'val'
			)

	The input files are supposed to contain macros of the form *@VAR@*, where *VAR* is an argument
	of the task generator object.

	This method overrides the processing by :py:meth:`waflib.TaskGen.process_source`.
	R	   R
   s&   invalid number of source/target for %rs   null source or target for %rs   cound not find %r for %rRÂ   Ri   Rh   Rf   Rg   s   .ht   ct   cxxRw   R¢   N(   NN(   s   afters   befores   ext_ins   ext_out(   RÃ   RÄ   ($   R   R7   R*   R1   R   t   lenR   RE   t   zipR   R2   R   t	   find_nodet   get_bldt	   make_nodeR¬   t   isfileR#   t   sigR”   R•   R…   R“   R:   R[   R;   R   R"   RR   R    R>   Rh   R   Rp   t   O644R	   (   R   RX   RY   R-   RO   RK   t   bt   has_constraintsRs   R   R    R3   t   inst_to(    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   process_substá  sV     -	

 @,(%   Rb   R\   t   reR¬   t   waflibR    R   R   R   R   R   R   R<   R=   t   objectR   R   R:   R|   R~   R€   R‚   Rh   Rƒ   Ri   R„   R‡   Rˆ   R˜   Rš   t   compilet   MR®   Rž   RÁ   RÂ   RÐ   (    (    (    s;   /home/data/ftp/pub/unpacked/waf.tmpconfig/waflib/TaskGen.pyt   <module>   s4   $.ÿ !A						T%E	