wscript 4.74 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
#! /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',
21
    'jack_thru' : 'thru_client.c',
sletz's avatar
sletz committed
22
    'jack_cpu_load' : 'cpu_load.c',
23
    'jack_server_control' : 'server_control.cpp',
nedko's avatar
nedko committed
24
25
26
27
28
29
30
    }

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

def configure(conf):
31
32
    e = conf.check_cc(header_name='sndfile.h', define_name="HAVE_SNDFILE")
 
nedko's avatar
nedko committed
33
34
35
    if conf.is_defined('HAVE_SNDFILE'):
        conf.env['LIB_SNDFILE'] = ['sndfile']

36
    e = conf.check_cc(header_name='ncurses.h', define_name="HAVE_NCURSES")
nedko's avatar
nedko committed
37
38
39
40

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

41
    e = conf.check_cc(lib='readline', define_name="HAVE_READLINE")
nedko's avatar
nedko committed
42

43
44
    if conf.is_defined('HAVE_READLINE'):
        conf.env['LIB_READLINE'] = ['readline']
nedko's avatar
nedko committed
45
46
47

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

48
    conf.env['BUILD_EXAMPLE_CLIENT_REC'] = conf.is_defined('HAVE_SNDFILE')
nedko's avatar
nedko committed
49
50

def build(bld):
51
    if bld.env['IS_LINUX']:
52
        os_incdir = ['../linux', '../posix']
53
    if bld.env['IS_MACOSX']:
54
        os_incdir = ['../macosx', '../posix']
sletz's avatar
sletz committed
55
56
    if bld.env['IS_SUN']:
        os_incdir = ['../solaris', '../posix']
nedko's avatar
nedko committed
57
    for example_program, example_program_source in example_programs.items():
58
        prog = bld.new_task_gen('cxx', 'program')
59
        prog.features.append('cc')
60
        prog.includes = os_incdir + ['../common/jack', '../common']
nedko's avatar
nedko committed
61
        prog.source = example_program_source
62
        if bld.env['IS_MACOSX']:
63
            prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc")
sletz's avatar
sletz committed
64
65
            #prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc")
            prog.env.append_value("LINKFLAGS", "")
66
        if bld.env['IS_LINUX']:
sletz's avatar
sletz committed
67
            prog.uselib = 'RT'
sletz's avatar
sletz committed
68
69
        if bld.env['IS_SUN']:
            prog.env.append_value("LINKFLAGS", "-lm")
70
71
72
73
        if example_program == 'jack_server_control':
            prog.uselib_local = 'serverlib'
        else:
            prog.uselib_local = 'clientlib'              
nedko's avatar
nedko committed
74
        prog.target = example_program
75
   
76
    #if bld.env['BUILD_EXAMPLE_CLIENT_TRANSPORT']
sletz's avatar
sletz committed
77
    if bld.env['BUILD_EXAMPLE_CLIENT_TRANSPORT'] == True:
78
        prog = bld.new_task_gen('cc', 'program')
79
        prog.includes = os_incdir + ['../common/jack', '../common']
nedko's avatar
nedko committed
80
        prog.source = 'transport.c'
81
        if bld.env['IS_MACOSX']:
82
            prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc")
sletz's avatar
sletz committed
83
84
            #prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc")
            prog.env.append_value("LINKFLAGS", "")
85
        if bld.env['IS_LINUX']:
sletz's avatar
sletz committed
86
            prog.uselib = 'RT READLINE NCURSES'
87
        if bld.env['IS_MACOSX']:
sletz's avatar
sletz committed
88
	    prog.uselib = 'READLINE NCURSES'
nedko's avatar
nedko committed
89
90
91
        prog.uselib_local = 'clientlib'
        prog.target = 'jack_transport'

92
93
    if bld.env['BUILD_EXAMPLE_CLIENT_REC'] == True:
        prog = bld.new_task_gen('cc', 'program')
94
        prog.includes = os_incdir + ['../common/jack', '../common']
nedko's avatar
nedko committed
95
        prog.source = 'capture_client.c'
96
        if bld.env['IS_MACOSX']:
97
            prog.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc")
sletz's avatar
sletz committed
98
99
            #prog.env.append_value("LINKFLAGS", "-arch i386 -arch ppc")
            prog.env.append_value("LINKFLAGS", "")
sletz's avatar
sletz committed
100
            prog.uselib = 'SNDFILE'
101
        if bld.env['IS_LINUX']:
sletz's avatar
sletz committed
102
            prog.uselib = 'RT SNDFILE'
nedko's avatar
nedko committed
103
104
105
106
        prog.uselib_local = 'clientlib'
        prog.target = 'jack_rec'

    for example_lib, example_lib_source in example_libs.items():
107
        lib = bld.new_task_gen('cc', 'shlib')
nedko's avatar
nedko committed
108
        lib.env['shlib_PATTERN'] = '%s.so'
109
        lib.includes = os_incdir + ['../common/jack', '../common']
nedko's avatar
nedko committed
110
111
        lib.target = example_lib
        lib.source = example_lib_source
112
        if bld.env['IS_MACOSX']:
113
            lib.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc")
sletz's avatar
sletz committed
114
115
            #lib.env.append_value("LINKFLAGS", "-arch i386 -arch ppc")
            lib.env.append_value("LINKFLAGS", "")
sletz's avatar
sletz committed
116
117
        if bld.env['IS_SUN']:
	        lib.env.append_value("LINKFLAGS", "-lm")
sletz's avatar
sletz committed
118
        lib.uselib_local = 'serverlib'
119
        lib.install_path = '${ADDON_DIR}/'
120

121
    bld.symlink_as('${PREFIX}/bin/jack_disconnect', 'jack_connect')
nedko's avatar
nedko committed
122

123
    bld.install_files('${PREFIX}/bin', 'jack_control', chmod=0755)