from waftools.plugin import plugin

def plugin_configure(conf):
    conf.check_cc(lib="m", uselib_store="math")

    conf.env.DEFINES_mp4 = ['USE_TAGGING']
    # to use iTunes DRM change this to true
    if False:
        conf.env.DEFINES_mp4 += [
            "ITUNES_DRM",
            "HAVE_SYS_STAT_H",
            "HAVE_ERRNO_H",
            "HAVE_LIMITS_H",
            "HAVE_STRING_H"
        ]

def plugin_build(bld, obj):
    obj.source.extend(bld.path.ant_glob("mp4ff/*.c"))

configure, build = plugin("mp4", configure=plugin_configure, build=plugin_build,
                          libs=["mp4", "math", "DISABLE_MISSINGPROTOTYPES"])
