parameters: (self, *k, **kw)
return_statement: return  path.abspath(), match_libs(kw.get('lib', None), False), match_libs(kw.get('stlib', None), True)
docstring: return the lib path and the required libs
  	according to the parameters
docstring_summary: return the lib path and the required libs
  	according to the parameters
docstring_tokens: return the lib path and the required libs according to the parameters
function: def boost_get_libs(self, *k, **kw):
  	'''
  	return the lib path and the required libs
  	according to the parameters
  	'''
  	path, files = self.__boost_get_libs_path(**kw)
  	files = sorted(files, key=lambda f: (len(f.name), f.name), reverse=True)
  	toolset = self.boost_get_toolset(kw.get('toolset', ''))
  	toolset_pat = '(-%s[0-9]{0,3})' % toolset
  	version = '-%s' % self.env.BOOST_VERSION
  
  	def find_lib(re_lib, files):
  		for file in files:
  			if re_lib.search(file.name):
  				self.to_log('Found boost lib %s' % file)
  				return file
  		return None
  
  	def format_lib_name(name):
  		if name.startswith('lib') and self.env.CC_NAME != 'msvc':
  			name = name[3:]
  		return name[:name.rfind('.')]
  
  	def match_libs(lib_names, is_static):
  		libs = []
  		lib_names = Utils.to_list(lib_names)
  		if not lib_names:
  			return libs
  		t = []
  		if kw.get('mt', False):
  			t.append('-mt')
  		if kw.get('abi', None):
  			t.append('%s%s' % (is_static and '-s' or '-', kw['abi']))
  		elif is_static:
  			t.append('-s')
  		tags_pat = t and ''.join(t) or ''
  		ext = is_static and self.env.cxxstlib_PATTERN or self.env.cxxshlib_PATTERN
  		ext = ext.partition('%s')[2] # remove '%s' or 'lib%s' from PATTERN
  
  		for lib in lib_names:
  			if lib == 'python':
  				# for instance, with python='27',
  				# accepts '-py27', '-py2', '27' and '2'
  				# but will reject '-py3', '-py26', '26' and '3'
  				tags = '({0})?((-py{2})|(-py{1}(?=[^0-9]))|({2})|({1}(?=[^0-9]))|(?=[^0-9])(?!-py))'.format(tags_pat, kw['python'][0], kw['python'])
  			else:
  				tags = tags_pat
  			# Trying libraries, from most strict match to least one
  			for pattern in ['boost_%s%s%s%s%s$' % (lib, toolset_pat, tags, version, ext),
  							'boost_%s%s%s%s$' % (lib, tags, version, ext),
  							# Give up trying to find the right version
  							'boost_%s%s%s%s$' % (lib, toolset_pat, tags, ext),
  							'boost_%s%s%s$' % (lib, tags, ext),
  							'boost_%s%s$' % (lib, ext),
  							'boost_%s' % lib]:
  				self.to_log('Trying pattern %s' % pattern)
  				file = find_lib(re.compile(pattern), files)
  				if file:
  					libs.append(format_lib_name(file.name))
  					break
  			else:
  				self.to_log('Failed looking for boost lib %s' % lib)
  				if kw.get('required', True):
  					self.end_msg('lib %s not found in %s' % (lib, path.abspath()))
  					self.fatal('The configuration failed')
  		return libs
  
  	return  path.abspath(), match_libs(kw.get('lib', None), False), match_libs(kw.get('stlib', None), True)
function_tokens: def boost_get_libs ( self , * k , * * kw ) : path , files = self . __boost_get_libs_path ( * * kw ) files = sorted ( files , key = lambda f : ( len ( f . name ) , f . name ) , reverse = True ) toolset = self . boost_get_toolset ( kw . get ( 'toolset' , '' ) ) toolset_pat = '(-%s[0-9]{0,3})' % toolset version = '-%s' % self . env . BOOST_VERSION def find_lib ( re_lib , files ) : for file in files : if re_lib . search ( file . name ) : self . to_log ( 'Found boost lib %s' % file ) return file return None def format_lib_name ( name ) : if name . startswith ( 'lib' ) and self . env . CC_NAME != 'msvc' : name = name [ 3 : ] return name [ : name . rfind ( '.' ) ] def match_libs ( lib_names , is_static ) : libs = [ ] lib_names = Utils . to_list ( lib_names ) if not lib_names : return libs t = [ ] if kw . get ( 'mt' , False ) : t . append ( '-mt' ) if kw . get ( 'abi' , None ) : t . append ( '%s%s' % ( is_static and '-s' or '-' , kw [ 'abi' ] ) ) elif is_static : t . append ( '-s' ) tags_pat = t and '' . join ( t ) or '' ext = is_static and self . env . cxxstlib_PATTERN or self . env . cxxshlib_PATTERN ext = ext . partition ( '%s' ) [ 2 ] # remove '%s' or 'lib%s' from PATTERN for lib in lib_names : if lib == 'python' : # for instance, with python='27', # accepts '-py27', '-py2', '27' and '2' # but will reject '-py3', '-py26', '26' and '3' tags = '({0})?((-py{2})|(-py{1}(?=[^0-9]))|({2})|({1}(?=[^0-9]))|(?=[^0-9])(?!-py))' . format ( tags_pat , kw [ 'python' ] [ 0 ] , kw [ 'python' ] ) else : tags = tags_pat # Trying libraries, from most strict match to least one for pattern in [ 'boost_%s%s%s%s%s$' % ( lib , toolset_pat , tags , version , ext ) , 'boost_%s%s%s%s$' % ( lib , tags , version , ext ) , # Give up trying to find the right version 'boost_%s%s%s%s$' % ( lib , toolset_pat , tags , ext ) , 'boost_%s%s%s$' % ( lib , tags , ext ) , 'boost_%s%s$' % ( lib , ext ) , 'boost_%s' % lib ] : self . to_log ( 'Trying pattern %s' % pattern ) file = find_lib ( re . compile ( pattern ) , files ) if file : libs . append ( format_lib_name ( file . name ) ) break else : self . to_log ( 'Failed looking for boost lib %s' % lib ) if kw . get ( 'required' , True ) : self . end_msg ( 'lib %s not found in %s' % ( lib , path . abspath ( ) ) ) self . fatal ( 'The configuration failed' ) return libs return path . abspath ( ) , match_libs ( kw . get ( 'lib' , None ) , False ) , match_libs ( kw . get ( 'stlib' , None ) , True )