wscript 5.06 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',
24
25
    'jack_net_slave' : 'netslave.c',
    'jack_net_master' : 'netmaster.c',
nedko's avatar
nedko committed
26
27
28
29
30
31
32
    }

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

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

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

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

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

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

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

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

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

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

    for example_lib, example_lib_source in example_libs.items():
116
        lib = bld.new_task_gen('cc', 'shlib')
nedko's avatar
nedko committed
117
        lib.env['shlib_PATTERN'] = '%s.so'
118
        lib.includes = os_incdir + ['../common/jack', '../common']
nedko's avatar
nedko committed
119
120
        lib.target = example_lib
        lib.source = example_lib_source
121
        if bld.env['IS_MACOSX']:
122
            lib.env.append_value("CPPFLAGS", "-mmacosx-version-min=10.4 -arch i386 -arch ppc")
sletz's avatar
sletz committed
123
124
            #lib.env.append_value("LINKFLAGS", "-arch i386 -arch ppc")
            lib.env.append_value("LINKFLAGS", "")
sletz's avatar
sletz committed
125
126
        if bld.env['IS_SUN']:
	        lib.env.append_value("LINKFLAGS", "-lm")
sletz's avatar
sletz committed
127
        lib.uselib_local = 'serverlib'
128
        lib.install_path = '${ADDON_DIR}/'
129

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

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