Skip to content

Commit

Permalink
[wscript] Enable IIO driver
Browse files Browse the repository at this point in the history
  • Loading branch information
adiknoth committed Feb 14, 2014
1 parent 5d9c00d commit 3069c74
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions linux/wscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#! /usr/bin/env python
# encoding: utf-8

from waflib import Context

def configure(conf):
conf.check_cfg(package='alsa', atleast_version='1.0.18', args='--cflags --libs', mandatory=False)
conf.env['BUILD_DRIVER_ALSA'] = conf.is_defined('HAVE_ALSA')
Expand All @@ -13,6 +15,14 @@ def configure(conf):

conf.define('HAVE_PPOLL', 1 )

conf.check_cfg(package='gtkIOStream', atleast_version='1.4.0', args='--cflags --libs', mandatory=False)
conf.env['BUILD_DRIVER_IIO'] = conf.is_defined('HAVE_GTKIOSTREAM')
conf.check_cfg(package='eigen3', atleast_version='3.1.2', args='--cflags --libs', mandatory=False)
conf.env['BUILD_DRIVER_IIO'] += conf.is_defined('HAVE_EIGEN3')
conf.check_cfg(package='sox', atleast_version='14.4.0', args='--cflags --libs', mandatory=False)
conf.env['BUILD_DRIVER_IIO'] += conf.is_defined('HAVE_SOX')


def create_jack_driver_obj(bld, target, sources, uselib = None):
driver = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib'])
driver.env['cxxshlib_PATTERN'] = 'jack_%s.so'
Expand Down Expand Up @@ -74,6 +84,8 @@ def build(bld):
'firewire/JackFFADOMidiSendQueue.cpp'
]

iio_driver_src = ['iio/JackIIODriver.cpp']

if bld.env['BUILD_DRIVER_ALSA'] == True:
create_jack_driver_obj(bld, 'alsa', alsa_driver_src, ["ALSA"])
create_jack_driver_obj(bld, 'alsarawmidi', alsarawmidi_driver_src,
Expand All @@ -85,6 +97,9 @@ def build(bld):
if bld.env['BUILD_DRIVER_FFADO'] == True:
create_jack_driver_obj(bld, 'firewire', ffado_driver_src, ["LIBFFADO"])

if bld.env['BUILD_DRIVER_IIO'] == True:
create_jack_driver_obj(bld, 'iio', iio_driver_src, ["GTKIOSTREAM", "EIGEN3"])

create_jack_driver_obj(bld, 'net', '../common/JackNetDriver.cpp')

create_jack_driver_obj(bld, 'loopback', '../common/JackLoopbackDriver.cpp')
Expand Down
5 changes: 5 additions & 0 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def options(opt):
opt.add_option('--firewire', action='store_true', default=False, help='Enable FireWire driver (FFADO)')
opt.add_option('--freebob', action='store_true', default=False, help='Enable FreeBob driver')
opt.add_option('--alsa', action='store_true', default=False, help='Enable ALSA driver')
opt.add_option('--iio', action='store_true', default=False, help='Enable IIO driver')
opt.add_option('--autostart', type='string', default="default", help='Autostart method. Possible values: "default", "classic", "dbus", "none"')
opt.add_option('--portaudio', action='store_true', default=False, help='Enable Portaudio driver')
opt.add_option('--winmme', action='store_true', default=False, help='Enable WinMME driver')
Expand Down Expand Up @@ -149,9 +150,12 @@ def configure(conf):
conf.fatal('FreeBob driver was explicitly requested but cannot be built')
if Options.options.firewire and not conf.env['BUILD_DRIVER_FFADO']:
conf.fatal('FFADO driver was explicitly requested but cannot be built')
if Options.options.iio and not conf.env['BUILD_DRIVER_IIO']:
conf.fatal('IIO driver was explicitly requested but cannot be built')
conf.env['BUILD_DRIVER_ALSA'] = Options.options.alsa
conf.env['BUILD_DRIVER_FFADO'] = Options.options.firewire
conf.env['BUILD_DRIVER_FREEBOB'] = Options.options.freebob
conf.env['BUILD_DRIVER_IIO'] = Options.options.iio
if conf.env['IS_WINDOWS']:
conf.sub_config('windows')
if Options.options.portaudio and not conf.env['BUILD_DRIVER_PORTAUDIO']:
Expand Down Expand Up @@ -350,6 +354,7 @@ def configure(conf):
display_feature('Build with ALSA support', conf.env['BUILD_DRIVER_ALSA'] == True)
display_feature('Build with FireWire (FreeBob) support', conf.env['BUILD_DRIVER_FREEBOB'] == True)
display_feature('Build with FireWire (FFADO) support', conf.env['BUILD_DRIVER_FFADO'] == True)
display_feature('Build with IIO support', conf.env['BUILD_DRIVER_IIO'] == True)

if conf.env['IS_WINDOWS']:
display_feature('Build with WinMME support', conf.env['BUILD_DRIVER_WINMME'] == True)
Expand Down

0 comments on commit 3069c74

Please sign in to comment.