wscript 6.38 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
#! /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_alias' : 'alias.c',
    'jack_bufsize' : 'bufsize.c',
sletz's avatar
sletz committed
18
19
    'jack_wait' : 'wait.c',
    'jack_samplerate' : 'samplerate.c',
nedko's avatar
nedko committed
20
21
    'jack_evmon' : 'evmon.c',
    'jack_monitor_client' : 'monitor_client.c',
22
    'jack_thru' : 'thru_client.c',
sletz's avatar
sletz committed
23
    'jack_cpu_load' : 'cpu_load.c',
sletz's avatar
sletz committed
24
25
    'jack_simple_session_client' : 'simple_session_client.c',
    'jack_session_notify' : 'session_notify.c',
26
    'jack_server_control' : 'server_control.cpp',
27
28
    'jack_net_slave' : 'netslave.c',
    'jack_net_master' : 'netmaster.c',
sletz's avatar
sletz committed
29
30
    'jack_latent_client' : 'latent_client.c',
    'jack_midi_dump' : 'midi_dump.c',
sletz's avatar
sletz committed
31
    'jack_midi_latency_test' : 'midi_latency_test.c'
nedko's avatar
nedko committed
32
33
34
35
36
37
38
    }

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

def configure(conf):
Karl Lindén's avatar
Karl Lindén committed
39
    conf.env['BUILD_EXAMPLE_CLIENT_TRANSPORT'] = conf.env['READLINE']
nedko's avatar
nedko committed
40

41
    conf.env['BUILD_EXAMPLE_CLIENT_REC'] = conf.env['SNDFILE']
nedko's avatar
nedko committed
42

43
    conf.env['BUILD_EXAMPLE_ALSA_IO'] = conf.env['SAMPLERATE'] and conf.env['BUILD_DRIVER_ALSA']
sletz's avatar
sletz committed
44

nedko's avatar
nedko committed
45
def build(bld):
46
    if bld.env['IS_LINUX']:
47
        os_incdir = ['../linux', '../posix']
48
    if bld.env['IS_MACOSX']:
49
        os_incdir = ['../macosx', '../posix']
sletz's avatar
sletz committed
50
51
    if bld.env['IS_SUN']:
        os_incdir = ['../solaris', '../posix']
52
53
    if bld.env['IS_WINDOWS']:
        os_incdir = ['../windows']
Adrian Knoth's avatar
Adrian Knoth committed
54
    for example_program, example_program_source in list(example_programs.items()):
55
        if example_program == 'jack_server_control':
56
            use = ['serverlib', 'STDC++']
57
58
59
        elif example_program == 'jack_net_slave':
            if not bld.env['BUILD_NETLIB']:
                continue
60
            use = ['netlib']
61
62
63
        elif example_program == 'jack_net_master':
            if not bld.env['BUILD_NETLIB']:
                continue
64
            use = ['netlib']
65
        else:
66
            use = ['clientlib']
67

68
        prog = bld(features='c cprogram')
69
        prog.includes = os_incdir + ['../common/jack', '../common']
nedko's avatar
nedko committed
70
        prog.source = example_program_source
71
        prog.use = use
72
        if bld.env['IS_MACOSX']:
73
74
            prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc -arch x86_64")
            #prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc -arch x86_64")
sletz's avatar
sletz committed
75
            prog.env.append_value("LINKFLAGS", "")
76
        if bld.env['IS_LINUX']:
77
            prog.use += ['RT', 'M']
sletz's avatar
sletz committed
78
        if bld.env['IS_SUN']:
79
            prog.use += ['M']
80

nedko's avatar
nedko committed
81
        prog.target = example_program
82
   
sletz's avatar
sletz committed
83
    if bld.env['BUILD_EXAMPLE_CLIENT_TRANSPORT']:
84
        prog = bld(features = 'c cprogram')
85
        prog.includes = os_incdir + ['../common/jack', '../common']
nedko's avatar
nedko committed
86
        prog.source = 'transport.c'
87
        prog.use = ['clientlib']
88
        if bld.env['IS_MACOSX']:
89
90
            prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc -arch x86_64")
            #prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc -arch x86_64")
sletz's avatar
sletz committed
91
            prog.env.append_value("LINKFLAGS", "")
92
        if bld.env['IS_LINUX']:
Adrian Knoth's avatar
Adrian Knoth committed
93
            prog.use += ['RT', 'READLINE']
94
        if bld.env['IS_MACOSX']:
Adrian Knoth's avatar
Adrian Knoth committed
95
            prog.use += ['READLINE']
96
97
        if bld.env['IS_WINDOWS']:
            prog.use += ['READLINE']
nedko's avatar
nedko committed
98
99
        prog.target = 'jack_transport'

sletz's avatar
sletz committed
100
    if bld.env['BUILD_EXAMPLE_CLIENT_REC']:
101
        prog = bld(features = 'c cprogram')
102
        prog.includes = os_incdir + ['../common/jack', '../common']
nedko's avatar
nedko committed
103
        prog.source = 'capture_client.c'
104
        prog.use = ['clientlib']
105
        if bld.env['IS_MACOSX']:
106
107
            prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc -arch x86_64")
            #prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc -arch x86_64")
sletz's avatar
sletz committed
108
            prog.env.append_value("LINKFLAGS", "")
109
            prog.use += ['SNDFILE']
110
        if bld.env['IS_LINUX']:
111
            prog.use += ['RT', 'SNDFILE']
sletz's avatar
sletz committed
112
        if bld.env['IS_SUN']:
113
            prog.use += ['RT', 'SNDFILE']
farwayer's avatar
farwayer committed
114
        if bld.env['IS_WINDOWS']:
115
            prog.uselib = ['SNDFILE']
nedko's avatar
nedko committed
116
117
        prog.target = 'jack_rec'

sletz's avatar
sletz committed
118
    if bld.env['IS_LINUX'] or bld.env['IS_MACOSX']:
119
        prog = bld(features = 'c cprogram')
Robin Gareus's avatar
Robin Gareus committed
120
        prog.includes = os_incdir + ['.', '..', '../common/jack', '../common']
sletz's avatar
sletz committed
121
        prog.source = ['netsource.c', '../common/netjack_packet.c']
122
        prog.env.append_value("CFLAGS", "-DNO_JACK_ERROR")
Nedko Arnaudov's avatar
Nedko Arnaudov committed
123
        prog.use = ['CELT', 'SAMPLERATE', 'OPUS', 'M', 'clientlib']
sletz's avatar
sletz committed
124
        prog.target = 'jack_netsource'
125
        prog.defines = ['HAVE_CONFIG_H']
sletz's avatar
sletz committed
126
127

    if bld.env['IS_LINUX'] and bld.env['BUILD_EXAMPLE_ALSA_IO']:
128
        prog = bld(features = 'c cprogram')
Adrian Knoth's avatar
Adrian Knoth committed
129
130
        prog.includes = os_incdir + ['../common/jack', '../common']
        prog.source = ['alsa_in.c', '../common/memops.c']
131
        prog.env.append_value("CFLAGS", "-DNO_JACK_ERROR")
132
        prog.use = ['clientlib', 'ALSA', 'SAMPLERATE', 'M']
Adrian Knoth's avatar
Adrian Knoth committed
133
134
        prog.target = 'alsa_in'

135
        prog = bld(features = 'c cprogram')
Adrian Knoth's avatar
Adrian Knoth committed
136
137
        prog.includes = os_incdir + ['../common/jack', '../common']
        prog.source = ['alsa_out.c', '../common/memops.c']
138
        prog.env.append_value("CFLAGS", "-DNO_JACK_ERROR")
139
        prog.use = ['clientlib', 'ALSA', 'SAMPLERATE', 'M']
Adrian Knoth's avatar
Adrian Knoth committed
140
        prog.target = 'alsa_out'
sletz's avatar
sletz committed
141

Adrian Knoth's avatar
Adrian Knoth committed
142
    for example_lib, example_lib_source in list(example_libs.items()):
143
        lib = bld(features = 'c cshlib')
144
145
        if not bld.env['IS_WINDOWS']:
            lib.env['cshlib_PATTERN'] = '%s.so'
146
        lib.includes = os_incdir + ['../common/jack', '../common']
nedko's avatar
nedko committed
147
148
        lib.target = example_lib
        lib.source = example_lib_source
149
        if bld.env['IS_MACOSX']:
150
151
            lib.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc -arch x86_64")
            #lib.env.append_value("LINKFLAGS", "-arch i386 -arch ppc -arch x86_64")
sletz's avatar
sletz committed
152
            lib.env.append_value("LINKFLAGS", "")
sletz's avatar
sletz committed
153
        if bld.env['IS_SUN']:
Adrian Knoth's avatar
Adrian Knoth committed
154
            lib.env.append_value("LINKFLAGS", "-lm")
155
        lib.use = 'serverlib'
156
        lib.install_path = '${ADDON_DIR}/'
157

158
159
160
    if not bld.env['IS_WINDOWS']:
        bld.symlink_as('${PREFIX}/bin/jack_disconnect', 'jack_connect')
        bld.install_files('${PREFIX}/bin', 'jack_control', chmod=0o755)