merge with master.
[ardour.git] / libs / ardouralsautil / wscript
1 #!/usr/bin/env python
2 from waflib.extras import autowaf as autowaf
3 from waflib import Options
4 import os
5 import sys
6 import re
7
8 # Mandatory variables
9 top = '.'
10 out = 'build'
11
12 path_prefix = 'libs/ardouralsautil/'
13
14 def options(opt):
15     autowaf.set_options(opt)
16
17
18 def configure(conf):
19     autowaf.configure(conf)
20     if re.search ("linux", sys.platform) != None and Options.options.dist_target != 'mingw':
21         autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA')
22         autowaf.check_pkg(conf, 'dbus-1', uselib_store='DBUS', mandatory = False)
23
24 def build(bld):
25     if re.search ("linux", sys.platform) != None:
26         if bld.is_defined('HAVE_ALSA'):
27             obj = bld(features = 'cxx cxxshlib')
28             obj.source = [
29                 'devicelist.cc'
30             ]
31             obj.export_includes = ['.']
32             obj.includes = ['.']
33             obj.name     = 'ardouralsautil'
34             obj.target   = 'ardouralsautil'
35             obj.use      = 'libpbd'
36             obj.uselib   = [ 'ALSA' ]
37             obj.vnum     = '0.0.1'
38             obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardouralsautil')
39
40         if bld.env['BUILD_ALSABACKEND'] and bld.is_defined('HAVE_ALSA') and bld.is_defined('HAVE_DBUS'):
41             obj = bld(features = 'c cprogram')
42             obj.source = [
43                 'reserve.c',
44                 'request_device.c'
45             ]
46             obj.includes = ['.']
47             obj.target   = 'ardour-request-device'
48             obj.uselib   = [ 'DBUS' ]
49             obj.install_path = os.path.join(bld.env['LIBDIR'])
50             obj.defines = [
51                     '_POSIX_SOURCE',
52                     '_XOPEN_SOURCE=500',
53                     'ARD_PROG_NAME="ardour-request-device"',
54                     'ARD_APPL_NAME="Ardour ALSA Backend"',
55             ]