wscript 6.42 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',
31
32
    'jack_midi_latency_test' : 'midi_latency_test.c',
    'jack_simdtests' : 'simdtests.cpp'
nedko's avatar
nedko committed
33
34
35
36
37
38
39
    }

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

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

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

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

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

69
        prog = bld(features='c cprogram')
70
        prog.includes = os_incdir + ['../common/jack', '../common']
nedko's avatar
nedko committed
71
        prog.source = example_program_source
72
        prog.use = use
73
        if bld.env['IS_MACOSX']:
74
75
            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
76
            prog.env.append_value("LINKFLAGS", "")
77
        if bld.env['IS_LINUX']:
78
            prog.use += ['RT', 'M']
sletz's avatar
sletz committed
79
        if bld.env['IS_SUN']:
80
            prog.use += ['M']
81

nedko's avatar
nedko committed
82
        prog.target = example_program
83
   
sletz's avatar
sletz committed
84
    if bld.env['BUILD_EXAMPLE_CLIENT_TRANSPORT']:
85
        prog = bld(features = 'c cprogram')
86
        prog.includes = os_incdir + ['../common/jack', '../common']
nedko's avatar
nedko committed
87
        prog.source = 'transport.c'
88
        prog.use = ['clientlib']
89
        if bld.env['IS_MACOSX']:
90
91
            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
92
            prog.env.append_value("LINKFLAGS", "")
93
        if bld.env['IS_LINUX']:
Adrian Knoth's avatar
Adrian Knoth committed
94
            prog.use += ['RT', 'READLINE']
95
        if bld.env['IS_MACOSX']:
Adrian Knoth's avatar
Adrian Knoth committed
96
            prog.use += ['READLINE']
97
98
        if bld.env['IS_WINDOWS']:
            prog.use += ['READLINE']
nedko's avatar
nedko committed
99
100
        prog.target = 'jack_transport'

sletz's avatar
sletz committed
101
    if bld.env['BUILD_EXAMPLE_CLIENT_REC']:
102
        prog = bld(features = 'c cprogram')
103
        prog.includes = os_incdir + ['../common/jack', '../common']
nedko's avatar
nedko committed
104
        prog.source = 'capture_client.c'
105
        prog.use = ['clientlib']
106
        if bld.env['IS_MACOSX']:
107
108
            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
109
            prog.env.append_value("LINKFLAGS", "")
110
            prog.use += ['SNDFILE']
111
        if bld.env['IS_LINUX']:
112
            prog.use += ['RT', 'SNDFILE']
sletz's avatar
sletz committed
113
        if bld.env['IS_SUN']:
114
            prog.use += ['RT', 'SNDFILE']
farwayer's avatar
farwayer committed
115
        if bld.env['IS_WINDOWS']:
116
            prog.uselib = ['SNDFILE']
nedko's avatar
nedko committed
117
118
        prog.target = 'jack_rec'

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

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

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

Adrian Knoth's avatar
Adrian Knoth committed
143
    for example_lib, example_lib_source in list(example_libs.items()):
144
        lib = bld(features = 'c cshlib')
145
146
        if not bld.env['IS_WINDOWS']:
            lib.env['cshlib_PATTERN'] = '%s.so'
147
        lib.includes = os_incdir + ['../common/jack', '../common']
nedko's avatar
nedko committed
148
149
        lib.target = example_lib
        lib.source = example_lib_source
150
        if bld.env['IS_MACOSX']:
151
152
            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
153
            lib.env.append_value("LINKFLAGS", "")
sletz's avatar
sletz committed
154
        if bld.env['IS_SUN']:
Adrian Knoth's avatar
Adrian Knoth committed
155
            lib.env.append_value("LINKFLAGS", "-lm")
156
        lib.use = 'serverlib'
157
        lib.install_path = '${ADDON_DIR}/'
158

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