wscript 4.69 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' : 'jack_server_control.cpp',
nedko's avatar
nedko committed
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
    }

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

def configure(conf):
    e = conf.create_header_configurator()
    e.name = 'sndfile.h'
    e.define = 'HAVE_SNDFILE'
    e.run()

    if conf.is_defined('HAVE_SNDFILE'):
        conf.env['LIB_SNDFILE'] = ['sndfile']

    e = conf.create_header_configurator()
    e.name = 'ncurses.h'
    e.define = 'HAVE_NCURSES'
    e.run()

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

    e = conf.create_library_configurator()
    e.name = 'readline'
    e.define = 'HAVE_READLINE'
    e.run()

51
52
    if conf.is_defined('HAVE_READLINE'):
        conf.env['LIB_READLINE'] = ['readline']
nedko's avatar
nedko committed
53
54
55

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

56
    conf.env['BUILD_EXAMPLE_CLIENT_REC'] = conf.is_defined('HAVE_SNDFILE')
nedko's avatar
nedko committed
57
58

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

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

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

    symlink_as('PREFIX', 'jack_connect', 'bin/jack_disconnect')
nedko's avatar
nedko committed
126

127
    install_files('PREFIX', 'bin', 'jack_control', chmod=0755)