Mercurial > audlegacy-plugins
diff src/daap/xmms2-daap/wscript @ 1407:776dd8fc2b38
DAAP plugin (work in progress)
author | Cristi Magherusan <majeru@atheme-project.org> |
---|---|
date | Sun, 05 Aug 2007 00:26:21 +0300 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/daap/xmms2-daap/wscript Sun Aug 05 00:26:21 2007 +0300 @@ -0,0 +1,36 @@ +from waftools.plugin import plugin +from Params import g_platform + +def plugin_configure(conf): + # Set the default fallthrough, if no "intelligent" backend is found. + conf.env['XMMS_DAAP_BACKEND'] = 'dummy' + + # First look for Avahi mdns support + if (conf.check_pkg("avahi-glib", destvar='avahiglib') and + conf.check_pkg("avahi-client", destvar='avahiclient')): + # Avahi found + conf.env['XMMS_DAAP_BACKEND'] = 'avahi' + elif conf.check_header('dns_sd.h'): + # We might have dnssd support. If we're not on OSX, check for the + # presence of the lib. + if g_platform == 'darwin': + conf.env['XMMS_DAAP_BACKEND'] = 'dnssd' + elif conf.check_library2('dns_sd', uselib='dnssd', mandatory=0): + conf.env['XMMS_DAAP_BACKEND'] = 'dnssd' + return True + +def plugin_build(bld, obj): + daap_backend = bld.env_of_name('default')['XMMS_DAAP_BACKEND'] + obj.source.append("daap_mdns_%s.c" % daap_backend) + if daap_backend == 'avahi': + obj.uselib += ' avahiglib avahiclient' + elif daap_backend == 'dnssd': + obj.uselib += ' dnssd' + if g_platform == 'win32': + obj.uselib += ' socket' + +configure, build = plugin('daap', configure=plugin_configure, + extra_libs=['curl'], build=plugin_build, + source="""daap_xform.c daap_cmd.c daap_conn.c + daap_util.c daap_md5.c cc_handlers.c + """.split())