from waflib import Utils

def build(bld):
    bld(features = 'c cprogram',
        target = 'xmms2-mlib-updater',
        source = ['main.c'],
        includes = '. ../../.. ../../include',
        uselib = 'glib2 gio2 gthread2',
        use = 'xmmsclient-glib xmmsclient'
        )

    bld(features = 'subst',
        target = 'xmms2-mlib-updater.sh',
        source = 'xmms2-mlib-updater.sh.in',
        install_path = '${SCRIPTDIR}',
        chmod = Utils.O755,
        PRG_PATH=bld.env.BINDIR
        )


def configure(conf):
    conf.check_cfg(package="gio-2.0", uselib_store='gio2',
            args="--cflags --libs")
    conf.check_cfg(package="gthread-2.0", uselib_store='gthread2',
            args="--cflags --libs")

    conf.check_cc(function_name="g_file_query_file_type",
            header_name="gio/gio.h", uselib="gio2", mandatory=False)


def options(opt):
    pass
