from waflib import Errors
from waftools.plugin import plugin

def plugin_configure(conf):
    try:
        conf.check_cc(header_name="mpc/mpcdec.h")
    except Errors.ConfigurationError:
        conf.check_cc(header_name="mpcdec/mpcdec.h", defines="HAVE_MPCDEC_OLD",
                uselib_store="mpcdec")

    conf.check_cc(lib="mpcdec", uselib_store="mpcdec")

configure, build = plugin("musepack", configure=plugin_configure,
        libs=["mpcdec"])
