ó
!Æ^c           @   s	  d  Z  d d l Z d d l m Z d d l m Z d d l m Z i d d d g d	 6d g d
 6d d g d 6d d d g d 6d d d g d 6d d g d 6d d g d 6d g d 6d g d 6d d g d 6d d d d g d 6d d g d 6Z d „  Z	 d „  Z
 d „  Z d S(   sD  
Try to detect a C compiler from the list of supported compilers (gcc, msvc, etc)::

	def options(opt):
		opt.load('compiler_c')
	def configure(cnf):
		cnf.load('compiler_c')
	def build(bld):
		bld.program(source='main.c', target='app')

The compilers are associated to platforms in :py:attr:`waflib.Tools.compiler_c.c_compiler`. To register
a new C compiler named *cfoo* (assuming the tool ``waflib/extras/cfoo.py`` exists), use::

	from waflib.Tools.compiler_c import c_compiler
	c_compiler['win32'] = ['cfoo', 'msvc', 'gcc']

	def options(opt):
		opt.load('compiler_c')
	def configure(cnf):
		cnf.load('compiler_c')
	def build(bld):
		bld.program(source='main.c', target='app')

Not all compilers need to have a specific tool. For example, the clang compilers can be detected by the gcc tools when using::

	$ CC=clang waf configure
iÿÿÿÿN(   t   ccroot(   t   Utils(   t   debugt   msvct   gcct   clangt   win32t   cygwint   darwint   xlct   aixt   icct   linuxt   suncct   sunost   irixcct   irixt   hpuxt   osf1Vt   gnut   javat   defaultc          C   s/   t  j ƒ  }  t j |  t d ƒ } d j | ƒ S(   NR   t    (   R   t   unversioned_sys_platformt
   c_compilert   gett   join(   t   build_platformt   possible_compiler_list(    (    s:   /git_repos/PolyLV2/poly_mclk_in/waflib/Tools/compiler_c.pyt   default_compilers;   s    c         C   s6  y |  j  j p t ƒ  } Wn t k
 r9 |  j d ƒ n Xxõ t j d | ƒ D]Ô } |  j j ƒ  |  j	 d | ƒ y |  j
 | ƒ Wn@ |  j j k
 rÄ } |  j j ƒ  |  j t ƒ t d | ƒ qM X|  j j r|  j |  j j d ƒ ƒ | |  j _ |  j j ƒ  Pn  |  j j ƒ  |  j t ƒ qM W|  j d ƒ d S(   s|   
	Detects a suitable C compiler

	:raises: :py:class:`waflib.Errors.ConfigurationError` when no suitable compiler is found
	s(   Add options(opt): opt.load('compiler_c')s   [ ,]+s   Checking for %r (C compiler)s   compiler_c: %rt   CCs!   could not configure a C compiler!N(   t   optionst   check_c_compilerR   t   AttributeErrort   fatalt   ret   splitt   envt   stasht	   start_msgt   loadt   errorst   ConfigurationErrort   revertt   end_msgt   FalseR   R   t   get_flatt   COMPILER_CCt   commit(   t   conft   test_for_compilert   compilert   e(    (    s:   /git_repos/PolyLV2/poly_mclk_in/waflib/Tools/compiler_c.pyt	   configure@   s*    c         C   s}   t  ƒ  } |  j d d d g ƒ|  j d ƒ } | j d d d d d | d	 d
 ƒx% | j ƒ  D] } |  j d | ƒ q^ Wd S(   so   
	This is how to provide compiler preferences on the command-line::

		$ waf configure --check-c-compiler=gcc
	s   c_*.pyt   bans   c_dumbpreproc.pys   Configuration optionss   --check-c-compilerR   t   helps   list of C compilers to try [%s]t   destR    s   %sN(   R   t   load_special_toolst   add_option_groupt
   add_optiont   NoneR$   R(   (   t   optR2   t   cc_compiler_optst   x(    (    s:   /git_repos/PolyLV2/poly_mclk_in/waflib/Tools/compiler_c.pyR   _   s    	
(   t   __doc__R#   t   waflib.ToolsR    t   waflibR   t   waflib.LogsR   R   R   R5   R   (    (    (    s:   /git_repos/PolyLV2/poly_mclk_in/waflib/Tools/compiler_c.pyt   <module>   s(   


			