# 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.Configure import conf
import waflib.Context
	import os
#!/usr/bin/env python
# encoding: utf-8
# DragoonX6 2018

"""
Common routines for cross_clang.py and cross_clangxx.py
"""


def normalize_target_triple(target_triple):
	target_triple = target_triple[:-1]
	normalized_triple = target_triple.replace('--', '-unknown-')

	if normalized_triple.startswith('-'):
		normalized_triple = 'unknown' + normalized_triple

	if normalized_triple.endswith('-'):
		normalized_triple += 'unknown'

	# Normalize MinGW builds to *arch*-w64-mingw32
	if normalized_triple.endswith('windows-gnu'):
		normalized_triple = normalized_triple[:normalized_triple.index('-')] + '-w64-mingw32'

	# Strip the vendor when doing msvc builds, since it's unused anyway.
	if normalized_triple.endswith('windows-msvc'):
		normalized_triple = normalized_triple[:normalized_triple.index('-')] + '-windows-msvc'

	return normalized_triple.replace('-', '_')


# 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/extras/clang_cross_common.py
from waflib.Configure import conf
import waflib.Context
	import os

#!/usr/bin/env python
# encoding: utf-8
# DragoonX6 2018

"""
Common routines for cross_clang.py and cross_clangxx.py
"""


def normalize_target_triple(target_triple):
	target_triple = target_triple[:-1]
	normalized_triple = target_triple.replace('--', '-unknown-')

	if normalized_triple.startswith('-'):
		normalized_triple = 'unknown' + normalized_triple

	if normalized_triple.endswith('-'):
		normalized_triple += 'unknown'

	# Normalize MinGW builds to *arch*-w64-mingw32
	if normalized_triple.endswith('windows-gnu'):
		normalized_triple = normalized_triple[:normalized_triple.index('-')] + '-w64-mingw32'

	# Strip the vendor when doing msvc builds, since it's unused anyway.
	if normalized_triple.endswith('windows-msvc'):
		normalized_triple = normalized_triple[:normalized_triple.index('-')] + '-windows-msvc'

	return normalized_triple.replace('-', '_')


@conf