ó
!Æ^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 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(   s]  
Try to detect a C++ compiler from the list of supported compilers (g++, msvc, etc)::

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

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

	from waflib.Tools.compiler_cxx import cxx_compiler
	cxx_compiler['win32'] = ['cfoo', 'msvc', 'gcc']

	def options(opt):
		opt.load('compiler_cxx')
	def configure(cnf):
		cnf.load('compiler_cxx')
	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::

	$ CXX=clang waf configure
iÿÿÿÿN(   t   ccroot(   t   Utils(   t   debugt   msvcs   g++s   clang++t   win32t   cygwint   darwins   xlc++t   aixt   icpct   linuxs   sunc++t   sunost   irixt   hpuxt   osf1Vt   gnut   javat   defaultc          C   s/   t  j ƒ  }  t j |  t d ƒ } d j | ƒ S(   NR   t    (   R   t   unversioned_sys_platformt   cxx_compilert   gett   join(   t   build_platformt   possible_compiler_list(    (    s<   /git_repos/PolyLV2/poly_mclk_in/waflib/Tools/compiler_cxx.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_cxx')s   [ ,]+s   Checking for %r (C++ compiler)s   compiler_cxx: %rt   CXXs#   could not configure a C++ compiler!N(   t   optionst   check_cxx_compilerR   t   AttributeErrort   fatalt   ret   splitt   envt   stasht	   start_msgt   loadt   errorst   ConfigurationErrort   revertt   end_msgt   FalseR   R   t   get_flatt   COMPILER_CXXt   commit(   t   conft   test_for_compilert   compilert   e(    (    s<   /git_repos/PolyLV2/poly_mclk_in/waflib/Tools/compiler_cxx.pyt	   configureA   s*    c         C   st   t  ƒ  } |  j d ƒ |  j d ƒ } | j d d d
 d d | d d ƒx% | j ƒ  D] } |  j d	 | ƒ qU Wd
 S(   sq   
	This is how to provide compiler preferences on the command-line::

		$ waf configure --check-cxx-compiler=gxx
	s   cxx_*.pys   Configuration optionss   --check-cxx-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   optR-   t   cxx_compiler_optst   x(    (    s<   /git_repos/PolyLV2/poly_mclk_in/waflib/Tools/compiler_cxx.pyR   `   s    	
(   t   __doc__R   t   waflib.ToolsR    t   waflibR   t   waflib.LogsR   R   R   R0   R   (    (    (    s<   /git_repos/PolyLV2/poly_mclk_in/waflib/Tools/compiler_cxx.pyt   <module>   s(   



			