#NEWLINE# def detect_objcpp_compiler( self , want_cross ) : #NEWLINE# #INDENT# if ( self . is_cross_build ( ) and want_cross ) : #NEWLINE# #INDENT# exelist = [ self . cross_info [ 'objcpp' ] ] #NEWLINE# is_cross = True #NEWLINE# exe_wrap = self . cross_info . get ( 'exe_wrapper' , None ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# exelist = self . get_objcpp_compiler_exelist ( ) #NEWLINE# is_cross = False #NEWLINE# exe_wrap = None #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# p = subprocess . Popen ( ( exelist + [ '--version' ] ) , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) #NEWLINE# #UNINDENT# except OSError : #NEWLINE# #INDENT# raise EnvironmentException ( ( 'Could not execute ObjC++ compiler "%s"' % ' ' . join ( exelist ) ) ) #NEWLINE# #UNINDENT# ( out , err ) = p . communicate ( ) #NEWLINE# out = out . decode ( errors = 'ignore' ) #NEWLINE# err = err . decode ( errors = 'ignore' ) #NEWLINE# vmatch = re . search ( Environment . version_regex , out ) #NEWLINE# if vmatch : #NEWLINE# #INDENT# version = vmatch . group ( 0 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# version = 'unknown version' #NEWLINE# #UNINDENT# if ( ( out . startswith ( 'c++ ' ) or out . startswith ( 'g++' ) ) and ( 'Free Software Foundation' in out ) ) : #NEWLINE# #INDENT# return GnuObjCPPCompiler ( exelist , version , is_cross , exe_wrap ) #NEWLINE# #UNINDENT# if out . startswith ( 'Apple LLVM' ) : #NEWLINE# #INDENT# return ClangObjCPPCompiler ( exelist , version , CLANG_OSX , vmatch , exe_wrap ) #NEWLINE# #UNINDENT# if ( ( 'apple' in out ) and ( 'Free Software Foundation' in out ) ) : #NEWLINE# #INDENT# return GnuObjCPPCompiler ( exelist , version , is_cross , exe_wrap ) #NEWLINE# #UNINDENT# raise EnvironmentException ( ( ( 'Unknown compiler "' + ' ' . join ( exelist ) ) + '"' ) )