ó
óÏù]c           @   se  d  Z  d d l Z d d l Z d d l m Z m Z m Z m Z m Z d d l	 m
 Z
 m Z m Z m Z m Z d d l m Z m Z m Z m Z m Z d d l m Z d d d	 d
 g Z e j e ƒ Z e d d d d d d d g ƒ e d <e d d d d d d d g ƒ e d <e d d g ƒ e d <e d d d g ƒ e d <e d d d d d d d d  d d d! g ƒ e d" <e d# <e d d d d d d d d  d d d! g ƒ e d$ <e d% <e d& d g ƒ e d' <e d( <e d d d d d d d g ƒ e d) <e d d d d d d d g ƒ e d* <e d& d g ƒ e d+ <e d, g ƒ e d- <e d. „  ƒ Z e d/ „  ƒ Z e d d d d- d0 d ƒ e
 d1 d2 ƒ d3 „  ƒ ƒ Z d4 e j f d5 „  ƒ  YZ d6 e f d7 „  ƒ  YZ d8 „  Z  e  e ƒ e d d d d0 d- ƒ e
 d2 ƒ d9 „  ƒ ƒ Z! e d: „  ƒ Z" e d d d d; d0 ƒ e d< d1 ƒ e
 d= d2 ƒ d> „  ƒ ƒ ƒ Z# e d? „  ƒ Z$ e d@ „  ƒ Z% e dA „  ƒ Z& e d d d d0 dB dC dD d- ƒ e
 dE ƒ dF „  ƒ ƒ Z' e d$ d% dG ƒ e
 d= ƒ dH „  ƒ ƒ Z( e j) dI ƒ Z* e d$ d% d* dG dJ ƒ e
 d= d1 ƒ dK „  ƒ ƒ Z+ dJ e j f dL „  ƒ  YZ, dM e f dN „  ƒ  YZ- dO e f dP „  ƒ  YZ. e g  g  g  dQ „ ƒ Z/ e g  g  g  dR „ ƒ Z0 i dS dT dU dV dW g dX 6dY dZ dV dW d[ d\ g d] 6Z1 e d^ ƒ d_ „  ƒ Z2 d` e j f da „  ƒ  YZ3 e db dc ƒ dd „  ƒ Z4 e de ƒ e d2 ƒ df „  ƒ ƒ Z5 e dg „  ƒ Z6 e d# d" ƒ e
 d= dE ƒ dh „  ƒ ƒ Z7 d S(i   s™   
Classes and methods shared by tools providing support for C-like language such
as C/C++/D/Assembly/Go (this support module is almost never used alone).
iÿÿÿÿN(   t   Taskt   Utilst   Nodet   Errorst   Logs(   t   after_methodt   before_methodt   featuret   taskgen_methodt	   extension(   t	   c_aliasest	   c_preproct   c_configt   c_osxt   c_tests(   t   confs
   /usr/lib64s   /usr/libs   /usr/local/lib64s   /usr/local/libt   INCLUDESt   FRAMEWORKPATHt   DEFINESt   CPPFLAGSt   CCDEPSt   CFLAGSt   ARCHt   ct   CXXDEPSt   CXXFLAGSt   cxxt   DFLAGSt   dt   includest   LIBt   STLIBt   LIBPATHt	   STLIBPATHt	   LINKFLAGSt   RPATHt   LINKDEPSt	   FRAMEWORKt   LDFLAGSt   cprogramt
   cxxprogramt   cshlibt   cxxshlibt   ARFLAGSt   cstlibt   cxxstlibt   dprogramt   dshlibt   dstlibt   ASFLAGSt   asmc         C   so   d | j  |  j f } |  j | | | j j | ƒ ƒ } y |  j j | ƒ Wn t k
 rj | g |  _ n X| S(   sÄ  
	Create the compilation task: c, cxx, asm, etc. The output node is created automatically (object file with a typical **.o** extension).
	The task is appended to the list *compiled_tasks* which is then used by :py:func:`waflib.Tools.ccroot.apply_link`

	:param name: name of the task class
	:type name: string
	:param node: the file to compile
	:type node: :py:class:`waflib.Node.Node`
	:return: The task created
	:rtype: :py:class:`waflib.Task.Task`
	s   %s.%d.o(   t   namet   idxt   create_taskt   parentt   find_or_declaret   compiled_taskst   appendt   AttributeError(   t   selfR3   t   nodet   outt   task(    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   create_compiled_task(   s    !c         C   sW  g  } t  ƒ  } xA|  j | ƒ D]0} | | k s | r> q n  | j | ƒ t | t j ƒ rm | j | ƒ q t j j | ƒ r¤ | j |  j	 j
 j | ƒ p� | ƒ q | d d k ré |  j	 j j | d ƒ } |  j	 j j | d ƒ } n* |  j j ƒ  j | ƒ } |  j j | ƒ } | j |  j	 j ƒ r5| j ƒ  n  | j | ƒ | j | ƒ q W| S(   s?  
	Task generator method provided to convert a list of string/nodes into a list of includes folders.

	The paths are assumed to be relative to the task generator path, except if they begin by **#**
	in which case they are searched from the top-level directory (``bld.srcnode``).
	The folders are simply assumed to be existing.

	The node objects in the list are returned in the output list. The strings are converted
	into node objects if possible. The node is searched from the source directory, and if a match is found,
	the equivalent build directory is created and added to the returned list too. When a folder cannot be found, it is ignored.

	:param inlst: list of folders
	:type inlst: space-delimited string or a list of string/nodes
	:rtype: list of :py:class:`waflib.Node.Node`
	:return: list of include folders as nodes
	i    t   #i   (   t   sett   to_listt   addt
   isinstanceR   R9   t   ost   patht   isabst   bldt   roott	   make_nodet   bldnodet   srcnodet   get_bldt   is_child_oft   mkdir(   R;   t   inlstt   lstt   seent   xt   pt   v(    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   to_incnodes=   s(    	%t   fct   propagate_uselib_varst   process_sourcec         C   so   |  j  |  j t |  d g  ƒ ƒ |  j j ƒ } | |  _ |  j ƒ  } g  | D] } | j | ƒ ^ qJ |  j _ d S(   sÿ  
	Task generator method that processes the attribute *includes*::

		tg = bld(features='includes', includes='.')

	The folders only need to be relative to the current directory, the equivalent build directory is
	added automatically (for headers created in the build directory). This enable using a build directory
	or not (``top == out``).

	This method will add a list of nodes read by :py:func:`waflib.Tools.ccroot.to_incnodes` in ``tg.env.INCPATHS``,
	and the list of include paths in ``tg.env.INCLUDES``.
	R   N(	   RV   RB   t   getattrt   envR   t   includes_nodest   get_cwdt	   path_fromt   INCPATHS(   R;   RQ   t   cwdRS   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   apply_incpathsi   s    .	t	   link_taskc           B   sD   e  Z d  Z d Z d Z d Z e j Z	 d „  Z
 d „  Z d „  Z RS(   s<  
	Base class for all link tasks. A task generator is supposed to have at most one link task bound in the attribute *link_task*. See :py:func:`waflib.Tools.ccroot.apply_link`.

	.. inheritance-diagram:: waflib.Tools.ccroot.stlink_task waflib.Tools.c.cprogram waflib.Tools.c.cshlib waflib.Tools.cxx.cxxstlib  waflib.Tools.cxx.cxxprogram waflib.Tools.cxx.cxxshlib waflib.Tools.d.dprogram waflib.Tools.d.dshlib waflib.Tools.d.dstlib waflib.Tools.ccroot.fake_shlib waflib.Tools.ccroot.fake_stlib waflib.Tools.asm.asmprogram waflib.Tools.asm.asmshlib waflib.Tools.asm.asmstlib
	t   YELLOWi   c         C   sŽ  t  | t ƒ r}|  j j } | j d ƒ rF | d } |  j j j } n  |  j |  j j	 d } | sl d } n  t
 j j | ƒ \ } } |  j j	 j d ƒ d k rCt |  j d d ƒ rC|  j j j d ƒ } |  j j d	 k rð | d
 | d } qC|  j j d k rCd | | d f } t | ƒ d k r@| d | d 7} q@qCn  | ra| t
 j | | } n
 | | } | j | ƒ } n  |  j | ƒ d S(   s¢   
		Process the *target* attribute to add the platform-specific prefix/suffix such as *.so* or *.exe*.
		The settings are retrieved from ``env.clsname_PATTERN``
		R@   i   t   _PATTERNs   %st   shlibi    t   vnumt   .t   pet   -t   openbsds   %s.%si   s   .%sN(   RD   t   strt	   generatorRF   t
   startswithRH   RK   R[   t	   __class__t   __name__RE   t   splitt   findRZ   t   NoneRf   t   DEST_BINFMTt   DEST_OSt   lent   sepR7   t   set_outputs(   R;   t   targett   baset   patternt   folderR3   t   numst   tmp(    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt
   add_target�   s,    
	0
c         O   sA   t  t |  ƒ j | | Ž  } | r= |  j j r= |  j ƒ  } n  | S(   N(   t   superRb   t   exec_commandR[   t   DO_MANIFESTt   exec_mf(   R;   t   kt   kwt   ret(    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyR€   ²   s    c         C   s)  |  j  j s d Sd } x7 |  j D]( } | j j d ƒ r  | j ƒ  } Pq  q  Wd Sd } xG t j |  j	 j
 ƒ D]0 } | d k r‡ d } ql | d k rl d } ql ql Wt j d | ƒ g  |  j  j } | j t j |  j  j ƒ ƒ | j d | g ƒ | j d |  j d j ƒ  | f ƒ t t |  ƒ j | ƒ S(   sD   
		Create manifest files for VS-like compilers (msvc, ifort, ...)
		i    s	   .manifestt    R'   R(   t	   fcprogramt   fcprogram_testi   R)   R*   t   fcshlibi   s#   msvc: embedding manifest in mode %rs	   -manifests   -outputresource:%s;%sN(   R'   R(   R‡   Rˆ   (   R)   R*   R‰   (   R[   t   MTRr   t   outputsR3   t   endswitht   abspathR   RB   Rl   t   featuresR   t   debugt   extendt   MTFLAGSR9   R   Rb   R€   (   R;   t   manifestt   out_nodet   modeRS   RQ   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyR‚   ¸   s(    	$N(   Ro   t
   __module__t   __doc__t   colort   weightRr   t   inst_toR   t   O755t   chmodR~   R€   R‚   (    (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyRb   ~   s   		#	t   stlink_taskc           B   s   e  Z d  Z d Z e j Z RS(   st   
	Base for static link tasks, which use *ar* most of the time.
	The target is always removed before being written.
	s4   ${AR} ${ARFLAGS} ${AR_TGT_F}${TGT} ${AR_SRC_F}${SRC}(   Ro   R•   R–   t   run_strR   t   O644R›   (    (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyRœ   Ü   s   	c            s,   |  j  ‰  ‡  f d †  } t |  d | ƒ d  S(   Nc            s<   y t  j |  j d j ƒ  ƒ Wn t k
 r1 n Xˆ  |  ƒ S(   Ni    (   RE   t   removeR‹   R�   t   OSError(   R;   (   t   old(    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   wrapè   s
    t   run(   R£   t   setattr(   t   clsR¢   (    (   R¡   s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   rm_tgtæ   s    	c      	   C   sW  x� |  j  D]€ } | d k r4 d |  j  k r4 d } n$ | d k rX d |  j  k rX d } n  | t j k r
 t t j | t ƒ rŠ | } PqŠ q
 q
 Wd Sg  t |  d g  ƒ D] } | j d ^ q¥ } |  j | | ƒ |  _ |  j j |  j	 ƒ y |  j
 } Wn t k
 r|  j j } n X| rS|  j d	 | d
 |  j j d |  j j d |  j ƒ |  _ n  d S(   sù  
	Collect the tasks stored in ``compiled_tasks`` (created by :py:func:`waflib.Tools.ccroot.create_compiled_task`), and
	use the outputs for a new instance of :py:class:`waflib.Tools.ccroot.link_task`. The class to use is the first link task
	matching a name from the attribute *features*, for example::

			def build(bld):
				tg = bld(features='cxx cxxprogram cprogram', source='main.c', target='app')

	will create the task ``tg.link_task`` as a new instance of :py:class:`waflib.Tools.cxx.cxxprogram`
	R'   R   R(   R)   R*   NR8   i    t
   install_tot   install_fromR›   R>   (   RŽ   R    t   classest
   issubclassRb   RZ   R‹   R5   R~   Rx   t   install_pathR:   R™   t   add_install_filesR›   t   install_task(   R;   RS   t   linkt   tt   objsR™   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt
   apply_linkñ   s*    		,	c   	      K   s¯  | |  j  k s | |  j k r" d Sy |  j j | ƒ } Wn5 t j k
 ro |  j j | ƒ |  j  j | ƒ d SX|  j j | ƒ | j	 ƒ  | j
 d t ƒ | _ } | j
 d t ƒ | _ } y | j } Wn t k
 rå d | _ n1 Xt } t | t ƒ st } d | _ n	 d | _ |  j } x‰ |  j t | d g  ƒ ƒ D]l } |  j d | rXq;n  y | | j | ƒ Wn t k
 r�| g | | <n X|  j | d | d | ƒq;Wd S(	   s|   
	Processes the ``use`` keyword recursively. This method is kind of private and only meant to be used from ``process_use``
	Nt   objectst   stlibR†   R   R   t   uset   STLIB_(   t   tmp_use_nott   tmp_use_seenRH   t   get_tgen_by_nameR   t   WafErrort   uselibR9   RC   t   postt   gett   Truet   tmp_use_objectst   tmp_use_stlibRb   R:   t   tmp_use_vart   FalseRD   Rœ   t   tmp_use_precRB   RZ   R[   t   KeyErrort   use_rec(	   R;   R3   R„   t   yR²   R³   Rb   RT   RS   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyRÄ     s<    
		"R´   Ra   R±   c         C   s  t  ƒ  } |  _ g  |  _ i  } |  _ |  j t |  d g  ƒ ƒ |  _ |  j t |  d g  ƒ ƒ |  _ |  j t |  d g  ƒ ƒ } x | D] } |  j | ƒ q„ Wx$ | D] } | | k r¢ | | =q¢ q¢ Wg  } |  _	 g  } xE |  j D]: } x1 | j
 ƒ  D] } | | k rò Pqò qò W| j | ƒ qß Wx� | r®| j ƒ  } | j | ƒ y | | }	 Wn t k
 r`q X| | =x@ |	 D]8 } x/ | D] }
 | | |
 k r|Pq|q|W| j | ƒ qoWq W| rËt j d | ƒ ‚ n  | j ƒ  t |  d d ƒ } x_| D]W} |  j j | ƒ }
 |
 j } | rÇ| rÇ| d k s<|
 j s<| | k rà|  j j | |
 j |
 j j t j ƒ d g ƒ |  j j j |
 j j ƒ |
 j j d j  j! |  j" ƒ  ƒ } |  j j# | d	 | g ƒ qàn |
 j$ rà|  j% |
 ƒ n  t |
 d
 d ƒ r|  j |
 j& |
 j' ƒ |  _ n  t |
 d d ƒ rî|  j j d |  j |
 j( ƒ ƒ qîqîWxÉ | D]Á } y |  j j | ƒ }
 WnH t j k
 r¶|  j d | r| |  j k r|  j j | ƒ qqPXxW |  j t |
 d g  ƒ ƒ D]: } |  j d | rÓ| |  j k rÓ|  j j | ƒ qÓqÓWqPWd S(   sö   
	Process the ``use`` attribute which contains a list of task generator names::

		def build(bld):
			bld.shlib(source='a.c', target='lib1')
			bld.program(source='main.c', target='app', use='lib1')

	See :py:func:`waflib.Tools.ccroot.use_rec`.
	Rº   R   R´   s'   Cycle detected in the use processing %rRb   R   i   i    t   PATHt   export_includest   export_definesR   Rµ   N()   RA   R¶   R·   RÂ   RB   RZ   Rº   R   RÄ   t   tmp_use_sortedt   valuesR9   t   popRÃ   R   R¹   t   reverseRr   RH   R¸   RÀ   R¿   R[   t   append_valueRx   t   rfindRE   Rv   Rb   t	   dep_nodesR�   R‹   R6   R^   R]   t   append_uniqueR¾   t   add_objects_from_tgenRV   RÇ   RÈ   (   R;   t   use_nott   use_prect   namesRS   R=   R}   Rƒ   t   et   nlstRÅ   Rb   t   vart   tmp_path(    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   process_useG  sv    		
	!0" 	&!"!c         C   s   | j  j d ƒ S(   s   
	PRIVATE INTERNAL USE ONLY
	s   .pdb(   R3   RŒ   (   R;   R<   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   accept_node_to_link¢  s    c         C   sx   y |  j  } Wn t k
 r  nT XxP t | d g  ƒ D]< } x3 | j D]( } |  j | ƒ rD | j j | ƒ qD qD Wq4 Wd S(   sè   
	Add the objects from the depending compiled tasks as link task inputs.

	Some objects are filtered: for instance, .pdb files are added
	to the compiled tasks but not to the link tasks (to avoid errors)
	PRIVATE INTERNAL USE ONLY
	R8   N(   Rb   R:   RZ   R‹   RÚ   t   inputsR9   (   R;   t   tgRb   t   tskRS   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyRÑ   ©  s    	c         C   s>   t  ƒ  } x. |  j D]# } | t k r | t | O} q q W| S(   s“   
	:return: the *uselib* variables associated to the *features* attribute (see :py:attr:`waflib.Tools.ccroot.USELIB_VARS`)
	:rtype: list of string
	(   RA   RŽ   t   USELIB_VARS(   R;   t   _varsRS   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   get_uselib_vars¼  s
    	t   javact   csRº   RÙ   c   	      C   sÍ   |  j  ƒ  } |  j } | j } |  j |  j t |  d g  ƒ ƒ } x† | D]~ } | j ƒ  } t |  | g  ƒ } | rŠ | | |  j | ƒ ƒ n  x8 | D]0 } | d | | f } | r‘ | | | ƒ q‘ q‘ WqG Wd S(   sm  
	Process uselib variables for adding flags. For example, the following target::

		def build(bld):
			bld.env.AFLAGS_aaa = ['bar']
			from waflib.Tools.ccroot import USELIB_VARS
			USELIB_VARS['aaa'] = ['AFLAGS']

			tg = bld(features='aaa', aflags='test')

	The *aflags* attribute will be processed and this method will set::

			tg.env.AFLAGS = ['bar', 'test']
	Rº   s   %s_%sN(   Rà   R[   RÍ   RŽ   RB   RZ   t   lower(	   R;   Rß   R[   t   appt   feature_uselibR×   RÅ   t   valRS   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyRX   È  s    		"R‰   c      	   C   s5  |  j  j d k s d S|  j j d } t |  j t j ƒ rJ |  j j } n t j	 j
 |  j ƒ d } |  j  j | } | j j | ƒ } |  j  j d |  j  j | j ƒ  ƒ |  j j j | ƒ t |  d d ƒ rw|  j  j d k rw|  j	 j |  j ƒ } | st j d |  j ƒ ‚ n  |  j  j ra|  j  j d |  j  j | j |  j ƒ  ƒ ƒ |  j j j | ƒ qw|  j j j | ƒ n  t |  d d ƒ r1y |  j } Wne t k
 rýy |  j } Wqþt k
 rùd	 } d
 |  j  _! |  j  j" sú|  j  j# |  j  _" qúqþXn X|  j$ d | d | d |  j j% d |  j ƒ |  _& n  d S(   s¹   
	Handle dlls and their import libs on Windows-like systems.

	A ``.dll.a`` file called *import library* is generated.
	It must be installed as it is required for linking the library.
	Rh   Ni    i   R"   t   defss   invalid def file %rR­   s   ${IMPLIBDIR}s	   ${BINDIR}R§   R¨   R›   R>   ('   R[   Rs   Rb   R‹   RD   Rx   R   R3   RE   RF   Rp   t   implib_PATTERNR6   R7   RÍ   t	   IMPLIB_STt   bldpathR9   RZ   Rr   t   find_resourceRç   R   R¹   t   def_PATTERNR^   R]   RÏ   RÛ   t   install_path_implibR:   R«   R­   R§   t	   IMPLIBDIRt   LIBDIRR¬   R›   t   implib_install_task(   R;   t   dllR3   t   implibR<   R™   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   apply_implibê  s>    	#$,s%   ^([1-9]\d*|0)([.]([1-9]\d*|0)){0,2}?$Rf   c         C   s  t  |  d d ƒ s4 t j d k s4 |  j j d k r8 d S|  j } t j |  j ƒ s~ t	 j
 d |  j t  |  d |  ƒ f ƒ ‚ n  |  j j d	 ƒ } | j d
 } t  |  d t | d
 ƒ ƒ } | j d	 ƒ } t | ƒ t | ƒ k sù | d
 t | ƒ !| k rt	 j
 d | ƒ ‚ n  | j } | j d ƒ rY| j d d |  j ƒ } | j d d | ƒ } n | d	 |  j } | d	 | } |  j j r°|  j j | }	 |  j j d |	 j ƒ  ƒ n  |  j j d k r| j j | ƒ g }
 | | k rÿ|
 j | j j | ƒ ƒ n  |  j d | |
 ƒ n  t  |  d d ƒ rXt j |  j _ t |  j _ |  j j } |  j j d k r°|  j j d
 j } |  j  d d | | f d | d |  j j! ƒ } | f |  _" qX|  j  d | t j# | d | d |  j j! ƒ } |  j$ d | t j# | d | ƒ } | | k rF|  j$ d | t j# | d | ƒ } | | | f |  _" qX| | f |  _" n  d |  j j% k ry |  j& } Wn t' k
 r–|  j j( } n X| rt) j* | |  j ƒ } t j+ j, | | ƒ } |  j j d d | g ƒ |  j j d d | ƒ |  j j d d |  j ƒ qn  d S(   s^  
	Enforce version numbering on shared libraries. The valid version numbers must have either zero or two dots::

		def build(bld):
			bld.shlib(source='a.c', target='foo', vnum='14.15.16')

	In this example on Linux platform, ``libfoo.so`` is installed as ``libfoo.so.14.15.16``, and the following symbolic links are created:

	* ``libfoo.so    â†’ libfoo.so.14.15.16``
	* ``libfoo.so.14 â†’ libfoo.so.14.15.16``

	By default, the library will be assigned SONAME ``libfoo.so.14``, effectively declaring ABI compatibility between all minor and patch releases for the major version of the library.  When necessary, the compatibility can be explicitly defined using `cnum` parameter:

		def build(bld):
			bld.shlib(source='a.c', target='foo', vnum='14.15.16', cnum='14.15')

	In this case, the assigned SONAME will be ``libfoo.so.14.15`` with ABI compatibility only between path releases for a specific major and minor version of the library.

	On OS X platform, install-name parameter will follow the above logic for SONAME with exception that it also specifies an absolute path (based on install_path) of the library.
	Rf   R†   t   posixt   elfs   mac-oNs   Invalid vnum %r for target %rR3   Rg   i    t   cnums    invalid compatibility version %ss   .dylibs	   .%s.dylibR"   Rj   R­   R§   s   %s/%sR¨   R›   s   -dynamiclibs   -install_names   -Wl,-compatibility_version,%ss   -Wl,-current_version,%s(   Rõ   s   mac-o(-   RZ   RE   R3   R[   Rs   Rb   t   re_vnumt   matchRf   R   R¹   Rp   R‹   Rk   Ru   RŒ   t   replacet	   SONAME_STRÍ   Rt   R6   RJ   R9   R5   Rr   R    t   SKIPPEDR­   t   hasrunR½   t   no_errcheck_outR§   t   add_install_asR›   t   vnum_install_taskRv   t   add_symlink_asR"   R«   R:   R™   R   t
   subst_varsRF   t   join(   R;   R®   R|   R<   Rö   t   cnumst   libnamet   name3t   name2RU   t   outsRF   t   t1t   t3t   t2R™   RT   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt
   apply_vnum   sd    4	+1	./##c           B   s/   e  Z d  Z d Z d g Z d „  Z d „  Z RS(   s€   
	Create the symbolic links for a versioned shared library. Instances are created by :py:func:`waflib.Tools.ccroot.apply_vnum`
	t   CYANs   .binc         C   s   d S(   Nt
   Symlinking(    (   R;   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   keyword}  s    c         C   s|   xu |  j  D]j } | j ƒ  } y t j | ƒ Wn t k
 r@ n Xy t j |  j d j | ƒ Wq
 t k
 rs d SXq
 Wd  S(   Ni    i   (   R‹   R�   RE   RŸ   R    t   symlinkRÛ   R3   (   R;   RS   RF   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyR£     s    (   Ro   R•   R–   R—   t   ext_inR  R£   (    (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyRf   w  s
   		t
   fake_shlibc           B   s   e  Z d  Z d „  Z RS(   sJ   
	Task used for reading a system library and adding the dependency on it
	c         C   s+   x! |  j  D] } | j s
 t j Sq
 Wt j S(   N(   t	   run_afterRü   R    t	   ASK_LATERt   SKIP_ME(   R;   R¯   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   runnable_status�  s    	(   Ro   R•   R–   R  (    (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyR  Œ  s   t
   fake_stlibc           B   s   e  Z d  Z d „  Z RS(   sJ   
	Task used for reading a system library and adding the dependency on it
	c         C   s+   x! |  j  D] } | j s
 t j Sq
 Wt j S(   N(   R  Rü   R    R  R  (   R;   R¯   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyR  š  s    	(   Ro   R•   R–   R  (    (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyR  –  s   c         C   s+   |  d | d d d | d d d | d | ƒ S(	   sÆ   
	Read a system shared library, enabling its use as a local library. Will trigger a rebuild if the file changes::

		def build(bld):
			bld.read_shlib('m')
			bld.program(source='main.c', use='m')
	R3   RŽ   t   fake_libt	   lib_pathst   lib_typeRe   RÇ   RÈ   (    (   R;   R3   t   pathsRÇ   RÈ   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt
   read_shlib   s    	c         C   s+   |  d | d d d | d d d | d | ƒ S(	   sp   
	Read a system static library, enabling a use as a local library. Will trigger a rebuild if the file changes.
	R3   RŽ   R  R  R  R³   RÇ   RÈ   (    (   R;   R3   R  RÇ   RÈ   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt
   read_stlib«  s    s   lib%s.sos   %s.sos   lib%s.dylibs	   lib%s.dlls   %s.dllRe   s   lib%s.as   %s.as	   lib%s.libs   %s.libR³   R  c         C   sH  d } g  t |  j D] } | |  j ^ q } xæ |  j |  j g t D]· } t | t j ƒ s“ |  j	 j
 j | ƒ p� |  j j | ƒ } | s“ qE q“ n  xe | D]Z } | j | ƒ } | rš y t j | j ƒ  ƒ Wn! t k
 rï t d | ƒ ‚ n XPqš qš WqE PqE Wt j d |  j ƒ ‚ |  j d |  j g  | g ƒ |  _ |  j |  _ d S(   sŽ   
	Find the location of a foreign library. Used by :py:class:`waflib.Tools.ccroot.read_shlib` and :py:class:`waflib.Tools.ccroot.read_stlib`.
	s   Could not read %rs   could not find library %rs   fake_%sN(   Rr   t   lib_patternsR  R3   R  RF   t   SYSTEM_LIB_PATHSRD   R   RH   RI   t	   find_nodeR   t   h_fileR�   t   EnvironmentErrort
   ValueErrorR   R¹   R5   Rb   Rx   (   R;   R<   RS   RÔ   RÅ   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   process_lib·  s(    ''	"t   fake_oc           B   s   e  Z d  „  Z RS(   c         C   s   t  j S(   N(   R    R  (   R;   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyR  ×  s    (   Ro   R•   R  (    (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyR$  Ö  s   s   .os   .objc         C   sM   |  j  d g  | ƒ } y |  j j | ƒ Wn t k
 rH | g |  _ n Xd  S(   NR$  (   R5   R8   R9   R:   (   R;   R<   RÝ   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   add_those_o_filesÚ  s
    t   fake_objc         C   s7   x' |  j  |  j ƒ D] } |  j | ƒ q Wg  |  _ d S(   s3   
	Puts object files in the task generator outputs
	N(   t   to_nodest   sourceR%  (   R;   R<   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   process_objsâ  s    c         C   sF   t  | |  j j ƒ s* |  j j | ƒ } n  |  d d d | d | j ƒ S(   s›   
	Read an object file, enabling injection in libs/programs. Will trigger a rebuild if the file changes.

	:param obj: object file path, as string or Node
	RŽ   R&  R(  R3   (   RD   RF   Rn   Rë   R3   (   R;   t   obj(    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   read_objectì  s    c         C   sµ   |  j  j d k r d S|  j j j ƒ  } x† d d g D]x } g  } x\ |  j  | D]M } | j d ƒ rt | j | ƒ qO | j t j j	 t j j
 | | ƒ ƒ ƒ qO W| |  j  | <q5 Wd S(   sL   
	On hp-ux, extend the libpaths and static library paths to absolute paths
	s   hp-uxNR    R!   t   /(   R[   Rt   RH   RK   R�   Rm   R9   RE   RF   t   normpathR  (   R;   Ry   R×   RQ   RS   (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   set_full_paths_hpux÷  s    ,(8   R–   RE   t   ret   waflibR    R   R   R   R   t   waflib.TaskGenR   R   R   R   R	   t   waflib.ToolsR
   R   R   R   R   t   waflib.ConfigureR   R  t   defaultdictRA   RÞ   R?   RV   Ra   Rb   Rœ   R¦   R±   RÄ   RÙ   RÚ   RÑ   Rà   RX   Ró   t   compileR÷   R  Rf   R  R  R  R  R  R#  R$  R%  R)  R+  R.  (    (    (    s)   /git_repos/ams-lv2/waflib/Tools/ccroot.pyt   <module>   sx   (((%%99%%,^
		
),Y!4V


		