wscript 2.76 KB
Newer Older
nedko's avatar
nedko committed
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
#! /usr/bin/env python
# encoding: utf-8

example_programs = {
    'jack_freewheel' : 'freewheel.c',
    'jack_connect' : 'connect.c',
    'jack_lsp' : 'lsp.c',
    'jack_metro' : 'metro.c',
    'jack_midiseq' : 'midiseq.c',
    'jack_midisine' : 'midisine.c',
    'jack_showtime' : 'showtime.c',
    'jack_simple_client' : 'simple_client.c',
    'jack_zombie' : 'zombie.c',
    'jack_load' : 'ipload.c',
    'jack_unload' : 'ipunload.c',
    'jack_showtime' : 'showtime.c',
    'jack_alias' : 'alias.c',
    'jack_bufsize' : 'bufsize.c',
    'jack_evmon' : 'evmon.c',
    'jack_monitor_client' : 'monitor_client.c',
    }

example_libs = {
    'inprocess' : 'inprocess.c',
    }

def configure(conf):
    e = conf.create_header_configurator()
    e.name = 'sndfile.h'
    e.define = 'HAVE_SNDFILE'
    e.run()

    if conf.is_defined('HAVE_SNDFILE'):
        conf.env['LIB_SNDFILE'] = ['sndfile']

    e = conf.create_header_configurator()
    e.name = 'ncurses.h'
    e.define = 'HAVE_NCURSES'
    e.run()

    if conf.is_defined('HAVE_NCURSES'):
        conf.env['LIB_NCURSES'] = ['ncurses']

    e = conf.create_library_configurator()
    e.name = 'readline'
    e.define = 'HAVE_READLINE'
    e.run()

49
50
    if conf.is_defined('HAVE_READLINE'):
        conf.env['LIB_READLINE'] = ['readline']
nedko's avatar
nedko committed
51
52
53

    conf.env['BUILD_EXAMPLE_CLIENT_TRANSPORT'] = conf.is_defined('HAVE_READLINE') and conf.is_defined('HAVE_NCURSES')

54
    conf.env['BUILD_EXAMPLE_CLIENT_REC'] = conf.is_defined('HAVE_SNDFILE')
nedko's avatar
nedko committed
55
56
57
58

def build(bld):
    for example_program, example_program_source in example_programs.items():
        prog = bld.create_obj('cc', 'program')
59
        prog.includes = ['../common/jack', '../common']
nedko's avatar
nedko committed
60
61
62
63
64
65
66
        prog.source = example_program_source
        prog.uselib = 'RT'
        prog.uselib_local = 'clientlib'
        prog.target = example_program

    if bld.env()['BUILD_EXAMPLE_CLIENT_TRANSPORT'] == True:
        prog = bld.create_obj('cc', 'program')
67
        prog.includes = ['../common/jack', '../common']
nedko's avatar
nedko committed
68
69
70
71
72
        prog.source = 'transport.c'
        prog.uselib = 'RT READLINE NCURSES'
        prog.uselib_local = 'clientlib'
        prog.target = 'jack_transport'

73
    if bld.env()['BUILD_EXAMPLE_CLIENT_REC'] == True:
nedko's avatar
nedko committed
74
        prog = bld.create_obj('cc', 'program')
75
        prog.includes = ['../common/jack', '../common']
nedko's avatar
nedko committed
76
77
78
79
80
81
82
83
        prog.source = 'capture_client.c'
        prog.uselib = 'RT SNDFILE'
        prog.uselib_local = 'clientlib'
        prog.target = 'jack_rec'

    for example_lib, example_lib_source in example_libs.items():
        lib = bld.create_obj('cc', 'shlib')
        lib.env['shlib_PATTERN'] = '%s.so'
84
        lib.includes = ['../common/jack', '../common']
nedko's avatar
nedko committed
85
86
        lib.target = example_lib
        lib.source = example_lib_source
87
88
        lib.inst_var = bld.env()['ADDON_DIR']
        lib.inst_dir = '/'