# Path: waflib/Configure.py
# def conf(f):
# 	"""
# 	Decorator: attach new configuration functions to :py:class:`waflib.Build.BuildContext` and
# 	:py:class:`waflib.Configure.ConfigurationContext`. The methods bound will accept a parameter
# 	named 'mandatory' to disable the configuration errors::
# 
# 		def configure(conf):
# 			conf.find_program('abc', mandatory=False)
# 
# 	:param f: method to bind
# 	:type f: function
# 	"""
# 	def fun(*k, **kw):
# 		mandatory = kw.pop('mandatory', True)
# 		try:
# 			return f(*k, **kw)
# 		except Errors.ConfigurationError:
# 			if mandatory:
# 				raise
# 
# 	fun.__name__ = f.__name__
# 	setattr(ConfigurationContext, f.__name__, fun)
# 	setattr(Build.BuildContext, f.__name__, fun)
# 	return f


from waflib import Utils, Errors
from waflib.Configure import conf
	kw['features'] = Utils.to_list(kw.get('features', [])) + Utils.to_list(sniff_features(**kw))

@conf
def program(bld, *k, **kw):
	"""
	Alias for creating programs by looking at the file extensions::

		def build(bld):
			bld.program(source='foo.c', target='app')
			# equivalent to:
			# bld(features='c cprogram', source='foo.c', target='app')

	"""
	set_features(kw, 'program')
	return bld(*k, **kw)

@conf
def shlib(bld, *k, **kw):
	"""
	Alias for creating shared libraries by looking at the file extensions::

		def build(bld):
			bld.shlib(source='foo.c', target='app')
			# equivalent to:
			# bld(features='c cshlib', source='foo.c', target='app')

	"""
	set_features(kw, 'shlib')
	return bld(*k, **kw)


# Path: waflib/Configure.py
# def conf(f):
# 	"""
# 	Decorator: attach new configuration functions to :py:class:`waflib.Build.BuildContext` and
# 	:py:class:`waflib.Configure.ConfigurationContext`. The methods bound will accept a parameter
# 	named 'mandatory' to disable the configuration errors::
# 
# 		def configure(conf):
# 			conf.find_program('abc', mandatory=False)
# 
# 	:param f: method to bind
# 	:type f: function
# 	"""
# 	def fun(*k, **kw):
# 		mandatory = kw.pop('mandatory', True)
# 		try:
# 			return f(*k, **kw)
# 		except Errors.ConfigurationError:
# 			if mandatory:
# 				raise
# 
# 	fun.__name__ = f.__name__
# 	setattr(ConfigurationContext, f.__name__, fun)
# 	setattr(Build.BuildContext, f.__name__, fun)
# 	return f


# Path: waflib/Tools/c_aliases.py
from waflib import Utils, Errors
from waflib.Configure import conf

	kw['features'] = Utils.to_list(kw.get('features', [])) + Utils.to_list(sniff_features(**kw))

@conf
def program(bld, *k, **kw):
	"""
	Alias for creating programs by looking at the file extensions::

		def build(bld):
			bld.program(source='foo.c', target='app')
			# equivalent to:
			# bld(features='c cprogram', source='foo.c', target='app')

	"""
	set_features(kw, 'program')
	return bld(*k, **kw)

@conf
def shlib(bld, *k, **kw):
	"""
	Alias for creating shared libraries by looking at the file extensions::

		def build(bld):
			bld.shlib(source='foo.c', target='app')
			# equivalent to:
			# bld(features='c cshlib', source='foo.c', target='app')

	"""
	set_features(kw, 'shlib')
	return bld(*k, **kw)


@conf