|
- #! /usr/bin/python3
- # encoding: utf-8
- #
- # Copyright (C) 2015, 2017-2018 Karl Linden <karl.j.linden@gmail.com>
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 2 of the License.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- #
-
- example_programs = {
- 'jack_cpu_load': 'cpu_load.c',
- 'jack_latent_client': 'latent_client.c',
- 'jack_metro': 'metro.c',
- 'jack_midi_latency_test': 'midi_latency_test.c',
- 'jack_midiseq': 'midiseq.c',
- 'jack_midisine': 'midisine.c',
- 'jack_net_master': 'netmaster.c',
- 'jack_net_slave': 'netslave.c',
- 'jack_server_control': 'server_control.cpp',
- 'jack_showtime': 'showtime.c',
- 'jack_simdtests': 'simdtests.cpp',
- 'jack_simple_client': 'simple_client.c',
- 'jack_simple_session_client': 'simple_session_client.c',
- 'jack_thru': 'thru_client.c',
- 'jack_zombie': 'zombie.c',
- }
-
- example_libs = {
- 'inprocess': 'inprocess.c',
- }
-
-
- def configure(conf):
- conf.env['BUILD_EXAMPLE_CLIENT_REC'] = conf.env['SNDFILE']
-
-
- def build(bld):
- if bld.env['IS_LINUX']:
- os_incdir = ['../linux', '../posix']
- if bld.env['IS_MACOSX']:
- os_incdir = ['../macosx', '../posix']
- if bld.env['IS_FREEBSD']:
- os_incdir = ['../freebsd', '../posix']
- if bld.env['IS_SUN']:
- os_incdir = ['../solaris', '../posix']
- if bld.env['IS_WINDOWS']:
- os_incdir = ['../windows']
- for example_program, example_program_source in list(example_programs.items()):
- if example_program == 'jack_server_control':
- use = ['serverlib', 'STDC++']
- elif example_program == 'jack_net_slave':
- if not bld.env['BUILD_NETLIB']:
- continue
- use = ['netlib']
- elif example_program == 'jack_net_master':
- if not bld.env['BUILD_NETLIB']:
- continue
- use = ['netlib']
- else:
- use = ['clientlib']
-
- if example_program == 'jack_simdtests':
- ftrs = 'cxx cxxprogram'
- else:
- ftrs = 'c cprogram'
-
- if bld.env['IS_MACOSX']:
- prog = bld(features=ftrs, framework=['Foundation'])
- else:
- prog = bld(features=ftrs)
- prog.includes = os_incdir + ['../common/jack', '../common']
- prog.source = example_program_source
- prog.use = use
- if bld.env['IS_LINUX']:
- prog.use += ['RT', 'M']
- if bld.env['IS_SUN']:
- prog.use += ['M']
- if bld.env['IS_FREEBSD']:
- prog.use += ['M']
- if bld.env['IS_WINDOWS'] and bld.env['BUILD_STATIC']:
- prog.env['LIB_PTHREAD'] = [':libwinpthread.a']
-
- prog.target = example_program
-
- if bld.env['BUILD_EXAMPLE_CLIENT_REC']:
- prog = bld(features='c cprogram')
- prog.includes = os_incdir + ['../common/jack', '../common']
- prog.source = 'capture_client.c'
- prog.use = ['clientlib']
- if bld.env['IS_MACOSX']:
- prog.use += ['SNDFILE']
- if bld.env['IS_LINUX']:
- prog.use += ['RT', 'SNDFILE']
- if bld.env['IS_FREEBSD']:
- prog.use += ['SNDFILE']
- if bld.env['IS_SUN']:
- prog.use += ['RT', 'SNDFILE']
- if bld.env['IS_WINDOWS']:
- prog.uselib = ['SNDFILE']
- if bld.env['BUILD_STATIC']:
- prog.env['LIB_PTHREAD'] = [':libwinpthread.a']
- prog.target = 'jack_rec'
-
- for example_lib, example_lib_source in list(example_libs.items()):
- lib = bld(features='c cshlib')
- if not bld.env['IS_WINDOWS']:
- lib.env['cshlib_PATTERN'] = '%s.so'
- lib.includes = os_incdir + ['../common/jack', '../common']
- lib.target = example_lib
- lib.source = example_lib_source
- if bld.env['IS_SUN']:
- lib.env.append_value('LINKFLAGS', '-lm')
- if bld.env['IS_WINDOWS'] and bld.env['BUILD_STATIC']:
- prog.env['LIB_PTHREAD'] = [':libwinpthread.a']
- lib.use = 'serverlib'
- lib.install_path = '${ADDON_DIR}/'
|