wscript 4.51 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',
22
    'jack_server_control' : 'server_control.cpp',
nedko's avatar
nedko committed
23
24
25
26
27
28
29
    }

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

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

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

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

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

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

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

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

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

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

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

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

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