summaryrefslogtreecommitdiff
path: root/linux/wscript
blob: 56a7733047c6cb2021eeeb8720abe4a8945dab34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#! /usr/bin/env python
# encoding: utf-8

def configure(conf):
    conf.check_cfg(package='alsa', atleast_version='1.0.0', args='--cflags --libs')
    conf.env['BUILD_DRIVER_ALSA'] = conf.is_defined('HAVE_ALSA')

    conf. check_cfg(package='libfreebob', atleast_version='1.0.0', args='--cflags --libs')
    conf.env['BUILD_DRIVER_FREEBOB'] = conf.is_defined('HAVE_LIBFREEBOB')

    conf. check_cfg(package='libffado', atleast_version='1.999.17', args='--cflags --libs')
    conf.env['BUILD_DRIVER_FFADO'] = conf.is_defined('HAVE_LIBFFADO')

    conf.define('HAVE_PPOLL', 1 )


def create_jack_driver_obj(bld, target, sources, uselib = None):
    driver = bld.new_task_gen('cxx', 'shlib')
    driver.features.append('cc')
    driver.env['shlib_PATTERN'] = 'jack_%s.so'
    driver.defines = ['HAVE_CONFIG_H','SERVER_SIDE', 'HAVE_PPOLL']
    driver.includes = ['.', '../linux', '../posix', '../common', '../common/jack', '../dbus']
    driver.target = target
    driver.source = sources
    driver.install_path = '${ADDON_DIR}/'
    if uselib:
        driver.uselib = uselib
    driver.uselib_local = 'serverlib'
    return driver

def build(bld):
    if bld.env['BUILD_JACKD'] == True:
        jackd = bld.new_task_gen('cxx', 'program')
        jackd.includes = ['../linux', '../posix', '../common/jack', '../common', '../dbus']
        jackd.defines = 'HAVE_CONFIG_H'
        jackd.source = ['../common/Jackdmp.cpp']
	if bld.env['IS_LINUX'] and bld.env['BUILD_JACKDBUS']: 
            jackd.source += ['../dbus/reserve.c', '../dbus/audio_reserve.c'] 
            jackd.uselib = 'PTHREAD DL RT DBUS-1'
	else:
            jackd.uselib = 'PTHREAD DL RT'		
        jackd.uselib_local = 'serverlib'
        jackd.target = 'jackd'
  	
    create_jack_driver_obj(bld, 'dummy', '../common/JackDummyDriver.cpp')
    
    alsa_driver_src = ['alsa/JackAlsaDriver.cpp',
                       'alsa/alsa_rawmidi.c',
                       'alsa/alsa_seqmidi.c',
                       'alsa/alsa_midi_jackmp.cpp',
                       '../common/memops.c',
                       'alsa/generic_hw.c',
                       'alsa/hdsp.c',
                       'alsa/hammerfall.c',
                       'alsa/ice1712.c'
                       ]

    if bld.env['BUILD_DRIVER_ALSA'] == True:
        create_jack_driver_obj(bld, 'alsa', alsa_driver_src, "ALSA")

    if bld.env['BUILD_DRIVER_FREEBOB'] == True:
        create_jack_driver_obj(bld, 'freebob', 'freebob/JackFreebobDriver.cpp', "LIBFREEBOB")

    if bld.env['BUILD_DRIVER_FFADO'] == True:
        create_jack_driver_obj(bld, 'firewire', 'firewire/JackFFADODriver.cpp', "LIBFFADO")

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

    create_jack_driver_obj(bld, 'loopback', '../common/JackLoopbackDriver.cpp')

    create_jack_driver_obj(bld, 'netone', [ '../common/JackNetOneDriver.cpp',
                                            '../common/netjack.c',
                                            '../common/netjack_packet.c' ], "SAMPLERATE CELT" )