# Path: core/waf/common.py
# def conf(f):
# 	def fun(*k,**kw):
# 		mandatory=True
# 		if'mandatory'in kw:
# 			mandatory=kw['mandatory']
# 			del kw['mandatory']
# 		try:
# 			return f(*k,**kw)
# 		except Errors.ConfigurationError as e:
# 			if mandatory:
# 				raise e
# 	setattr(Options.OptionsContext,f.__name__,fun)
# 	setattr(Configure.ConfigurationContext,f.__name__,fun)
# 	setattr(Build.BuildContext,f.__name__,fun)
# 	return f


import os
import sys
import shutil
from waflib import Errors, Context, Utils, Logs
from waflib.Logs import debug, error
from waflib.Tools import c_preproc
from core.waf.common import conf
                build_cmd % kw, 
                #(build_cmd % kw).split(' '), 
                output=Context.BOTH, 
                shell=True,
                cwd=kw.get("build_cwd",kw["build"]) % kw
            )
            self.end_msg("Ok")
        
        if not os.path.exists(kw["prefix"]):
            self.start_msg("  Install %s" % kw["name"])
            self.cmd_and_log(
                install_cmd % kw, 
                #(install_cmd % kw).split(' '), 
                output=Context.BOTH, 
                shell=True,
                cwd=kw.get("install_cwd",kw["build"]) % kw
            )
            self.end_msg("Ok")
    else:
        self.end_msg("Already done")

conf(dep_build)

def dep_path(self, name, version, *k, **kw):
    kw.update({
        "name": name,
        "version": version
    })
    k, kw = base(self, *k, **kw)
    return kw["prefix"]

# Path: core/waf/common.py
# def conf(f):
# 	def fun(*k,**kw):
# 		mandatory=True
# 		if'mandatory'in kw:
# 			mandatory=kw['mandatory']
# 			del kw['mandatory']
# 		try:
# 			return f(*k,**kw)
# 		except Errors.ConfigurationError as e:
# 			if mandatory:
# 				raise e
# 	setattr(Options.OptionsContext,f.__name__,fun)
# 	setattr(Configure.ConfigurationContext,f.__name__,fun)
# 	setattr(Build.BuildContext,f.__name__,fun)
# 	return f


# Path: core/waf/dependency.py
import os
import sys
import shutil
from waflib import Errors, Context, Utils, Logs
from waflib.Logs import debug, error
from waflib.Tools import c_preproc
from core.waf.common import conf

                build_cmd % kw, 
                #(build_cmd % kw).split(' '), 
                output=Context.BOTH, 
                shell=True,
                cwd=kw.get("build_cwd",kw["build"]) % kw
            )
            self.end_msg("Ok")
        
        if not os.path.exists(kw["prefix"]):
            self.start_msg("  Install %s" % kw["name"])
            self.cmd_and_log(
                install_cmd % kw, 
                #(install_cmd % kw).split(' '), 
                output=Context.BOTH, 
                shell=True,
                cwd=kw.get("install_cwd",kw["build"]) % kw
            )
            self.end_msg("Ok")
    else:
        self.end_msg("Already done")

conf(dep_build)

def dep_path(self, name, version, *k, **kw):
    kw.update({
        "name": name,
        "version": version
    })
    k, kw = base(self, *k, **kw)
    return kw["prefix"]

conf(dep_path)