wscript 3.09 KB
Newer Older
1
2
3
#! /usr/bin/env python
# encoding: utf-8

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

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

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

14
def create_jack_driver_obj(bld, target, sources, uselib = None):
15
    driver = bld.new_task_gen('cxx', 'shlib')
nedko's avatar
nedko committed
16
17
    driver.features.append('cc')
    driver.env['shlib_PATTERN'] = 'jack_%s.so'
Torben Hohn's avatar
Torben Hohn committed
18
    driver.defines = ['HAVE_CONFIG_H','SERVER_SIDE', 'HAVE_PPOLL']
Torben Hohn's avatar
Torben Hohn committed
19
20
21
22
23
    if bld.env['HAVE_CELT']:
	if bld.env['HAVE_CELT_API_0_5']:
	    driver.defines +=  ['HAVE_CELT', 'HAVE_CELT_API_0_5']
	elif bld.env['HAVE_CELT_API_0_7']:
	    driver.defines +=  ['HAVE_CELT', 'HAVE_CELT_API_0_7']
24
    driver.includes = ['.', '../linux', '../posix', '../common', '../common/jack', '../dbus']
nedko's avatar
nedko committed
25
26
    driver.target = target
    driver.source = sources
27
    driver.install_path = '${ADDON_DIR}/'
28
29
    if uselib:
        driver.uselib = uselib
30
    driver.uselib_local = 'serverlib'
nedko's avatar
nedko committed
31
32
    return driver

33
def build(bld):
34
35
36
37
38
    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']
39
40
41
42
43
	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'		
44
45
        jackd.uselib_local = 'serverlib'
        jackd.target = 'jackd'
46
  	
nedko's avatar
nedko committed
47
    create_jack_driver_obj(bld, 'dummy', '../common/JackDummyDriver.cpp')
48
49
50
51
52
53
54
55
56
57
58
    
    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'
                       ]
59

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

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

66
    if bld.env['BUILD_DRIVER_FFADO'] == True:
67
        create_jack_driver_obj(bld, 'firewire', 'firewire/JackFFADODriver.cpp', "LIBFFADO")
sletz's avatar
sletz committed
68
69
70

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

71
    create_jack_driver_obj(bld, 'loopback', '../common/JackLoopbackDriver.cpp')
Torben Hohn's avatar
Torben Hohn committed
72
73
74
75
76

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