2008-05-31 00:17:01 +03:00
|
|
|
#! /usr/bin/env python
|
|
|
|
# encoding: utf-8
|
|
|
|
|
|
|
|
import Params
|
2008-05-31 01:48:00 +03:00
|
|
|
import commands
|
2008-05-31 04:37:02 +03:00
|
|
|
import Params
|
|
|
|
from Configure import g_maxlen
|
|
|
|
#g_maxlen = 40
|
2008-05-31 00:17:01 +03:00
|
|
|
|
|
|
|
VERSION='1.9.0'
|
|
|
|
APPNAME='jack'
|
2008-06-03 11:30:07 +03:00
|
|
|
JACK_API_VERSION = '0.1.0'
|
2008-05-31 00:17:01 +03:00
|
|
|
|
|
|
|
# these variables are mandatory ('/' are converted automatically)
|
|
|
|
srcdir = '.'
|
|
|
|
blddir = 'build'
|
|
|
|
|
2008-05-31 04:37:02 +03:00
|
|
|
def display_msg(msg, status = None, color = None):
|
|
|
|
sr = msg
|
|
|
|
global g_maxlen
|
|
|
|
g_maxlen = max(g_maxlen, len(msg))
|
|
|
|
if status:
|
|
|
|
print "%s :" % msg.ljust(g_maxlen),
|
|
|
|
Params.pprint(color, status)
|
|
|
|
else:
|
|
|
|
print "%s" % msg.ljust(g_maxlen)
|
|
|
|
|
|
|
|
def display_feature(msg, build):
|
|
|
|
if build:
|
|
|
|
display_msg(msg, "yes", 'GREEN')
|
|
|
|
else:
|
|
|
|
display_msg(msg, "no", 'YELLOW')
|
|
|
|
|
2008-05-31 01:48:00 +03:00
|
|
|
def fetch_svn_revision(path):
|
|
|
|
cmd = "LANG= "
|
|
|
|
cmd += "svnversion "
|
|
|
|
cmd += path
|
|
|
|
return commands.getoutput(cmd)
|
|
|
|
|
2008-05-31 00:17:01 +03:00
|
|
|
def set_options(opt):
|
|
|
|
# options provided by the modules
|
|
|
|
opt.tool_options('compiler_cxx')
|
|
|
|
opt.tool_options('compiler_cc')
|
|
|
|
|
2008-05-31 21:16:51 +03:00
|
|
|
opt.add_option('--dbus', action='store_true', default=False, help='Enable D-Bus JACK (jackdbus)')
|
|
|
|
|
2008-05-31 00:17:01 +03:00
|
|
|
def configure(conf):
|
|
|
|
conf.check_tool('compiler_cxx')
|
|
|
|
conf.check_tool('compiler_cc')
|
|
|
|
|
2008-05-31 04:37:02 +03:00
|
|
|
conf.sub_config('linux')
|
2008-05-31 21:16:51 +03:00
|
|
|
if Params.g_options.dbus:
|
|
|
|
conf.sub_config('linux/dbus')
|
2008-05-31 20:15:39 +03:00
|
|
|
conf.sub_config('example-clients')
|
2008-05-31 00:17:01 +03:00
|
|
|
|
|
|
|
conf.env['LIB_PTHREAD'] = ['pthread']
|
|
|
|
conf.env['LIB_DL'] = ['dl']
|
|
|
|
conf.env['LIB_RT'] = ['rt']
|
2008-06-03 11:30:07 +03:00
|
|
|
conf.env['JACK_API_VERSION'] = JACK_API_VERSION
|
2008-05-31 00:17:01 +03:00
|
|
|
|
2008-05-31 01:48:00 +03:00
|
|
|
conf.define('ADDON_DIR', conf.env['PREFIX'] + '/lib/jack')
|
2008-05-31 00:17:01 +03:00
|
|
|
conf.define('JACK_LOCATION', conf.env['PREFIX'] + '/bin')
|
|
|
|
conf.define('SOCKET_RPC_FIFO_SEMA', 1)
|
|
|
|
conf.define('__SMP__', 1)
|
|
|
|
conf.define('USE_POSIX_SHM', 1)
|
2008-05-31 01:48:00 +03:00
|
|
|
conf.define('JACK_SVNREVISION', fetch_svn_revision('.'))
|
2008-06-02 23:13:20 +03:00
|
|
|
conf.define('JACKMP', 1)
|
2008-06-01 02:02:02 +03:00
|
|
|
if conf.env['BUILD_JACKDBUS'] == True:
|
|
|
|
conf.define('JACK_DBUS', 1)
|
2008-05-31 00:17:01 +03:00
|
|
|
conf.write_config_header('config.h')
|
|
|
|
|
2008-05-31 20:29:10 +03:00
|
|
|
display_msg("\n==================")
|
2008-05-31 04:41:14 +03:00
|
|
|
display_msg("JACK %s %s" % (VERSION, conf.get_define('JACK_SVNREVISION')))
|
2008-05-31 04:37:02 +03:00
|
|
|
print
|
2008-05-31 20:29:10 +03:00
|
|
|
display_msg("Install prefix", conf.env['PREFIX'], 'CYAN')
|
|
|
|
display_msg("Drivers directory", conf.env['ADDON_DIR'], 'CYAN')
|
2008-05-31 04:37:02 +03:00
|
|
|
display_feature('Build with ALSA support', conf.env['BUILD_DRIVER_ALSA'] == True)
|
|
|
|
display_feature('Build with FireWire (FreeBob) support', conf.env['BUILD_DRIVER_FREEBOB'] == True)
|
|
|
|
display_feature('Build with FireWire (FFADO) support', conf.env['BUILD_DRIVER_FFADO'] == True)
|
|
|
|
display_feature('Build D-Bus JACK (jackdbus)', conf.env['BUILD_JACKDBUS'] == True)
|
|
|
|
print
|
2008-05-31 00:17:01 +03:00
|
|
|
|
|
|
|
def build(bld):
|
|
|
|
# process subfolders from here
|
2008-05-31 01:48:00 +03:00
|
|
|
bld.add_subdirs('common')
|
|
|
|
bld.add_subdirs('linux')
|
2008-06-01 02:02:02 +03:00
|
|
|
if bld.env()['BUILD_JACKDBUS'] == True:
|
2008-05-31 21:16:51 +03:00
|
|
|
bld.add_subdirs('linux/dbus')
|
2008-05-31 20:15:39 +03:00
|
|
|
bld.add_subdirs('example-clients')
|
2008-06-02 22:20:24 +03:00
|
|
|
bld.add_subdirs('tests')
|