#NEWLINE# def get_xlc( env , xlc = None , packages = [ ] ) : #NEWLINE# #INDENT# xlcPath = None #NEWLINE# xlcVersion = None #NEWLINE# if ( xlc is None ) : #NEWLINE# #INDENT# xlc = env . get ( 'CC' , 'xlc' ) #NEWLINE# #UNINDENT# if SCons . Util . is_List ( xlc ) : #NEWLINE# #INDENT# xlc = xlc [ 0 ] #NEWLINE# #UNINDENT# for package in packages : #NEWLINE# #INDENT# pipe = SCons . Action . _subproc ( env , [ 'lslpp' , '-fc' , package ] , stdin = 'devnull' , stderr = 'devnull' , stdout = subprocess . PIPE ) #NEWLINE# for line in pipe . stdout : #NEWLINE# #INDENT# if xlcPath : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# ( fileset , filename ) = line . split ( ':' ) [ 1 : 3 ] #NEWLINE# filename = filename . split ( ) [ 0 ] #NEWLINE# if ( ( ( '/' in sep ) and ( filename == xlc ) ) or ( ( '/' not in xlc ) and filename . endswith ( ( '/' + xlc ) ) ) ) : #NEWLINE# #INDENT# xlcVersion = fileset . split ( ) [ 1 ] #NEWLINE# ( xlcPath , sep , xlc ) = filename . rpartition ( '/' ) #NEWLINE# #UNINDENT# pass #NEWLINE# #UNINDENT# pass #NEWLINE# #UNINDENT# return ( xlcPath , xlc , xlcVersion )