#NEWLINE# def configure( self , candidates = None ) : #NEWLINE# #INDENT# ctx = self . ctx #NEWLINE# if ( candidates is None ) : #NEWLINE# #INDENT# if ( sys . platform == 'win32' ) : #NEWLINE# #INDENT# candidates = [ 'msvc' , 'gxx' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# candidates = [ 'gxx' , 'cxx' ] #NEWLINE# #UNINDENT# #UNINDENT# def _detect_cxx( ) : #NEWLINE# #INDENT# detected = None #NEWLINE# sys . path . insert ( 0 , os . path . dirname ( yaku . tools . __file__ ) ) #NEWLINE# try : #NEWLINE# #INDENT# for cxx_type in candidates : #NEWLINE# #INDENT# sys . stderr . write ( ( 'Looking for %s (c++ compiler) ... ' % cxx_type ) ) #NEWLINE# try : #NEWLINE# #INDENT# mod = __import__ ( cxx_type ) #NEWLINE# if mod . detect ( ctx ) : #NEWLINE# #INDENT# sys . stderr . write ( 'yes\n' ) #NEWLINE# detected = cxx_type #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# except ImportError : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# sys . stderr . write ( 'no!\n' ) #NEWLINE# #UNINDENT# return detected #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# sys . path . pop ( 0 ) #NEWLINE# #UNINDENT# #UNINDENT# cxx_type = _detect_cxx ( ) #NEWLINE# if ( cxx_type is None ) : #NEWLINE# #INDENT# raise ValueError ( 'No CXX compiler found!' ) #NEWLINE# #UNINDENT# cxx = ctx . load_tool ( cxx_type ) #NEWLINE# cxx . setup ( ctx ) #NEWLINE# if ( sys . platform != 'win32' ) : #NEWLINE# #INDENT# ar = ctx . load_tool ( 'ar' ) #NEWLINE# ar . setup ( cxx_type ) #NEWLINE# #UNINDENT# self . configured = True