Upgrade to waf 1.6.7 and autowaf r52.

git-svn-id: svn://localhost/ardour2/branches/3.0@10162 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2011-09-29 19:17:54 +00:00
parent 426d3d8207
commit 723ab60b39
42 changed files with 374 additions and 1286 deletions

View File

@ -1,480 +0,0 @@
#!/usr/bin/env python
# Waf utilities for easily building standard unixey packages/libraries
# Licensed under the GNU GPL v2 or later, see COPYING file for details.
# Copyright (C) 2008 David Robillard
# Copyright (C) 2008 Nedko Arnaudov
import Configure
import Options
import Utils
import misc
import os
import subprocess
import sys
import glob
from TaskGen import feature, before, after
global g_is_child
g_is_child = False
# Only run autowaf hooks once (even if sub projects call several times)
global g_step
g_step = 0
# Compute dependencies globally
#import preproc
#preproc.go_absolute = True
@feature('cc', 'cxx')
@after('apply_lib_vars')
@before('apply_obj_vars_cc', 'apply_obj_vars_cxx')
def include_config_h(self):
self.env.append_value('INC_PATHS', self.bld.srcnode)
def set_options(opt):
"Add standard autowaf options if they havn't been added yet"
global g_step
if g_step > 0:
return
opt.tool_options('compiler_cc')
opt.tool_options('compiler_cxx')
opt.add_option('--debug', action='store_true', default=True, dest='debug',
help="Build debuggable binaries [Default: True]")
opt.add_option('--optimize', action='store_false', default=True, dest='debug',
help="Build optimized binaries [Default: False]")
opt.add_option('--strict', action='store_true', default=False, dest='strict',
help="Use strict compiler flags and show all warnings [Default: False]")
opt.add_option('--docs', action='store_true', default=False, dest='docs',
help="Build documentation - requires doxygen [Default: False]")
opt.add_option('--bundle', action='store_true', default=False,
help="Build a self-contained bundle [Default: False]")
opt.add_option('--bindir', type='string',
help="Executable programs [Default: PREFIX/bin]")
opt.add_option('--libdir', type='string',
help="Libraries [Default: PREFIX/lib]")
opt.add_option('--includedir', type='string',
help="Header files [Default: PREFIX/include]")
opt.add_option('--datadir', type='string',
help="Shared data [Default: PREFIX/share]")
opt.add_option('--configdir', type='string',
help="Configuration data [Default: PREFIX/etc]")
opt.add_option('--mandir', type='string',
help="Manual pages [Default: DATADIR/man]")
opt.add_option('--htmldir', type='string',
help="HTML documentation [Default: DATADIR/doc/PACKAGE]")
opt.add_option('--lv2-user', action='store_true', default=False, dest='lv2_user',
help="Install LV2 bundles to user-local location [Default: False]")
if sys.platform == "darwin":
opt.add_option('--lv2dir', type='string',
help="LV2 bundles [Default: /Library/Audio/Plug-Ins/LV2]")
else:
opt.add_option('--lv2dir', type='string',
help="LV2 bundles [Default: LIBDIR/lv2]")
g_step = 1
def check_header(conf, name, define='', mandatory=False):
"Check for a header iff it hasn't been checked for yet"
if type(conf.env['AUTOWAF_HEADERS']) != dict:
conf.env['AUTOWAF_HEADERS'] = {}
checked = conf.env['AUTOWAF_HEADERS']
if not name in checked:
checked[name] = True
includes = '' # search default system include paths
if sys.platform == "darwin":
includes = '/opt/local/include'
if define != '':
conf.check(header_name=name, includes=includes, define_name=define, mandatory=mandatory)
else:
conf.check(header_name=name, includes=includes, mandatory=mandatory)
def nameify(name):
return name.replace('/', '_').replace('++', 'PP').replace('-', '_').replace('.', '_')
def check_pkg(conf, name, **args):
if not 'mandatory' in args:
args['mandatory'] = True
"Check for a package iff it hasn't been checked for yet"
var_name = 'HAVE_' + nameify(args['uselib_store'])
check = not var_name in conf.env
if not check and 'atleast_version' in args:
# Re-check if version is newer than previous check
checked_version = conf.env['VERSION_' + name]
if checked_version and checked_version < args['atleast_version']:
check = True;
if check:
conf.check_cfg(package=name, args="--cflags --libs", **args)
found = bool(conf.env[var_name])
if found:
conf.define(var_name, int(found))
if 'atleast_version' in args:
conf.env['VERSION_' + name] = args['atleast_version']
else:
conf.undefine(var_name)
if args['mandatory'] == True:
conf.fatal("Required package " + name + " not found")
def configure(conf):
global g_step
if g_step > 1:
return
def append_cxx_flags(vals):
conf.env.append_value('CCFLAGS', vals.split())
conf.env.append_value('CXXFLAGS', vals.split())
display_header('Global Configuration')
conf.check_tool('misc')
conf.check_tool('compiler_cc')
conf.check_tool('compiler_cxx')
conf.env['DOCS'] = Options.options.docs
conf.env['DEBUG'] = Options.options.debug
conf.env['STRICT'] = Options.options.strict
conf.env['PREFIX'] = os.path.abspath(os.path.expanduser(os.path.normpath(conf.env['PREFIX'])))
if Options.options.bundle:
conf.env['BUNDLE'] = True
conf.define('BUNDLE', 1)
conf.env['BINDIR'] = conf.env['PREFIX']
conf.env['INCLUDEDIR'] = os.path.join(conf.env['PREFIX'], 'Headers')
conf.env['LIBDIR'] = os.path.join(conf.env['PREFIX'], 'Libraries')
conf.env['DATADIR'] = os.path.join(conf.env['PREFIX'], 'Resources')
conf.env['HTMLDIR'] = os.path.join(conf.env['PREFIX'], 'Resources/Documentation')
conf.env['MANDIR'] = os.path.join(conf.env['PREFIX'], 'Resources/Man')
conf.env['LV2DIR'] = os.path.join(conf.env['PREFIX'], 'PlugIns')
else:
conf.env['BUNDLE'] = False
if Options.options.bindir:
conf.env['BINDIR'] = Options.options.bindir
else:
conf.env['BINDIR'] = os.path.join(conf.env['PREFIX'], 'bin')
if Options.options.includedir:
conf.env['INCLUDEDIR'] = Options.options.includedir
else:
conf.env['INCLUDEDIR'] = os.path.join(conf.env['PREFIX'], 'include')
if Options.options.libdir:
conf.env['LIBDIR'] = Options.options.libdir
else:
conf.env['LIBDIR'] = os.path.join(conf.env['PREFIX'], 'lib')
if Options.options.datadir:
conf.env['DATADIR'] = Options.options.datadir
else:
conf.env['DATADIR'] = os.path.join(conf.env['PREFIX'], 'share')
if Options.options.configdir:
conf.env['CONFIGDIR'] = Options.options.configdir
else:
conf.env['CONFIGDIR'] = os.path.join(conf.env['PREFIX'], 'etc')
if Options.options.htmldir:
conf.env['HTMLDIR'] = Options.options.htmldir
else:
conf.env['HTMLDIR'] = os.path.join(conf.env['DATADIR'], 'doc', Utils.g_module.APPNAME)
if Options.options.mandir:
conf.env['MANDIR'] = Options.options.mandir
else:
conf.env['MANDIR'] = os.path.join(conf.env['DATADIR'], 'man')
if Options.options.lv2dir:
conf.env['LV2DIR'] = Options.options.lv2dir
else:
if Options.options.lv2_user:
if sys.platform == "darwin":
conf.env['LV2DIR'] = os.path.join(os.getenv('HOME'), 'Library/Audio/Plug-Ins/LV2')
else:
conf.env['LV2DIR'] = os.path.join(os.getenv('HOME'), '.lv2')
else:
if sys.platform == "darwin":
conf.env['LV2DIR'] = '/Library/Audio/Plug-Ins/LV2'
else:
conf.env['LV2DIR'] = os.path.join(conf.env['LIBDIR'], 'lv2')
conf.env['BINDIRNAME'] = os.path.basename(conf.env['BINDIR'])
conf.env['LIBDIRNAME'] = os.path.basename(conf.env['LIBDIR'])
conf.env['DATADIRNAME'] = os.path.basename(conf.env['DATADIR'])
conf.env['CONFIGDIRNAME'] = os.path.basename(conf.env['CONFIGDIR'])
conf.env['LV2DIRNAME'] = os.path.basename(conf.env['LV2DIR'])
if Options.options.docs:
doxygen = conf.find_program('doxygen')
if not doxygen:
conf.fatal("Doxygen is required to build documentation, configure without --docs")
dot = conf.find_program('dot')
if not dot:
conf.fatal("Graphviz (dot) is required to build documentation, configure without --docs")
if Options.options.debug:
conf.env['CCFLAGS'] = [ '-O0', '-g' ]
conf.env['CXXFLAGS'] = [ '-O0', '-g' ]
else:
append_cxx_flags('-DNDEBUG')
if Options.options.strict:
conf.env.append_value('CCFLAGS', [ '-std=c99', '-pedantic' ])
conf.env.append_value('CXXFLAGS', [ '-ansi', '-Woverloaded-virtual', '-Wnon-virtual-dtor'])
append_cxx_flags('-Wall -Wextra -Wno-unused-parameter')
append_cxx_flags('-fPIC -DPIC -fshow-column')
display_msg(conf, "Install prefix", conf.env['PREFIX'])
display_msg(conf, "Debuggable build", str(conf.env['DEBUG']))
display_msg(conf, "Strict compiler flags", str(conf.env['STRICT']))
display_msg(conf, "Build documentation", str(conf.env['DOCS']))
print()
g_step = 2
def set_local_lib(conf, name, has_objects):
conf.define('HAVE_' + nameify(name.upper()), 1)
if has_objects:
if type(conf.env['AUTOWAF_LOCAL_LIBS']) != dict:
conf.env['AUTOWAF_LOCAL_LIBS'] = {}
conf.env['AUTOWAF_LOCAL_LIBS'][name.lower()] = True
else:
if type(conf.env['AUTOWAF_LOCAL_HEADERS']) != dict:
conf.env['AUTOWAF_LOCAL_HEADERS'] = {}
conf.env['AUTOWAF_LOCAL_HEADERS'][name.lower()] = True
def use_lib(bld, obj, libs):
abssrcdir = os.path.abspath('.')
libs_list = libs.split()
for l in libs_list:
in_headers = l.lower() in bld.env['AUTOWAF_LOCAL_HEADERS']
in_libs = l.lower() in bld.env['AUTOWAF_LOCAL_LIBS']
if in_libs:
if hasattr(obj, 'uselib_local'):
obj.uselib_local += ' lib' + l.lower() + ' '
else:
obj.uselib_local = 'lib' + l.lower() + ' '
if in_headers or in_libs:
inc_flag = '-iquote ' + os.path.join(abssrcdir, l.lower())
for f in ['CCFLAGS', 'CXXFLAGS']:
if not inc_flag in bld.env[f]:
bld.env.append_value(f, inc_flag)
else:
if hasattr(obj, 'uselib'):
obj.uselib += ' ' + l
else:
obj.uselib = l
def display_header(title):
Utils.pprint('BOLD', title)
def display_msg(conf, msg, status = None, color = None):
color = 'CYAN'
if type(status) == bool and status or status == "True":
color = 'GREEN'
elif type(status) == bool and not status or status == "False":
color = 'YELLOW'
Utils.pprint('BOLD', "%s :" % msg.ljust(conf.line_just), sep='')
Utils.pprint(color, status)
def link_flags(env, lib):
return ' '.join(map(lambda x: env['LIB_ST'] % x, env['LIB_' + lib]))
def compile_flags(env, lib):
return ' '.join(map(lambda x: env['CPPPATH_ST'] % x, env['CPPPATH_' + lib]))
def set_recursive():
global g_is_child
g_is_child = True
def is_child():
global g_is_child
return g_is_child
# Pkg-config file
def build_pc(bld, name, version, libs):
'''Build a pkg-config file for a library.
name -- uppercase variable name (e.g. 'SOMENAME')
version -- version string (e.g. '1.2.3')
libs -- string/list of dependencies (e.g. 'LIBFOO GLIB')
'''
obj = bld.new_task_gen('subst')
obj.source = name.lower() + '.pc.in'
obj.target = name.lower() + '.pc'
obj.install_path = '${PREFIX}/${LIBDIRNAME}/pkgconfig'
pkg_prefix = bld.env['PREFIX']
if pkg_prefix[-1] == '/':
pkg_prefix = pkg_prefix[:-1]
obj.dict = {
'prefix' : pkg_prefix,
'exec_prefix' : '${prefix}',
'libdir' : '${prefix}/' + bld.env['LIBDIRNAME'],
'includedir' : '${prefix}/include',
name + '_VERSION' : version,
}
if type(libs) != list:
libs = libs.split()
for i in libs:
obj.dict[i + '_LIBS'] = link_flags(bld.env, i)
obj.dict[i + '_CFLAGS'] = compile_flags(bld.env, i)
# Doxygen API documentation
def build_dox(bld, name, version, srcdir, blddir):
if not bld.env['DOCS']:
return
obj = bld.new_task_gen('subst')
obj.source = 'doc/reference.doxygen.in'
obj.target = 'doc/reference.doxygen'
if is_child():
src_dir = os.path.join(srcdir, name.lower())
doc_dir = os.path.join(blddir, 'default', name.lower(), 'doc')
else:
src_dir = srcdir
doc_dir = os.path.join(blddir, 'default', 'doc')
obj.dict = {
name + '_VERSION' : version,
name + '_SRCDIR' : os.path.abspath(src_dir),
name + '_DOC_DIR' : os.path.abspath(doc_dir)
}
obj.install_path = ''
out1 = bld.new_task_gen('command-output')
out1.dependencies = [obj]
out1.stdout = '/doc/doxygen.out'
out1.stdin = '/doc/reference.doxygen' # whatever..
out1.command = 'doxygen'
out1.argv = [os.path.abspath(doc_dir) + '/reference.doxygen']
out1.command_is_external = True
# Version code file generation
def build_version_files(header_path, source_path, domain, major, minor, micro):
header_path = os.path.abspath(header_path)
source_path = os.path.abspath(source_path)
text = "int " + domain + "_major_version = " + str(major) + ";\n"
text += "int " + domain + "_minor_version = " + str(minor) + ";\n"
text += "int " + domain + "_micro_version = " + str(micro) + ";\n"
try:
o = open(source_path, 'w')
o.write(text)
o.close()
except IOError:
print("Could not open %s for writing\n", source_path)
sys.exit(-1)
text = "#ifndef __" + domain + "_version_h__\n"
text += "#define __" + domain + "_version_h__\n"
text += "extern const char* " + domain + "_revision;\n"
text += "extern int " + domain + "_major_version;\n"
text += "extern int " + domain + "_minor_version;\n"
text += "extern int " + domain + "_micro_version;\n"
text += "#endif /* __" + domain + "_version_h__ */\n"
try:
o = open(header_path, 'w')
o.write(text)
o.close()
except IOError:
print("Could not open %s for writing\n", header_path)
sys.exit(-1)
return None
def run_tests(ctx, appname, tests):
orig_dir = os.path.abspath(os.curdir)
failures = 0
base = '..'
top_level = os.path.abspath(ctx.curdir) != os.path.abspath(os.curdir)
if top_level:
os.chdir('./build/default/' + appname)
base = '../..'
else:
os.chdir('./build/default')
lcov = True
lcov_log = open('lcov.log', 'w')
try:
# Clear coverage data
subprocess.call('lcov -d ./src -z'.split(),
stdout=lcov_log, stderr=lcov_log)
except:
lcov = False
print("Failed to run lcov, no coverage report will be generated")
# Run all tests
for i in tests:
print()
Utils.pprint('BOLD', 'Running %s test %s' % (appname, i))
if subprocess.call(i) == 0:
Utils.pprint('GREEN', 'Passed %s %s' % (appname, i))
else:
failures += 1
Utils.pprint('RED', 'Failed %s %s' % (appname, i))
if lcov:
# Generate coverage data
coverage_lcov = open('coverage.lcov', 'w')
subprocess.call(('lcov -c -d ./src -d ./test -b ' + base).split(),
stdout=coverage_lcov, stderr=lcov_log)
coverage_lcov.close()
# Strip out unwanted stuff
coverage_stripped_lcov = open('coverage-stripped.lcov', 'w')
subprocess.call('lcov --remove coverage.lcov *boost* c++*'.split(),
stdout=coverage_stripped_lcov, stderr=lcov_log)
coverage_stripped_lcov.close()
# Generate HTML coverage output
if not os.path.isdir('./coverage'):
os.makedirs('./coverage')
subprocess.call('genhtml -o coverage coverage-stripped.lcov'.split(),
stdout=lcov_log, stderr=lcov_log)
lcov_log.close()
print()
Utils.pprint('BOLD', 'Summary:', sep=''),
if failures == 0:
Utils.pprint('GREEN', 'All ' + appname + ' tests passed')
else:
Utils.pprint('RED', str(failures) + ' ' + appname + ' test(s) failed')
Utils.pprint('BOLD', 'Coverage:', sep='')
print(os.path.abspath('coverage/index.html'))
os.chdir(orig_dir)
def shutdown():
# This isn't really correct (for packaging), but people asking is annoying
if Options.commands['install']:
try: os.popen("/sbin/ldconfig")
except: pass
def build_i18n(bld,srcdir,dir,name,sources):
pwd = os.getcwd()
os.chdir(os.path.join (srcdir, dir))
pot_file = '%s.pot' % name
args = [ 'xgettext',
'--keyword=_',
'--keyword=N_',
'--from-code=UTF-8',
'-o', pot_file,
'--copyright-holder="Paul Davis"' ]
args += sources
print 'Updating ', pot_file
os.spawnvp (os.P_WAIT, 'xgettext', args)
po_files = glob.glob ('po/*.po')
languages = [ po.replace ('.po', '') for po in po_files ]
for po_file in po_files:
args = [ 'msgmerge',
'--update',
po_file,
pot_file ]
print 'Updating ', po_file
os.spawnvp (os.P_WAIT, 'msgmerge', args)
for po_file in po_files:
mo_file = po_file.replace ('.po', '.mo')
args = [ 'msgfmt',
'-c',
'-f',
'-o',
mo_file,
po_file ]
print 'Generating ', po_file
os.spawnvp (os.P_WAIT, 'msgfmt', args)
os.chdir (pwd)

View File

@ -1,19 +1,18 @@
#!/usr/bin/python
import os
import glob
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def configure(conf):
pass
def build(bld):
presets = glob.glob (os.path.join(bld.get_curdir(), '*.preset'))
formats = glob.glob (os.path.join(bld.get_curdir(), '*.format'))
presets = bld.path.ant_glob ('*.preset')
formats = bld.path.ant_glob ('*.format')
bld.install_files (os.path.join(bld.env['DATADIR'], 'ardour3', 'export'),
presets + formats)
def set_options(opt):
def options(opt):
pass

View File

@ -1,5 +1,5 @@
#!/bin/sh
. `dirname "$0"`/../build/default/gtk2_ardour/ardev_common_waf.sh
. `dirname "$0"`/../build/gtk2_ardour/ardev_common_waf.sh
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ARDOUR_RUNNING_UNDER_VALGRIND=TRUE
exec valgrind --error-limit=no --num-callers=50 --tool=callgrind $TOP/$EXECUTABLE --novst "$@"

View File

@ -1,5 +1,5 @@
#!/bin/sh
. `dirname "$0"`/../build/default/gtk2_ardour/ardev_common_waf.sh
. `dirname "$0"`/../build/gtk2_ardour/ardev_common_waf.sh
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ARDOUR_INSIDE_GDB=1
exec gdb --args $TOP/$EXECUTABLE $@

View File

@ -1,4 +1,4 @@
#!/bin/sh
. `dirname "$0"`/../build/default/gtk2_ardour/ardev_common_waf.sh
. `dirname "$0"`/../build/gtk2_ardour/ardev_common_waf.sh
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
exec $TOP/$EXECUTABLE "$@"

View File

@ -4,10 +4,10 @@ TOP=`dirname "$0"`/..
libs=$TOP/@LIBS@
export ARDOUR_PATH=$TOP/gtk2_ardour/icons:$TOP/gtk2_ardour/pixmaps:$TOP/build/default/gtk2_ardour:$TOP/gtk2_ardour:.
export ARDOUR_PATH=$TOP/gtk2_ardour/icons:$TOP/gtk2_ardour/pixmaps:$TOP/build/gtk2_ardour:$TOP/gtk2_ardour:.
export ARDOUR_SURFACES_PATH=$libs/surfaces/osc:$libs/surfaces/generic_midi:$libs/surfaces/tranzport:$libs/surfaces/powermate:$libs/surfaces/mackie
export ARDOUR_PANNER_PATH=$libs/panners/2in2out:$libs/panners/1in2out:$libs/panners/vbap
export ARDOUR_DATA_PATH=$TOP/gtk2_ardour:build/default/gtk2_ardour:.
export ARDOUR_DATA_PATH=$TOP/gtk2_ardour:build/gtk2_ardour:.
if test -d $HOME/gtk/inst ; then
export GTK_PATH=~/.ardour3:$libs/clearlooks-newer

View File

@ -1,4 +1,4 @@
#!/bin/sh
. `dirname "$0"`/../build/default/gtk2_ardour/ardev_common_waf.sh
. `dirname "$0"`/../build/gtk2_ardour/ardev_common_waf.sh
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
exec ldd $TOP/$EXECUTABLE

View File

@ -1,5 +1,5 @@
#!/bin/sh
. `dirname "$0"`/../build/default/gtk2_ardour/ardev_common_waf.sh
. `dirname "$0"`/../build/gtk2_ardour/ardev_common_waf.sh
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ARDOUR_RUNNING_UNDER_VALGRIND=TRUE
exec valgrind --error-limit=no --num-callers=50 --tool=memcheck $TOP/$EXECUTABLE --novst "$@"

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import waflib.Logs as Logs, waflib.Utils as Utils
import os
import glob
import Options
import sys
import TaskGen
@ -18,8 +18,8 @@ APPNAME = 'gtk2_ardour'
VERSION = GTK2_ARDOUR_VERSION
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
path_prefix = 'gtk2_ardour/'
@ -233,10 +233,11 @@ gtk2_ardour_sources = [
'window_proxy.cc'
]
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
conf.load('misc')
autowaf.build_version_files(
path_prefix + 'version.h',
path_prefix + 'version.cc',
@ -261,13 +262,11 @@ def configure(conf):
uselib_store='GNOMECANVASMM', atleast_version='2.16')
autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
conf.check_tool('misc') # subst tool
conf.write_config_header('gtk2ardour-config.h')
conf.write_config_header('gtk2ardour-config.h', remove=False)
# Boost headers
autowaf.check_header(conf, 'boost/shared_ptr.hpp')
autowaf.check_header(conf, 'boost/weak_ptr.hpp')
autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
# Add a waf `feature' to allow compilation of things using winegcc
from TaskGen import feature
@ -305,12 +304,13 @@ def _doPyp(infileName):
outStr += _doPyp(incName)
else:
outStr += line
# done
return outStr
def include_processor(task):
infileName = task.inputs[0].srcpath(task.env)
outfileName = task.outputs[0].bldpath(task.env)
infileName = task.inputs[0].srcpath()
outfileName = os.path.join(out, task.outputs[0].bldpath())
fdOut = file (outfileName, "w")
fdOut.write (_doPyp(infileName))
fdOut.close ()
@ -338,9 +338,9 @@ def build(bld):
# GTK front-end; if we're using VST we build this as a shared library,
# otherwise it's a normal executabale
if bld.env['VST_SUPPORT']:
obj = bld.new_task_gen(features = 'cxx cc cshlib')
obj = bld(features = 'cxx c cxxshlib')
else:
obj = bld.new_task_gen(features = 'cxx cc cprogram')
obj = bld(features = 'cxx c cxxprogram')
obj.includes = ['.']
obj.source = gtk2_ardour_sources
@ -355,15 +355,15 @@ def build(bld):
obj.uselib = 'UUID FLAC GLIBMM GTHREAD GTK OGG ALSA CURL DL'
obj.uselib += ' GTKMM GNOMECANVASMM '
obj.uselib += ' AUDIOUNITS OSX GTKOSX '
obj.uselib_local = '''libpbd libmidipp libtaglib libardour libardour_cp
obj.use = '''libpbd libmidipp libtaglib libardour libardour_cp
libgtkmm2ext libtaglib libgnomecanvas-2'''
if sys.platform == 'darwin':
obj.uselib_local + ' libappleutility'
obj.use += ' libappleutility'
obj.defines = [
'PACKAGE="gtk2_ardour"',
'VERSIONSTRING="' + bld.env['VERSION'] + '"',
'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
'CONFIG_DIR="' + os.path.normpath(bld.env['CONFIGDIR']) + '"',
'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
'MODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"',
'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']),
'locale') + '"',
@ -397,12 +397,12 @@ def build(bld):
if bld.env['COREAUDIO']:
TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
obj.source += [ 'cocoacarbon.mm', 'au_pluginui.mm' ]
obj.uselib_local += ' libappleutility '
obj.use += ' libappleutility '
if bld.env['VST_SUPPORT']:
# If we require VST support we build a stub main() and the FST library
# here using winegcc, and link it to the GTK front-end library
obj = bld.new_task_gen (features = 'cxx cc cprogram wine')
obj = bld(features = 'cxx c cxxprogram wine')
obj.source = '''
../libs/fst/fst.c
../libs/fst/fstinfofile.c
@ -415,7 +415,7 @@ def build(bld):
obj.linkflags += ['-mwindows', '-Wl,--export-dynamic', '-lpthread']
obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
obj.uselib = 'ALSA'
obj.uselib_local = ['libpbd','libmidipp','libtaglib','libardour',
obj.use = ['libpbd','libmidipp','libtaglib','libardour',
'libardour_cp','libgtkmm2ext','libtaglib',
'gtk2_ardour']
@ -423,24 +423,30 @@ def build(bld):
wrapper_subst_dict = {
'INSTALL_PREFIX' : bld.env['PREFIX'],
'LIBDIR' : os.path.normpath(bld.env['LIBDIRNAME']),
'LIBS' : 'build/default/libs',
'LIBDIR' : os.path.normpath(bld.env['LIBDIR']),
'LIBS' : 'build/libs',
'VERSION' : '3.0',
'EXECUTABLE' : 'build/default/gtk2_ardour/ardour-3.0'
'EXECUTABLE' : 'build/gtk2_ardour/ardour-3.0'
}
obj = bld.new_task_gen('subst')
def set_subst_dict(obj, dict):
for i in dict:
setattr(obj, i, dict[i])
obj = bld(features = 'subst', rule= 'chmod 0755 ${TGT}')
obj.source = 'ardev_common.sh.in'
obj.target = 'ardev_common_waf.sh'
obj.chmod = 0755
obj.chmod = Utils.O755
obj.dict = wrapper_subst_dict
set_subst_dict(obj, wrapper_subst_dict)
obj = bld.new_task_gen('subst')
obj = bld(features = 'subst')
obj.source = 'ardour.sh.in'
obj.target = 'ardour3'
obj.chmod = 0755
obj.chmod = Utils.O755
obj.dict = wrapper_subst_dict
obj.install_path = bld.env['BINDIR']
set_subst_dict(obj, wrapper_subst_dict)
# Font configuration
@ -507,49 +513,47 @@ def build(bld):
'gtk2_ardour/ardour3_ui_light.rc.in', 'ARDOUR_LIGHT')
light_rc_subst_dict['COLPREFIX'] = 'ARDOUR_LIGHT'
obj = bld.new_task_gen('subst')
obj = bld(features = 'subst')
obj.source = [ 'ardour3_ui_dark.rc.in' ]
obj.target = 'ardour3_ui_dark.rc.pre'
obj.dict = dark_rc_subst_dict
obj.install_path = None
set_subst_dict(obj, dark_rc_subst_dict)
obj = bld.new_task_gen('subst')
obj = bld(features = 'subst')
obj.source = [ 'ardour3_ui_light.rc.in' ]
obj.target = 'ardour3_ui_light.rc.pre'
obj.dict = light_rc_subst_dict
obj.install_path = None
set_subst_dict(obj, light_rc_subst_dict)
obj = bld.new_task_gen('subst')
obj = bld(features = 'subst')
obj.source = [ 'ardour3_styles.rc.in' ]
obj.target = 'ardour3_dark_styles.rc'
obj.dict = dark_rc_subst_dict
obj.install_path = None
set_subst_dict(obj, dark_rc_subst_dict)
obj = bld.new_task_gen('subst')
obj = bld(features = 'subst')
obj.source = [ 'ardour3_styles.rc.in' ]
obj.target = 'ardour3_light_styles.rc'
obj.dict = light_rc_subst_dict
obj.install_path = None
set_subst_dict(obj, light_rc_subst_dict)
obj = bld.new_task_gen('subst')
obj = bld(features = 'subst')
obj.source = [ 'ardour3_fonts.rc.in' ]
obj.target = 'ardour3_dark_fonts.rc'
obj.dict = dark_rc_subst_dict
obj.install_path = None
set_subst_dict(obj, dark_rc_subst_dict)
obj = bld.new_task_gen('subst')
obj = bld(features = 'subst')
obj.source = [ 'ardour3_fonts.rc.in' ]
obj.target = 'ardour3_light_fonts.rc'
obj.dict = light_rc_subst_dict
obj.install_path = None
set_subst_dict(obj, light_rc_subst_dict)
obj = bld.new_task_gen('copy')
obj = bld(rule = 'cp ${SRC} ${TGT}')
obj.source = [ 'ardour3_widget_list.rc' ]
obj.target = 'ardour3_widgets.rc'
obj.install_path = None
bld.use_the_magic()
bld (
rule = include_processor,
source = 'ardour3_ui_dark.rc.pre',
@ -568,14 +572,14 @@ def build(bld):
menus_argv = [ '-E', '-P', '-DGTKOSX' ]
else:
menus_argv = [ '-E', '-P' ]
obj = bld.new_task_gen('command-output')
obj = bld(features = 'command-output')
obj.command = 'cpp'
obj.command_is_external = True
obj.no_inputs = True
obj.argv = menus_argv
obj.stdin = 'ardour.menus.in'
obj.stdout = 'ardour.menus'
bld.install_files(os.path.join(bld.env['CONFIGDIR'], 'ardour3'),
bld.install_files(os.path.join(bld.env['SYSCONFDIR'], 'ardour3'),
'ardour.menus')
# Keybindings
@ -584,15 +588,15 @@ def build(bld):
# 'SAE-us-nokeypad', 'ergonomic-us'
for b in [ 'mnemonic-us' ] :
obj = bld.new_task_gen (
obj = bld(
target = b + '.bindings',
source = b + '.bindings.in',
rule = '../tools/fmt-bindings --winkey="%s" --accelmap <${SRC} >${TGT}' % bld.env['WINDOWS_KEY']
)
obj.install_path = os.path.join(bld.env['CONFIGDIR'], 'ardour3')
obj.install_path = os.path.join(bld.env['SYSCONFDIR'], 'ardour3')
# not modified at present
bld.install_files(os.path.join(bld.env['CONFIGDIR'], 'ardour3'),
bld.install_files(os.path.join(bld.env['SYSCONFDIR'], 'ardour3'),
'step_editing.bindings')
# Icons/Images
@ -601,16 +605,16 @@ def build(bld):
bld.install_files('${DATADIR}/ardour3', 'splash.png')
# Default UI configuration
bld.install_files('${CONFIGDIR}/ardour3', 'ardour3_ui_default.conf')
bld.install_files('${SYSCONFDIR}/ardour3', 'ardour3_ui_default.conf')
# Generic widget style mappings
bld.install_files('${CONFIGDIR}/ardour3', 'ardour3_widgets.rc')
bld.install_files('${SYSCONFDIR}/ardour3', 'ardour3_widgets.rc')
# Default export stuff
bld.install_files('${CONFIGDIR}/ardour3/export', 'export/*.format')
bld.install_files('${SYSCONFDIR}/ardour3/export', 'export/*.format')
# i18n
if bld.env['ENABLE_NLS']:
mo_files = glob.glob (os.path.join (bld.get_curdir(), 'po/*.mo'))
mo_files = bld.path.ant_glob ('po/*.mo')
for mo in mo_files:
lang = os.path.basename (mo).replace ('.mo', '')
bld.install_as (os.path.join(bld.env['PREFIX'], 'share', 'locale',

View File

@ -1,4 +1,5 @@
import autowaf
#!/usr/bin/env python
from waflib.extras import autowaf as autowaf
import os
libappleutility_sources = [
@ -20,17 +21,17 @@ libappleutility_sources = [
'CAXException.cpp'
]
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
autowaf.configure(conf)
def build(bld):
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.uselib = 'AUDIOUNITS OSX'
obj.source = libappleutility_sources
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.includes = ['.']
obj.name = 'libappleutility'
obj.target = 'appleutility'

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
import glob
import Options
import re
import subprocess
@ -26,8 +25,8 @@ APPNAME = 'libardour'
VERSION = LIBARDOUR_VERSION
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
path_prefix = 'libs/ardour/'
@ -233,7 +232,7 @@ def ogg_supported():
out = cmd.communicate()[0].decode('utf-8');
return re.search ('unknown format', out) == None
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
@ -292,7 +291,7 @@ def configure(conf):
conf.check_cc(fragment = '''
#include <jack/jack.h>
void callback(int code, const char* reason, void* arg) { return; }
void callback(jack_status_t code, const char* reason, void* arg) { return; }
int main(int argc, char **argv) {
jack_client_t* c;
jack_on_info_shutdown(c, callback, (void*) 0);
@ -341,27 +340,27 @@ int main(int argc, char **argv) {
if conf.env['HAVE_LILV'] or conf.env['HAVE_SLV2']:
conf.define ('LV2_SUPPORT', 1)
conf.write_config_header('libardour-config.h')
conf.write_config_header('libardour-config.h', remove=False)
# Boost headers
autowaf.check_header(conf, 'boost/shared_ptr.hpp')
autowaf.check_header(conf, 'boost/weak_ptr.hpp')
autowaf.check_header(conf, 'boost/scoped_ptr.hpp')
autowaf.check_header(conf, 'boost/ptr_container/ptr_list.hpp')
autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
autowaf.check_header(conf, 'cxx', 'boost/scoped_ptr.hpp')
autowaf.check_header(conf, 'cxx', 'boost/ptr_container/ptr_list.hpp')
def build(bld):
# Library
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'c cxx cshlib cxxshlib')
obj.source = libardour_sources
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.includes = ['.', '../surfaces/control_protocol', '..']
obj.name = 'libardour'
obj.target = 'ardour'
obj.uselib = ['GLIBMM','GTHREAD','AUBIO','SIGCPP','XML','UUID',
'JACK','SNDFILE','SAMPLERATE','LRDF','AUDIOUNIT',
'OSX','BOOST','CURL','DL']
obj.uselib_local = ['libpbd','libmidipp','libevoral','libvamphost',
obj.use = ['libpbd','libmidipp','libevoral','libvamphost',
'libvampplugin','libtaglib','librubberband',
'libaudiographer']
obj.vnum = LIBARDOUR_LIB_VERSION
@ -369,7 +368,7 @@ def build(bld):
obj.defines = [
'PACKAGE="libardour3"',
'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
'CONFIG_DIR="' + os.path.normpath(bld.env['CONFIGDIR']) + '"',
'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
'MODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"',
'LOCALEDIR="' + os.path.join(
os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
@ -405,7 +404,7 @@ def build(bld):
if bld.env['COREAUDIO']:
obj.source += [ 'coreaudiosource.cc', 'caimportable.cc' ]
obj.uselib_local += ['libappleutility']
obj.use += ['libappleutility']
obj.source += [ 'audio_unit.cc' ]
if bld.env['FPU_OPTIMIZATION']:
@ -417,7 +416,7 @@ def build(bld):
# i18n
if bld.env['ENABLE_NLS']:
mo_files = glob.glob(os.path.join(bld.get_curdir(), 'po/*.mo'))
mo_files = bld.path.ant_glob('po/*.mo')
for mo in mo_files:
lang = os.path.basename(mo).replace('.mo', '')
bld.install_as(os.path.join(bld.env['PREFIX'], 'share', 'locale',
@ -426,7 +425,7 @@ def build(bld):
if bld.env['BUILD_TESTS'] and bld.env['HAVE_CPPUNIT']:
# Unit tests
testobj = bld.new_task_gen('cxx', 'program')
testobj = bld(features = 'cxx cxxprogram')
testobj.source = '''
test/bbt_test.cpp
test/interpolation_test.cpp
@ -438,14 +437,14 @@ def build(bld):
testobj.includes = obj.includes + ['test', '../pbd']
testobj.uselib = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
'SAMPLERATE','XML','LRDF','COREAUDIO']
testobj.uselib_local = ['libpbd','libmidipp','libardour']
testobj.use = ['libpbd','libmidipp','libardour']
testobj.name = 'libardour-tests'
testobj.target = 'run-tests'
testobj.install_path = ''
testobj.defines = [
'PACKAGE="libardour3test"',
'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
'CONFIG_DIR="' + os.path.normpath(bld.env['CONFIGDIR']) + '"',
'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
'MODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"',
'LOCALEDIR="' + os.path.join(
os.path.normpath(bld.env['DATADIR']), 'locale') + '"',

View File

@ -1,439 +0,0 @@
#!/usr/bin/env python
# Waf utilities for easily building standard unixey packages/libraries
# Licensed under the GNU GPL v2 or later, see COPYING file for details.
# Copyright (C) 2008 David Robillard
# Copyright (C) 2008 Nedko Arnaudov
import Configure
import Options
import Utils
import misc
import os
import subprocess
import sys
from TaskGen import feature, before, after
global g_is_child
g_is_child = False
# Only run autowaf hooks once (even if sub projects call several times)
global g_step
g_step = 0
# Compute dependencies globally
#import preproc
#preproc.go_absolute = True
@feature('cc', 'cxx')
@after('apply_lib_vars')
@before('apply_obj_vars_cc', 'apply_obj_vars_cxx')
def include_config_h(self):
self.env.append_value('INC_PATHS', self.bld.srcnode)
def set_options(opt):
"Add standard autowaf options if they havn't been added yet"
global g_step
if g_step > 0:
return
opt.tool_options('compiler_cc')
opt.tool_options('compiler_cxx')
opt.add_option('--debug', action='store_true', default=False, dest='debug',
help="Build debuggable binaries [Default: False]")
opt.add_option('--strict', action='store_true', default=False, dest='strict',
help="Use strict compiler flags and show all warnings [Default: False]")
opt.add_option('--docs', action='store_true', default=False, dest='docs',
help="Build documentation - requires doxygen [Default: False]")
opt.add_option('--bundle', action='store_true', default=False,
help="Build a self-contained bundle [Default: False]")
opt.add_option('--bindir', type='string',
help="Executable programs [Default: PREFIX/bin]")
opt.add_option('--libdir', type='string',
help="Libraries [Default: PREFIX/lib]")
opt.add_option('--includedir', type='string',
help="Header files [Default: PREFIX/include]")
opt.add_option('--datadir', type='string',
help="Shared data [Default: PREFIX/share]")
opt.add_option('--configdir', type='string',
help="Configuration data [Default: PREFIX/etc]")
opt.add_option('--mandir', type='string',
help="Manual pages [Default: DATADIR/man]")
opt.add_option('--htmldir', type='string',
help="HTML documentation [Default: DATADIR/doc/PACKAGE]")
opt.add_option('--lv2-user', action='store_true', default=False, dest='lv2_user',
help="Install LV2 bundles to user-local location [Default: False]")
if sys.platform == "darwin":
opt.add_option('--lv2dir', type='string',
help="LV2 bundles [Default: /Library/Audio/Plug-Ins/LV2]")
else:
opt.add_option('--lv2dir', type='string',
help="LV2 bundles [Default: LIBDIR/lv2]")
g_step = 1
def check_header(conf, name, define='', mandatory=False):
"Check for a header iff it hasn't been checked for yet"
if type(conf.env['AUTOWAF_HEADERS']) != dict:
conf.env['AUTOWAF_HEADERS'] = {}
checked = conf.env['AUTOWAF_HEADERS']
if not name in checked:
checked[name] = True
includes = '' # search default system include paths
if sys.platform == "darwin":
includes = '/opt/local/include'
if define != '':
conf.check(header_name=name, includes=includes, define_name=define, mandatory=mandatory)
else:
conf.check(header_name=name, includes=includes, mandatory=mandatory)
def nameify(name):
return name.replace('/', '_').replace('++', 'PP').replace('-', '_').replace('.', '_')
def check_pkg(conf, name, **args):
if not 'mandatory' in args:
args['mandatory'] = True
"Check for a package iff it hasn't been checked for yet"
var_name = 'HAVE_' + nameify(args['uselib_store'])
check = not var_name in conf.env
if not check and 'atleast_version' in args:
# Re-check if version is newer than previous check
checked_version = conf.env['VERSION_' + name]
if checked_version and checked_version < args['atleast_version']:
check = True;
if check:
conf.check_cfg(package=name, args="--cflags --libs", **args)
found = bool(conf.env[var_name])
if found:
conf.define(var_name, int(found))
if 'atleast_version' in args:
conf.env['VERSION_' + name] = args['atleast_version']
else:
conf.undefine(var_name)
if args['mandatory'] == True:
conf.fatal("Required package " + name + " not found")
def configure(conf):
global g_step
if g_step > 1:
return
def append_cxx_flags(vals):
conf.env.append_value('CCFLAGS', vals.split())
conf.env.append_value('CXXFLAGS', vals.split())
conf.line_just = 43
display_header('Global Configuration')
conf.check_tool('misc')
conf.check_tool('compiler_cc')
conf.check_tool('compiler_cxx')
conf.env['DOCS'] = Options.options.docs
conf.env['DEBUG'] = Options.options.debug
conf.env['STRICT'] = Options.options.strict
conf.env['PREFIX'] = os.path.abspath(os.path.expanduser(os.path.normpath(conf.env['PREFIX'])))
if Options.options.bundle:
conf.env['BUNDLE'] = True
conf.define('BUNDLE', 1)
conf.env['BINDIR'] = conf.env['PREFIX']
conf.env['INCLUDEDIR'] = os.path.join(conf.env['PREFIX'], 'Headers')
conf.env['LIBDIR'] = os.path.join(conf.env['PREFIX'], 'Libraries')
conf.env['DATADIR'] = os.path.join(conf.env['PREFIX'], 'Resources')
conf.env['HTMLDIR'] = os.path.join(conf.env['PREFIX'], 'Resources/Documentation')
conf.env['MANDIR'] = os.path.join(conf.env['PREFIX'], 'Resources/Man')
conf.env['LV2DIR'] = os.path.join(conf.env['PREFIX'], 'PlugIns')
else:
conf.env['BUNDLE'] = False
if Options.options.bindir:
conf.env['BINDIR'] = Options.options.bindir
else:
conf.env['BINDIR'] = os.path.join(conf.env['PREFIX'], 'bin')
if Options.options.includedir:
conf.env['INCLUDEDIR'] = Options.options.includedir
else:
conf.env['INCLUDEDIR'] = os.path.join(conf.env['PREFIX'], 'include')
if Options.options.libdir:
conf.env['LIBDIR'] = Options.options.libdir
else:
conf.env['LIBDIR'] = os.path.join(conf.env['PREFIX'], 'lib')
if Options.options.datadir:
conf.env['DATADIR'] = Options.options.datadir
else:
conf.env['DATADIR'] = os.path.join(conf.env['PREFIX'], 'share')
if Options.options.configdir:
conf.env['CONFIGDIR'] = Options.options.configdir
else:
conf.env['CONFIGDIR'] = os.path.join(conf.env['PREFIX'], 'etc')
if Options.options.htmldir:
conf.env['HTMLDIR'] = Options.options.htmldir
else:
conf.env['HTMLDIR'] = os.path.join(conf.env['DATADIR'], 'doc', Utils.g_module.APPNAME)
if Options.options.mandir:
conf.env['MANDIR'] = Options.options.mandir
else:
conf.env['MANDIR'] = os.path.join(conf.env['DATADIR'], 'man')
if Options.options.lv2dir:
conf.env['LV2DIR'] = Options.options.lv2dir
else:
if Options.options.lv2_user:
if sys.platform == "darwin":
conf.env['LV2DIR'] = os.path.join(os.getenv('HOME'), 'Library/Audio/Plug-Ins/LV2')
else:
conf.env['LV2DIR'] = os.path.join(os.getenv('HOME'), '.lv2')
else:
if sys.platform == "darwin":
conf.env['LV2DIR'] = '/Library/Audio/Plug-Ins/LV2'
else:
conf.env['LV2DIR'] = os.path.join(conf.env['LIBDIR'], 'lv2')
conf.env['BINDIRNAME'] = os.path.basename(conf.env['BINDIR'])
conf.env['LIBDIRNAME'] = os.path.basename(conf.env['LIBDIR'])
conf.env['DATADIRNAME'] = os.path.basename(conf.env['DATADIR'])
conf.env['CONFIGDIRNAME'] = os.path.basename(conf.env['CONFIGDIR'])
conf.env['LV2DIRNAME'] = os.path.basename(conf.env['LV2DIR'])
if Options.options.docs:
doxygen = conf.find_program('doxygen')
if not doxygen:
conf.fatal("Doxygen is required to build documentation, configure without --docs")
dot = conf.find_program('dot')
if not dot:
conf.fatal("Graphviz (dot) is required to build documentation, configure without --docs")
if Options.options.debug:
conf.env['CCFLAGS'] = [ '-O0', '-g' ]
conf.env['CXXFLAGS'] = [ '-O0', '-g' ]
else:
append_cxx_flags('-DNDEBUG')
if Options.options.strict:
conf.env.append_value('CCFLAGS', [ '-std=c99', '-pedantic' ])
conf.env.append_value('CXXFLAGS', [ '-ansi', '-Woverloaded-virtual', '-Wnon-virtual-dtor'])
append_cxx_flags('-Wall -Wextra -Wno-unused-parameter')
append_cxx_flags('-fPIC -DPIC -fshow-column')
display_msg(conf, "Install prefix", conf.env['PREFIX'])
display_msg(conf, "Debuggable build", str(conf.env['DEBUG']))
display_msg(conf, "Strict compiler flags", str(conf.env['STRICT']))
display_msg(conf, "Build documentation", str(conf.env['DOCS']))
print
g_step = 2
def set_local_lib(conf, name, has_objects):
conf.define('HAVE_' + nameify(name.upper()), 1)
if has_objects:
if type(conf.env['AUTOWAF_LOCAL_LIBS']) != dict:
conf.env['AUTOWAF_LOCAL_LIBS'] = {}
conf.env['AUTOWAF_LOCAL_LIBS'][name.lower()] = True
else:
if type(conf.env['AUTOWAF_LOCAL_HEADERS']) != dict:
conf.env['AUTOWAF_LOCAL_HEADERS'] = {}
conf.env['AUTOWAF_LOCAL_HEADERS'][name.lower()] = True
def use_lib(bld, obj, libs):
abssrcdir = os.path.abspath('.')
libs_list = libs.split()
for l in libs_list:
in_headers = l.lower() in bld.env['AUTOWAF_LOCAL_HEADERS']
in_libs = l.lower() in bld.env['AUTOWAF_LOCAL_LIBS']
if in_libs:
if hasattr(obj, 'uselib_local'):
obj.uselib_local += ' lib' + l.lower() + ' '
else:
obj.uselib_local = 'lib' + l.lower() + ' '
if in_headers or in_libs:
inc_flag = '-iquote ' + os.path.join(abssrcdir, l.lower())
for f in ['CCFLAGS', 'CXXFLAGS']:
if not inc_flag in bld.env[f]:
bld.env.append_value(f, inc_flag)
else:
if hasattr(obj, 'uselib'):
obj.uselib += ' ' + l
else:
obj.uselib = l
def display_header(title):
Utils.pprint('BOLD', title)
def display_msg(conf, msg, status = None, color = None):
color = 'CYAN'
if type(status) == bool and status or status == "True":
color = 'GREEN'
elif type(status) == bool and not status or status == "False":
color = 'YELLOW'
Utils.pprint('BOLD', "%s :" % msg.ljust(conf.line_just), sep='')
Utils.pprint(color, status)
def link_flags(env, lib):
return ' '.join(map(lambda x: env['LIB_ST'] % x, env['LIB_' + lib]))
def compile_flags(env, lib):
return ' '.join(map(lambda x: env['CPPPATH_ST'] % x, env['CPPPATH_' + lib]))
def set_recursive():
global g_is_child
g_is_child = True
def is_child():
global g_is_child
return g_is_child
# Pkg-config file
def build_pc(bld, name, version, libs):
'''Build a pkg-config file for a library.
name -- uppercase variable name (e.g. 'SOMENAME')
version -- version string (e.g. '1.2.3')
libs -- string/list of dependencies (e.g. 'LIBFOO GLIB')
'''
obj = bld.new_task_gen('subst')
obj.source = name.lower() + '.pc.in'
obj.target = name.lower() + '.pc'
obj.install_path = '${PREFIX}/${LIBDIRNAME}/pkgconfig'
pkg_prefix = bld.env['PREFIX']
if pkg_prefix[-1] == '/':
pkg_prefix = pkg_prefix[:-1]
obj.dict = {
'prefix' : pkg_prefix,
'exec_prefix' : '${prefix}',
'libdir' : '${prefix}/' + bld.env['LIBDIRNAME'],
'includedir' : '${prefix}/include',
name + '_VERSION' : version,
}
if type(libs) != list:
libs = libs.split()
for i in libs:
obj.dict[i + '_LIBS'] = link_flags(bld.env, i)
obj.dict[i + '_CFLAGS'] = compile_flags(bld.env, i)
# Doxygen API documentation
def build_dox(bld, name, version, srcdir, blddir):
if not bld.env['DOCS']:
return
obj = bld.new_task_gen('subst')
obj.source = 'doc/reference.doxygen.in'
obj.target = 'doc/reference.doxygen'
if is_child():
src_dir = os.path.join(srcdir, name.lower())
doc_dir = os.path.join(blddir, 'default', name.lower(), 'doc')
else:
src_dir = srcdir
doc_dir = os.path.join(blddir, 'default', 'doc')
obj.dict = {
name + '_VERSION' : version,
name + '_SRCDIR' : os.path.abspath(src_dir),
name + '_DOC_DIR' : os.path.abspath(doc_dir)
}
obj.install_path = ''
out1 = bld.new_task_gen('command-output')
out1.dependencies = [obj]
out1.stdout = '/doc/doxygen.out'
out1.stdin = '/doc/reference.doxygen' # whatever..
out1.command = 'doxygen'
out1.argv = [os.path.abspath(doc_dir) + '/reference.doxygen']
out1.command_is_external = True
# Version code file generation
def build_version_files(header_path, source_path, domain, major, minor, micro):
header_path = os.path.abspath(header_path)
source_path = os.path.abspath(source_path)
text = "int " + domain + "_major_version = " + str(major) + ";\n"
text += "int " + domain + "_minor_version = " + str(minor) + ";\n"
text += "int " + domain + "_micro_version = " + str(micro) + ";\n"
try:
o = file(source_path, 'w')
o.write(text)
o.close()
except IOError:
print "Could not open", source_path, " for writing\n"
sys.exit(-1)
text = "#ifndef __" + domain + "_version_h__\n"
text += "#define __" + domain + "_version_h__\n"
text += "extern const char* " + domain + "_revision;\n"
text += "extern int " + domain + "_major_version;\n"
text += "extern int " + domain + "_minor_version;\n"
text += "extern int " + domain + "_micro_version;\n"
text += "#endif /* __" + domain + "_version_h__ */\n"
try:
o = file(header_path, 'w')
o.write(text)
o.close()
except IOError:
print "Could not open", header_path, " for writing\n"
sys.exit(-1)
return None
def run_tests(ctx, appname, tests):
orig_dir = os.path.abspath(os.curdir)
failures = 0
base = '..'
top_level = os.path.abspath(ctx.curdir) != os.path.abspath(os.curdir)
if top_level:
os.chdir('./build/default/' + appname)
base = '../..'
else:
os.chdir('./build/default')
lcov = True
lcov_log = open('lcov.log', 'w')
try:
# Clear coverage data
subprocess.call('lcov -d ./src -z'.split(),
stdout=lcov_log, stderr=lcov_log)
except:
lcov = False
print "Failed to run lcov, no coverage report will be generated"
# Run all tests
for i in tests:
print
Utils.pprint('BOLD', 'Running %s test %s' % (appname, i))
if subprocess.call(i) == 0:
Utils.pprint('GREEN', 'Passed %s %s' % (appname, i))
else:
failures += 1
Utils.pprint('RED', 'Failed %s %s' % (appname, i))
if lcov:
# Generate coverage data
coverage_lcov = open('coverage.lcov', 'w')
subprocess.call(('lcov -c -d ./src -d ./test -b ' + base).split(),
stdout=coverage_lcov, stderr=lcov_log)
coverage_lcov.close()
# Strip out unwanted stuff
coverage_stripped_lcov = open('coverage-stripped.lcov', 'w')
subprocess.call('lcov --remove coverage.lcov *boost* c++*'.split(),
stdout=coverage_stripped_lcov, stderr=lcov_log)
coverage_stripped_lcov.close()
# Generate HTML coverage output
if not os.path.isdir('./coverage'):
os.makedirs('./coverage')
subprocess.call('genhtml -o coverage coverage-stripped.lcov'.split(),
stdout=lcov_log, stderr=lcov_log)
lcov_log.close()
print
Utils.pprint('BOLD', 'Summary:', sep=''),
if failures == 0:
Utils.pprint('GREEN', 'All ' + appname + ' tests passed')
else:
Utils.pprint('RED', str(failures) + ' ' + appname + ' test(s) failed')
Utils.pprint('BOLD', 'Coverage:', sep='')
print os.path.abspath('coverage/index.html')
os.chdir(orig_dir)
def shutdown():
# This isn't really correct (for packaging), but people asking is annoying
if Options.commands['install']:
try: os.popen("/sbin/ldconfig")
except: pass

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Version of this package (even if built as a child)
@ -19,10 +19,10 @@ APPNAME = 'audiographer'
VERSION = AUDIOGRAPHER_VERSION
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
@ -39,8 +39,8 @@ def configure(conf):
autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18', mandatory=False)
# Boost headers
autowaf.check_header(conf, 'boost/shared_ptr.hpp')
autowaf.check_header(conf, 'boost/format.hpp')
autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
autowaf.check_header(conf, 'cxx', 'boost/format.hpp')
def build(bld):
@ -53,7 +53,7 @@ def build(bld):
#bld.env['BUILD_TESTS'] = True
bld.env['HAVE_ALL_GTHREAD'] = bld.env['HAVE_GLIB'] and bld.env['HAVE_GLIBMM'] and bld.env['HAVE_GTHREAD']
audiographer = bld.new_task_gen('cxx', 'shlib')
audiographer = bld(features = 'cxx cxxshlib')
audiographer.source = '''
private/gdither/gdither.cc
src/general/sample_format_converter.cc
@ -69,17 +69,17 @@ def build(bld):
audiographer.name = 'libaudiographer'
audiographer.target = 'audiographer'
audiographer.export_incdirs = ['.', './src']
audiographer.export_includes = ['.', './src']
audiographer.includes = ['.', './src']
audiographer.uselib = 'GLIB GLIBMM GTHREAD SAMPLERATE SNDFILE'
audiographer.uselib_local = 'libpbd'
audiographer.use = 'libpbd'
audiographer.vnum = AUDIOGRAPHER_LIB_VERSION
audiographer.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
if bld.env['BUILD_TESTS'] and bld.env['HAVE_CPPUNIT']:
# Unit tests
obj = bld.new_task_gen('cxx', 'program')
obj = bld(features = 'cxx cxxprogram')
obj.source = '''
tests/test_runner.cc
tests/type_utils_test.cc
@ -109,7 +109,7 @@ def build(bld):
tests/general/sr_converter_test.cc
'''
obj.uselib_local = 'libaudiographer'
obj.use = 'libaudiographer'
obj.uselib = 'CPPUNIT GLIBMM'
obj.target = 'run-tests'
obj.install_path = ''

View File

@ -1,14 +1,14 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
import sys
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
path_prefix = 'libs/clearlooks-newer'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
@ -16,7 +16,7 @@ def configure(conf):
conf.check_tool('compiler_cc')
def build(bld):
obj = bld.new_task_gen('cc', 'shlib')
obj = bld(features = 'c cshlib')
obj.source = '''
animation.c
cairo-support.c
@ -40,7 +40,7 @@ def build(bld):
if sys.platform == 'darwin':
# Bit of a hack: make a symlink to the .dylib that meets GTK's criteria for finding it (namely that the library must be a *.so
# and that it must reside in a directory called `engines')
obj = bld.new_task_gen(target = 'engines', rule = 'mkdir -p ${TGT} && rm -f ${TGT}/libclearlooks.so && ln -s ../libclearlooks.dylib ${TGT}/libclearlooks.so')
obj = bld(target = 'engines', rule = 'mkdir -p ${TGT} && rm -f ${TGT}/libclearlooks.so && ln -s ../libclearlooks.dylib ${TGT}/libclearlooks.so')
def shutdown():

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import Options
import os
@ -19,10 +19,10 @@ APPNAME = 'evoral'
VERSION = EVORAL_VERSION
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
opt.add_option('--test', action='store_true', default=False, dest='build_tests',
help="Build unit tests")
@ -38,8 +38,8 @@ def configure(conf):
autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.14.0')
# Boost headers
autowaf.check_header(conf, 'boost/shared_ptr.hpp')
autowaf.check_header(conf, 'boost/weak_ptr.hpp')
autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
conf.env['BUILD_TESTS'] = Options.options.build_tests
@ -54,7 +54,7 @@ def build(bld):
# Pkgconfig file
#autowaf.build_pc(bld, 'EVORAL', EVORAL_VERSION, 'GLIBMM GTHREAD')
libsmf = bld.new_task_gen('cc', 'shlib')
libsmf = bld(features = 'c cshlib')
libsmf.source = '''
src/libsmf/smf.c
src/libsmf/smf_decode.c
@ -62,7 +62,7 @@ def build(bld):
src/libsmf/smf_save.c
src/libsmf/smf_tempo.c
'''
libsmf.export_incdirs = ['./src/libsmf']
libsmf.export_includes = ['./src/libsmf']
libsmf.defines = 'SMF_VERSION="1.2"'
libsmf.includes = ['./src']
libsmf.name = 'libsmf'
@ -85,50 +85,50 @@ def build(bld):
'''
# Library
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = lib_source
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.includes = ['.', './src']
obj.name = 'libevoral'
obj.target = 'evoral'
obj.uselib = 'GLIBMM GTHREAD SMF'
obj.uselib_local = 'libsmf libpbd'
obj.use = 'libsmf libpbd'
obj.vnum = EVORAL_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
obj.defines = ['PACKAGE="libevoral"' ]
if bld.env['BUILD_TESTS'] and bld.env['HAVE_CPPUNIT']:
# Static library (for unit test code coverage)
obj = bld.new_task_gen('cxx', 'staticlib')
obj = bld(features = 'cxx cstlib')
obj.source = lib_source
obj.source = lib_source
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.includes = ['.', './src']
obj.name = 'libevoral_static'
obj.target = 'evoral_static'
obj.uselib = 'GLIBMM GTHREAD SMF'
obj.uselib_local = 'libsmf libpbd'
obj.use = 'libsmf libpbd'
obj.vnum = EVORAL_LIB_VERSION
obj.install_path = ''
obj.ccflags = [ '-fprofile-arcs', '-ftest-coverage' ]
obj.cflags = [ '-fprofile-arcs', '-ftest-coverage' ]
obj.cxxflags = [ '-fprofile-arcs', '-ftest-coverage' ]
obj.defines = ['PACKAGE="libevoral"' ]
# Unit tests
obj = bld.new_task_gen('cxx', 'program')
obj = bld(features = 'cxx cxxprogram')
obj.source = '''
test/SequenceTest.cpp
test/SMFTest.cpp
test/testrunner.cpp
'''
obj.includes = ['.', './src']
obj.uselib_local = 'libevoral_static'
obj.use = 'libevoral_static'
obj.uselib = 'CPPUNIT SNDFILE'
obj.libs = 'gcov'
obj.target = 'run-tests'
obj.name = 'libevoral-tests'
obj.install_path = ''
obj.ccflags = [ '-fprofile-arcs', '-ftest-coverage' ]
obj.cflags = [ '-fprofile-arcs', '-ftest-coverage' ]
obj.cxxflags = [ '-fprofile-arcs', '-ftest-coverage' ]
def shutdown():

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Version of this package (even if built as a child)
@ -19,8 +19,8 @@ APPNAME = 'libgnomecanvas'
VERSION = LIBGNOMECANVAS_VERSION
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
path_prefix = 'libs/gnomecanvas/'
@ -41,7 +41,7 @@ libgnomecanvas_sources = [
'libgnomecanvas/libgnomecanvastypes.c'
]
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
@ -52,9 +52,9 @@ def configure(conf):
def build(bld):
# Library
obj = bld.new_task_gen('cc', 'shlib')
obj = bld(features = 'c cshlib')
obj.source = libgnomecanvas_sources
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.includes = ['.']
obj.name = 'libgnomecanvas-2'
obj.target = 'gnomecanvas-2'

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
import glob
# Version of this package (even if built as a child)
MAJOR = '0'
@ -60,12 +59,12 @@ gtkmm2ext_sources = [
]
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
path_prefix = 'libs/gtkmm2ext/'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
@ -78,20 +77,20 @@ def configure(conf):
def build(bld):
obj = bld.new_task_gen(features = 'cc cxx cshlib')
obj = bld(features = 'c cxx cxxshlib cshlib')
obj.source = gtkmm2ext_sources
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.includes = ['.']
obj.name = 'libgtkmm2ext'
obj.target = 'gtkmm2ext'
obj.uselib = 'GTKMM GTK GTKOSX OSX GDK'
obj.uselib_local = 'libpbd'
obj.use = 'libpbd'
obj.vnum = GTKMM2EXT_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
obj.cxxflags = [
'-DPACKAGE="libgtkmm2ext"',
'-DLOCALEDIR="' + os.path.join(
os.path.normpath(bld.env['DATADIRNAME']), 'locale') + '"']
os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
if bld.env['GTKOSX']:
obj.source += ['gtkapplication_quartz.mm']
else:
@ -99,7 +98,7 @@ def build(bld):
# i18n
if bld.env['ENABLE_NLS']:
mo_files = glob.glob (os.path.join (bld.get_curdir(), 'po/*.mo'))
mo_files = bld.path.ant_glob ('po/*.mo')
for mo in mo_files:
lang = os.path.basename (mo).replace ('.mo', '')
bld.install_as (os.path.join(bld.env['PREFIX'], 'share', 'locale',

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
import sys
@ -20,12 +20,12 @@ APPNAME = 'libmidipp'
VERSION = LIBMIDIPP_VERSION
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
path_prefix = 'libs/midi++2/'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
@ -38,12 +38,12 @@ def configure(conf):
autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
# Boost headers
autowaf.check_header(conf, 'boost/shared_ptr.hpp')
autowaf.check_header(conf, 'boost/weak_ptr.hpp')
autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
def build(bld):
# Library
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = '''
midi.cc
channel.cc
@ -57,12 +57,12 @@ def build(bld):
'''
# everybody loves JACK
obj.cxxflags = [ '-DWITH_JACK_MIDI' ]
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.includes = ['.', '../surfaces/control_protocol']
obj.name = 'libmidipp'
obj.target = 'midipp'
obj.uselib = 'GLIBMM SIGCPP XML JACK OSX'
obj.uselib_local = 'libpbd libevoral libtimecode'
obj.use = 'libpbd libevoral libtimecode'
obj.vnum = LIBMIDIPP_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Library version (UNIX style major, minor, micro)
@ -9,24 +9,24 @@ import os
LIBARDOUR_PAN1IN2OUT_LIB_VERSION = '1.0.0'
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
autowaf.configure(conf)
def build(bld):
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = [ 'panner_1in2out.cc' ]
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.cxxflags = '-DPACKAGE="libardour_pan1in2out"'
obj.includes = ['.']
obj.name = 'libardour_pan1in2out'
obj.target = 'pan1in2out'
obj.uselib_local = 'libardour libardour_cp libpbd'
obj.use = 'libardour libardour_cp libpbd'
obj.vnum = LIBARDOUR_PAN1IN2OUT_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3', 'panners')

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Library version (UNIX style major, minor, micro)
@ -9,24 +9,24 @@ import os
LIBARDOUR_PAN2IN2OUT_LIB_VERSION = '1.0.0'
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
autowaf.configure(conf)
def build(bld):
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = [ 'panner_2in2out.cc' ]
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.cxxflags = '-DPACKAGE="libardour_pan2in2out"'
obj.includes = ['.']
obj.name = 'libardour_pan2in2out'
obj.target = 'pan2in2out'
obj.uselib_local = 'libardour libardour_cp libpbd'
obj.use = 'libardour libardour_cp libpbd'
obj.vnum = LIBARDOUR_PAN2IN2OUT_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3', 'panners')

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Library version (UNIX style major, minor, micro)
@ -9,24 +9,24 @@ import os
LIBARDOUR_PANVBAP_LIB_VERSION = '1.0.0'
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
autowaf.configure(conf)
def build(bld):
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = [ 'vbap_speakers.cc', 'vbap.cc' ]
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.cxxflags = '-DPACKAGE="libardour_panvbap"'
obj.includes = ['.']
obj.name = 'libardour_panvbap'
obj.target = 'panvbap'
obj.uselib_local = 'libardour libardour_cp libpbd'
obj.use = 'libardour libardour_cp libpbd'
obj.vnum = LIBARDOUR_PANVBAP_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3', 'panners')

View File

@ -1,14 +1,14 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
panners = [ '2in2out', '1in2out', 'vbap' ]
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def sub_config_and_use(conf, name, has_objects = True):

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
import sys
import TaskGen
@ -21,12 +21,12 @@ APPNAME = 'libpbd'
VERSION = LIBPBD_VERSION
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
path_prefix = 'libs/pbd/'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
@ -42,19 +42,19 @@ def configure(conf):
conf.check(function_name='getmntent', header_name='mntent.h', define_name='HAVE_GETMNTENT')
conf.check(header_name='execinfo.h', define_name='HAVE_EXECINFO')
conf.check(header_name='unistd.h', define_name='HAVE_UNISTD')
if conf.check_cc(function_name='posix_memalign', header_name='stdlib.h', ccflags='-D_XOPEN_SOURCE=600') == False:
if conf.check_cc(function_name='posix_memalign', header_name='stdlib.h', cflags='-D_XOPEN_SOURCE=600') == False:
conf.define ('NO_POSIX_MEMALIGN',1)
conf.write_config_header('libpbd-config.h')
conf.write_config_header('libpbd-config.h', remove=False)
# Boost headers
autowaf.check_header(conf, 'boost/shared_ptr.hpp')
autowaf.check_header(conf, 'boost/weak_ptr.hpp')
# autowaf.check_header(conf, 'boost/uuid/uuid.hpp')
autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
# autowaf.check_header(conf, 'cxx', 'boost/uuid/uuid.hpp')
def build(bld):
# Library
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = '''
basename.cc
base_ui.cc
@ -111,7 +111,7 @@ def build(bld):
if bld.env['DEBUG_RT_ALLOC']:
obj.source += 'debug_rt_alloc.c'
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.includes = ['.']
obj.name = 'libpbd'
obj.target = 'pbd'
@ -129,7 +129,7 @@ def build(bld):
if bld.env['BUILD_TESTS'] and bld.env['HAVE_CPPUNIT']:
# Unit tests
testobj = bld.new_task_gen('cxx', 'program')
testobj = bld(features = 'cxx cxxprogram')
testobj.source = '''
test/testrunner.cc
test/xpath.cc
@ -139,7 +139,7 @@ def build(bld):
testobj.target = 'run-tests'
testobj.includes = obj.includes + ['test', '../pbd']
testobj.uselib = 'CPPUNIT XML SNDFILE'
testobj.uselib_local = 'libpbd'
testobj.use = 'libpbd'
def shutdown():

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Version of this package (even if built as a child)
@ -16,10 +16,10 @@ APPNAME = 'qm-dsp'
VERSION = QM_DSP_VERSION
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
@ -28,7 +28,7 @@ def configure(conf):
def build(bld):
# Host Library
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = '''
dsp/onsets/DetectionFunction.cpp
dsp/onsets/PeakPicking.cpp
@ -47,7 +47,7 @@ def build(bld):
maths/MathUtilities.cpp
base/Pitch.cpp
'''
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.includes = ['.']
obj.name = 'libqmdsp'
obj.target = 'qmdsp'

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
import autowaf
import glob
from waflib.extras import autowaf as autowaf
import os
import glob
# Version of this package (even if built as a child)
LIBRUBBERBAND_VERSION = '0.0.0'
@ -17,10 +17,10 @@ APPNAME = 'librubberband'
VERSION = LIBRUBBERBAND_VERSION
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
@ -29,18 +29,18 @@ def configure(conf):
def build(bld):
# Library
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
prefix = 'libs/rubberband/'
sources = glob.glob(prefix + 'src/*.cpp')
obj.source = [ ]
for i in sources:
obj.source += [ i.replace(prefix, '') ]
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.includes = ['.', 'rubberband']
obj.name = 'librubberband'
obj.target = 'rubberband'
obj.uselib = 'FFTW3 FFTW3F SAMPLERATE SNDFILE'
obj.uselib_local = 'libvamphost'
obj.use = 'libvamphost'
obj.vnum = LIBRUBBERBAND_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
obj.cxxflags = '-DPACKAGE="librubberband"'

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Library version (UNIX style major, minor, micro)
@ -10,27 +10,27 @@ APPNAME = 'libardour_cp'
LIBARDOUR_CP_LIB_VERSION = '4.1.0'
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
autowaf.configure(conf)
def build(bld):
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = '''
basic_ui.cc
control_protocol.cc
'''
obj.export_incdirs = ['.', './control_protocol' ]
obj.export_includes = ['.', './control_protocol' ]
obj.cxxflags = '-DPACKAGE="ardour_cp"'
obj.includes = ['.', './control_protocol']
obj.name = 'libardour_cp'
obj.target = 'ardourcp'
obj.uselib_local = 'libardour libtimecode'
obj.use = 'libardour libtimecode'
obj.vnum = LIBARDOUR_CP_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Version of this package (even if built as a child)
@ -16,10 +16,10 @@ APPNAME = 'libsurfaces'
VERSION = LIBSURFACES_VERSION
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
@ -27,18 +27,18 @@ def configure(conf):
def build(bld):
# Generic MIDI
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = '''
generic_midi_control_protocol.cc
interface.cc
midicontrollable.cc
'''
obj.export_incdirs = ['./generic_midi']
obj.export_includes = ['./generic_midi']
obj.cxxflags = '-DPACKAGE="ardour_genericmidi"'
obj.includes = ['.', './generic_midi']
obj.name = 'libgeneric_midi'
obj.target = 'generic_midi'
obj.uselib_local = 'libardour libsurfaces'
obj.use = 'libardour libsurfaces'
obj.vnum = LIBSURFACES_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3', 'surfaces')

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Library version (UNIX style major, minor, micro)
@ -9,17 +9,17 @@ import os
LIBARDOUR_GENERIC_MIDI_LIB_VERSION = '4.1.0'
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
autowaf.configure(conf)
def build(bld):
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = '''
generic_midi_control_protocol.cc
gmcp_gui.cc
@ -29,13 +29,13 @@ def build(bld):
midifunction.cc
midiaction.cc
'''
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.cxxflags = '-DPACKAGE="ardour_genericmidi"'
obj.includes = ['.', './generic_midi']
obj.name = 'libardour_generic_midi'
obj.target = 'ardour_generic_midi'
obj.uselib = 'GTKMM GTK GDK'
obj.uselib_local = 'libardour libardour_cp libgtkmm2ext libpbd'
obj.use = 'libardour libardour_cp libgtkmm2ext libpbd'
obj.vnum = LIBARDOUR_GENERIC_MIDI_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3', 'surfaces')

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Library version (UNIX style major, minor, micro)
@ -9,17 +9,17 @@ import os
LIBARDOUR_MCP_LIB_VERSION = '4.1.0'
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
autowaf.configure(conf)
def build(bld):
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = '''
bcf_surface.cc
bcf_surface_generated.cc
@ -41,13 +41,13 @@ def build(bld):
surface_port.cc
types.cc
'''
obj.export_incdirs = ['./mackie']
obj.export_includes = ['./mackie']
obj.cxxflags = '-DPACKAGE="ardour_mackie"'
obj.includes = ['.', './mackie']
obj.name = 'libardour_mcp'
obj.target = 'ardour_mcp'
obj.uselib = 'GTKMM'
obj.uselib_local = 'libardour libardour_cp libgtkmm2ext'
obj.use = 'libardour libardour_cp libgtkmm2ext'
obj.vnum = LIBARDOUR_MCP_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3', 'surfaces')

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Library version (UNIX style major, minor, micro)
@ -9,10 +9,10 @@ import os
LIBARDOUR_OSC_LIB_VERSION = '4.1.0'
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
@ -20,20 +20,20 @@ def configure(conf):
autowaf.check_pkg(conf, 'liblo', uselib_store='LO', linkflags='-llo')
def build(bld):
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = '''
osc.cc
osc_controllable.cc
osc_route_observer.cc
interface.cc
'''
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.cxxflags = '-DPACKAGE="ardour_cp"'
obj.includes = ['.', './osc']
obj.name = 'libardour_osc'
obj.target = 'ardour_osc'
obj.uselib = ' LO '
obj.uselib_local = 'libardour libardour_cp libpbd'
obj.use = 'libardour libardour_cp libpbd'
obj.vnum = LIBARDOUR_OSC_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3', 'surfaces')

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Library version (UNIX style major, minor, micro)
@ -9,27 +9,27 @@ import os
LIBARDOUR_POWERMATE_LIB_VERSION = '4.1.0'
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
autowaf.configure(conf)
def build(bld):
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = '''
interface.cc
powermate.cc
'''
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.cxxflags = '-DPACKAGE="ardour_powermate"'
obj.includes = ['.' ]
obj.name = 'libpowermate'
obj.target = 'powermate'
obj.uselib_local = 'libardour libardour_cp'
obj.use = 'libardour libardour_cp'
obj.vnum = LIBARDOUR_POWERMATE_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3', 'surfaces')

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Library version (UNIX style major, minor, micro)
@ -9,17 +9,17 @@ import os
LIBARDOUR_TRANZPORT_LIB_VERSION = '4.1.0'
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
autowaf.configure(conf)
def build(bld):
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = '''
button_events.cc
buttons.cc
@ -38,12 +38,12 @@ def build(bld):
wheel.cc
wheel_modes.cc
'''
obj.export_incdirs = ['./tranzport']
obj.export_includes = ['./tranzport']
obj.cxxflags = '-DPACKAGE="ardour_tranzport"'
obj.includes = ['.', './tranzport']
obj.name = 'libardour_tranzport'
obj.target = 'ardour_tranzport'
obj.uselib_local = 'libardour libardour_cp'
obj.use = 'libardour libardour_cp'
obj.vnum = LIBARDOUR_TRANZPORT_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3', 'surfaces')

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Library version (UNIX style major, minor, micro)
@ -9,27 +9,27 @@ import os
LIBARDOUR_WIIMOTE_LIB_VERSION = '4.1.0'
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
autowaf.configure(conf)
def build(bld):
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = '''
wiimote.cc
interface.cc
'''
obj.export_incdirs = ['./wiimote']
obj.export_includes = ['./wiimote']
obj.cxxflags = '-DPACKAGE="ardour_wiimote"'
obj.includes = ['.', './wiimote']
obj.name = 'libwiimote'
obj.target = 'wiimote'
obj.uselib_local = 'libardour libardour_cp'
obj.use = 'libardour libardour_cp'
obj.vnum = LIBARDOUR_WIIMOTE_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3', 'surfaces')

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import Options
# Version of this package (even if built as a child)
@ -16,8 +16,8 @@ APPNAME = 'libsurfaces'
VERSION = LIBSURFACES_VERSION
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
children = [
'control_protocol',
@ -30,7 +30,7 @@ children = [
'wiimote'
]
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def sub_config_and_use(conf, name, has_objects = True):
@ -44,7 +44,11 @@ def configure(conf):
for i in children:
sub_config_and_use(conf, i)
conf.check_cc (lib='libusb', header_name='libusb.h', function_name='usb_interrupt_write', define_name='BUILD_TRANZPORT')
autowaf.check_pkg(conf, 'libusb-1.0', uselib_store='USB', mandatory=False)
if conf.env['HAVE_USB']:
conf.define('BUILD_TRANZPORT', 1)
#conf.check_cc (lib='libusb', header_name='libusb.h', function_name='usb_interrupt_write', define_name='BUILD_TRANZPORT')
conf.check_cc (header_name='linux/input.h', define_name='BUILD_POWERMATE')
conf.check_cc (lib='lo', header_name='lo/lo.h', function_name='lo_server_new', define_name='BUILD_OSC')

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import glob
import os
@ -17,12 +17,10 @@ APPNAME = 'libtaglib'
VERSION = LIBTAGLIB_VERSION
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
path_prefix = 'libs/taglib/'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
@ -31,25 +29,23 @@ def configure(conf):
def build(bld):
# Library
obj = bld.new_task_gen('cxx', 'shlib')
sources = glob.glob(path_prefix + 'taglib/*.cpp')
sources += glob.glob(path_prefix + 'taglib/flac/*.cpp')
sources += glob.glob(path_prefix + 'taglib/mpc/*.cpp')
sources += glob.glob(path_prefix + 'taglib/mpeg/*.cpp')
sources += glob.glob(path_prefix + 'taglib/mpeg/id3v1/*.cpp')
sources += glob.glob(path_prefix + 'taglib/mpeg/id3v2/*.cpp')
sources += glob.glob(path_prefix + 'taglib/mpeg/id3v2/frames/*.cpp')
sources += glob.glob(path_prefix + 'taglib/ogg/*.cpp')
sources += glob.glob(path_prefix + 'taglib/ogg/vorbis/*.cpp')
sources += glob.glob(path_prefix + 'taglib/ogg/speex/*.cpp')
sources += glob.glob(path_prefix + 'taglib/ogg/flac/*.cpp')
sources += glob.glob(path_prefix + 'taglib/trueaudio/*.cpp')
sources += glob.glob(path_prefix + 'taglib/wavpack/*.cpp')
sources += glob.glob(path_prefix + 'taglib/ape/*.cpp')
sources += glob.glob(path_prefix + 'taglib/toolkit/*.cpp')
obj.source = []
for i in sources:
obj.source += [ i.replace(path_prefix, '') ]
obj = bld(features = 'cxx cxxshlib')
sources = bld.path.ant_glob('taglib/*.cpp')
sources += bld.path.ant_glob('taglib/flac/*.cpp')
sources += bld.path.ant_glob('taglib/mpc/*.cpp')
sources += bld.path.ant_glob('taglib/mpeg/*.cpp')
sources += bld.path.ant_glob('taglib/mpeg/id3v1/*.cpp')
sources += bld.path.ant_glob('taglib/mpeg/id3v2/*.cpp')
sources += bld.path.ant_glob('taglib/mpeg/id3v2/frames/*.cpp')
sources += bld.path.ant_glob('taglib/ogg/*.cpp')
sources += bld.path.ant_glob('taglib/ogg/vorbis/*.cpp')
sources += bld.path.ant_glob('taglib/ogg/speex/*.cpp')
sources += bld.path.ant_glob('taglib/ogg/flac/*.cpp')
sources += bld.path.ant_glob('taglib/trueaudio/*.cpp')
sources += bld.path.ant_glob('taglib/wavpack/*.cpp')
sources += bld.path.ant_glob('taglib/ape/*.cpp')
sources += bld.path.ant_glob('taglib/toolkit/*.cpp')
obj.source = sources
include_dirs = '''
taglib
@ -67,7 +63,7 @@ def build(bld):
taglib/ogg/speex
taglib/ogg/flac
'''.split()
obj.export_incdirs = ['.', 'taglib', 'taglib/toolkit']
obj.export_includes = ['.', 'taglib', 'taglib/toolkit']
obj.includes = include_dirs
obj.name = 'libtaglib'
obj.target = 'taglib'

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import Options
import os
@ -19,10 +19,10 @@ APPNAME = 'timecode'
VERSION = TIMECODE_VERSION
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
@ -32,9 +32,9 @@ def configure(conf):
def build(bld):
# Library
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = [ 'src/time.cc', 'src/bbt_time.cc' ]
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.includes = ['.', './src']
obj.name = 'libtimecode'
obj.target = 'timecode'

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Version of this package (even if built as a child)
@ -16,10 +16,10 @@ APPNAME = 'libardourvampplugins'
VERSION = LIBARDOURVAMPPLUGINS_VERSION
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
@ -27,11 +27,11 @@ def configure(conf):
conf.check_tool('compiler_cxx')
autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F', mandatory=True)
autowaf.check_pkg(conf, 'aubio', uselib_store='AUBIO', mandatory=False)
conf.write_config_header('libvampplugins-config.h')
conf.write_config_header('libvampplugins-config.h', remove=False)
def build(bld):
# Library
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = '''
plugins.cpp
AmplitudeFollower.cpp
@ -40,12 +40,12 @@ def build(bld):
SpectralCentroid.cpp
ZeroCrossing.cpp
'''
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.includes = ['.']
obj.name = 'libardourvampplugins'
obj.target = 'ardourvampplugins'
obj.uselib = 'FFTW3F'
obj.uselib_local = 'libvampplugin libqmdsp'
obj.use = 'libvampplugin libqmdsp'
if bld.env['HAVE_AUBIO']:
obj.source += ' Onset.cpp '
obj.uselib += ' AUBIO '

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import os
# Version of this package (even if built as a child)
@ -16,10 +16,10 @@ APPNAME = 'libvamp'
VERSION = LIBVAMP_VERSION
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
@ -31,7 +31,7 @@ def configure(conf):
def build(bld):
# Host Library
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = '''
src/vamp-hostsdk/PluginHostAdapter.cpp
src/vamp-hostsdk/PluginBufferingAdapter.cpp
@ -41,7 +41,7 @@ def build(bld):
src/vamp-hostsdk/PluginWrapper.cpp
src/vamp-hostsdk/RealTime.cpp
'''
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.includes = ['.']
obj.name = 'libvamphost'
obj.target = 'vamphost'
@ -50,12 +50,12 @@ def build(bld):
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
# Plugin Library
obj = bld.new_task_gen('cxx', 'shlib')
obj = bld(features = 'cxx cxxshlib')
obj.source = '''
src/vamp-sdk/PluginAdapter.cpp
src/vamp-sdk/RealTime.cpp
'''
obj.export_incdirs = ['.']
obj.export_includes = ['.']
obj.includes = ['.']
obj.name = 'libvampplugin'
obj.target = 'vampplugin'

View File

@ -1,10 +1,9 @@
#!/usr/bin/python
import os
import glob
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def configure(conf):
pass
@ -19,14 +18,13 @@ def build(bld):
subst_dict['%JACK_INPUT%'] = 'alsa_pcm:playback_'
subst_dict['%JACK_OUTPUT%'] = 'alsa_pcm:capture_'
templates = glob.glob(os.path.join(bld.get_curdir(), '*.template.in'))
templates = bld.path.ant_glob('*.template.in')
for t in templates:
b = os.path.basename(t)
obj = bld.new_task_gen('subst')
obj.source = [ b ]
obj.target = [ b.replace('.in', '') ]
obj = bld(features = 'subst')
obj.source = [ t ]
obj.target = [ os.path.basename(t.srcpath()).replace('.in', '') ]
obj.dict = subst_dict
obj.install_path = os.path.join(bld.env['DATADIR'], 'ardour3', 'templates')
def set_options(opt):
def options(opt):
pass

View File

@ -1,13 +1,13 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import Options
import os
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
def set_options(opt):
def options(opt):
autowaf.set_options(opt)
def configure(conf):
@ -15,7 +15,7 @@ def configure(conf):
conf.check_tool('compiler_cxx')
def build(bld):
obj = bld.new_task_gen(features = 'cxx cprogram')
obj = bld(features = 'cxx cxxprogram')
obj.includes = [ '.' ]
obj.source = [ 'main.cpp', 'systemtest.cpp' ]
obj.target = 'sanityCheck'

BIN
waf vendored

Binary file not shown.

95
wscript
View File

@ -1,20 +1,19 @@
#!/usr/bin/env python
import autowaf
from waflib.extras import autowaf as autowaf
import Options
import os
import re
import string
import subprocess
import sys
import glob
# Variables for 'waf dist'
VERSION = '3.0alpha10'
APPNAME = 'Ardour'
# Mandatory variables
srcdir = '.'
blddir = 'build'
top = '.'
out = 'build'
children = [
'libs/pbd',
@ -139,22 +138,22 @@ def set_compiler_flags (conf,opt):
if config[config_arch] == 'apple':
# The [.] matches to the dot after the major version, "." would match any character
if re.search ("darwin[0-7][.]", config[config_kernel]) != None:
conf.define ('build_target', 'panther')
conf.env['build_target'] = 'panther'
elif re.search ("darwin8[.]", config[config_kernel]) != None:
conf.define ('build_target', 'tiger')
conf.env['build_target'] = 'tiger'
else:
conf.define ('build_target', 'leopard')
conf.env['build_target'] = 'leopard'
else:
if re.search ("x86_64", config[config_cpu]) != None:
conf.define ('build_target', 'x86_64')
conf.env['build_target'] = 'x86_64'
elif re.search("i[0-5]86", config[config_cpu]) != None:
conf.define ('build_target', 'i386')
conf.env['build_target'] = 'i386'
elif re.search("powerpc", config[config_cpu]) != None:
conf.define ('build_target', 'powerpc')
conf.env['build_target'] = 'powerpc'
else:
conf.define ('build_target', 'i686')
conf.env['build_target'] = 'i686'
else:
conf.define ('build_target', opt.dist_target)
conf.env['build_target'] = opt.dist_target
if config[config_cpu] == 'powerpc' and conf.env['build_target'] != 'none':
#
@ -246,7 +245,7 @@ def set_compiler_flags (conf,opt):
print("\nIt is theoretically possible to build a 32 bit host on a 64 bit system.")
print("However, this is tricky and not recommended for beginners.")
sys.exit (-1)
if opt.lxvst:
if conf.env['build_target'] == 'x86_64':
print("\n\n********************************************************")
@ -264,7 +263,7 @@ def set_compiler_flags (conf,opt):
conf.define ('IS_OSX', 1)
# force tiger or later, to avoid issues on PPC which defaults
# back to 10.1 if we don't tell it otherwise.
conf.env.append_value('CCFLAGS', "-DMAC_OS_X_VERSION_MIN_REQUIRED=1040")
conf.env.append_value('CFLAGS', "-DMAC_OS_X_VERSION_MIN_REQUIRED=1040")
else:
conf.define ('IS_OSX', 0)
@ -294,11 +293,11 @@ def set_compiler_flags (conf,opt):
]
if opt.debug:
conf.env.append_value('CCFLAGS', debug_flags)
conf.env.append_value('CFLAGS', debug_flags)
conf.env.append_value('CXXFLAGS', debug_flags)
conf.env.append_value('LINKFLAGS', debug_flags)
else:
conf.env.append_value('CCFLAGS', optimization_flags)
conf.env.append_value('CFLAGS', optimization_flags)
conf.env.append_value('CXXFLAGS', optimization_flags)
conf.env.append_value('LINKFLAGS', optimization_flags)
@ -306,12 +305,12 @@ def set_compiler_flags (conf,opt):
conf.env.append_value('CXXFLAGS', "-D_GLIBCXX_DEBUG")
if conf.env['DEBUG_RT_ALLOC']:
conf.env.append_value('CCFLAGS', '-DDEBUG_RT_ALLOC')
conf.env.append_value('CFLAGS', '-DDEBUG_RT_ALLOC')
conf.env.append_value('CXXFLAGS', '-DDEBUG_RT_ALLOC')
conf.env.append_value('LINKFLAGS', '-ldl')
if opt.universal:
conf.env.append_value('CCFLAGS', "-arch i386 -arch ppc")
conf.env.append_value('CFLAGS', "-arch i386 -arch ppc")
conf.env.append_value('CXXFLAGS', "-arch i386 -arch ppc")
conf.env.append_value('LINKFLAGS', "-arch i386 -arch ppc")
@ -319,21 +318,21 @@ def set_compiler_flags (conf,opt):
# warnings flags
#
conf.env.append_value('CCFLAGS', "-Wall")
conf.env.append_value('CFLAGS', "-Wall")
conf.env.append_value('CXXFLAGS', [ '-Wall', '-Woverloaded-virtual'])
if opt.extra_warn:
flags = [ '-Wextra' ]
conf.env.append_value('CCFLAGS', flags )
conf.env.append_value('CXXFLAGS', flags )
conf.env.append_value('CFLAGS', flags)
conf.env.append_value('CXXFLAGS', flags)
#
# more boilerplate
#
conf.env.append_value('CCFLAGS', '-D_LARGEFILE64_SOURCE')
conf.env.append_value('CCFLAGS', '-D_FILE_OFFSET_BITS=64')
conf.env.append_value('CFLAGS', '-D_LARGEFILE64_SOURCE')
conf.env.append_value('CFLAGS', '-D_FILE_OFFSET_BITS=64')
conf.env.append_value('CXXFLAGS', '-D_LARGEFILE64_SOURCE')
conf.env.append_value('CXXFLAGS', '-D_FILE_OFFSET_BITS=64')
@ -342,13 +341,15 @@ def set_compiler_flags (conf,opt):
if opt.nls:
conf.env.append_value('CXXFLAGS', '-DENABLE_NLS')
conf.env.append_value('CCFLAGS', '-DENABLE_NLS')
conf.env.append_value('CFLAGS', '-DENABLE_NLS')
#----------------------------------------------------------------
# Waf stages
def set_options(opt):
def options(opt):
opt.load('compiler_c')
opt.load('compiler_cxx')
autowaf.set_options(opt)
opt.add_option('--program-name', type='string', action='store', default='Ardour', dest='program_name',
help='The user-visible name of the program being built')
@ -410,6 +411,8 @@ def sub_config_and_use(conf, name, has_objects = True):
autowaf.set_local_lib(conf, name, has_objects)
def configure(conf):
conf.load('compiler_c')
conf.load('compiler_cxx')
if not Options.options.noconfirm:
print ('\n\nThis is an alpha version of Ardour 3.0.\n\n' +
'You are respectfully requested NOT to ask for assistance with build issues\n' +
@ -446,20 +449,20 @@ def configure(conf):
# on Darwin to add all applicable flags at once
#
conf.env.append_value('CXXFLAGS_OSX', '-DMAC_OS_X_VERSION_MIN_REQUIRED=1040')
conf.env.append_value('CCFLAGS_OSX', '-DMAC_OS_X_VERSION_MIN_REQUIRED=1040')
conf.env.append_value('CFLAGS_OSX', '-DMAC_OS_X_VERSION_MIN_REQUIRED=1040')
conf.env.append_value('CXXFLAGS_OSX', '-mmacosx-version-min=10.4')
conf.env.append_value('CCFLAGS_OSX', '-mmacosx-version-min=10.4')
conf.env.append_value('CFLAGS_OSX', '-mmacosx-version-min=10.4')
#conf.env.append_value('CXXFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
#conf.env.append_value('CCFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
#conf.env.append_value('CFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
#conf.env.append_value('LINKFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
#conf.env.append_value('LINKFLAGS_OSX', "-sysroot /Developer/SDKs/MacOSX10.4u.sdk")
conf.env.append_value('CXXFLAGS_OSX', "-msse")
conf.env.append_value('CCFLAGS_OSX', "-msse")
conf.env.append_value('CFLAGS_OSX', "-msse")
conf.env.append_value('CXXFLAGS_OSX', "-msse2")
conf.env.append_value('CCFLAGS_OSX', "-msse2")
conf.env.append_value('CFLAGS_OSX', "-msse2")
#
# TODO: The previous sse flags NEED to be based
# off processor type. Need to add in a check
@ -486,14 +489,14 @@ def configure(conf):
if Options.options.boost_include != '':
conf.env.append_value('CPPPATH', Options.options.boost_include)
autowaf.check_header(conf, 'boost/signals2.hpp', mandatory = True)
autowaf.check_header(conf, 'cxx', 'boost/signals2.hpp', mandatory = True)
if Options.options.boost_sp_debug:
conf.env.append_value('CXXFLAGS', '-DBOOST_SP_ENABLE_DEBUG_HOOKS')
autowaf.check_header(conf, 'jack/session.h', define="JACK_SESSION", mandatory = False)
autowaf.check_header(conf, 'cxx', 'jack/session.h', define="JACK_SESSION", mandatory = False)
conf.check_cc(fragment = "#include <boost/version.hpp>\nint main(void) { return (BOOST_VERSION >= 103900 ? 0 : 1); }\n",
conf.check_cxx(fragment = "#include <boost/version.hpp>\nint main(void) { return (BOOST_VERSION >= 103900 ? 0 : 1); }\n",
execute = "1",
mandatory = True,
msg = 'Checking for boost library >= 1.39',
@ -512,43 +515,47 @@ def configure(conf):
sub_config_and_use(conf, i)
# Fix utterly braindead FLAC include path to not smash assert.h
conf.env['CPPPATH_FLAC'] = []
conf.env['INCLUDES_FLAC'] = []
conf.check_cc(function_name='dlopen', header_name='dlfcn.h', linkflags='-ldl', uselib_store='DL')
conf.check_cc(function_name='curl_global_init', header_name='curl/curl.h', linkflags='-lcurl', uselib_store='CURL')
# Tell everyone that this is a waf build
conf.env.append_value('CCFLAGS', '-DWAF_BUILD')
conf.env.append_value('CFLAGS', '-DWAF_BUILD')
conf.env.append_value('CXXFLAGS', '-DWAF_BUILD')
# Set up waf environment
# Set up waf environment and C defines
opts = Options.options
if opts.debug:
opts.phone_home = False; # debug builds should not call home
if opts.phone_home:
conf.env['PHONE_HOME'] = opts.phone_home
if opts.fpu_optimization:
conf.define('FPU_OPTIMIZATION', 1)
conf.env['FPU_OPTIMIZATION'] = True
if opts.freesound:
conf.define('FREESOUND',1)
conf.env['FREESOUND'] = True
if opts.nls:
conf.define ('ENABLE_NLS', 1)
conf.define('ENABLE_NLS', 1)
conf.env['ENABLE_NLS'] = True
if opts.build_tests:
conf.env['BUILD_TESTS'] = opts.build_tests
if opts.tranzport:
conf.define('TRANZPORT', 1)
conf.env['TRANZPORT'] = 1
if opts.vst:
conf.define('VST_SUPPORT', 1)
conf.env['VST_SUPPORT'] = True
conf.env.append_value('CPPPATH', Options.options.wine_include)
autowaf.check_header(conf, 'windows.h', mandatory = True)
autowaf.check_header(conf, 'cxx', 'windows.h', mandatory = True)
if opts.lxvst:
conf.define('LXVST_SUPPORT', 1)
conf.env['LXVST_SUPPORT'] = True
if bool(conf.env['JACK_SESSION']):
conf.define ('HAVE_JACK_SESSION', 1)
if opts.wiimote:
conf.define('WIIMOTE',1)
conf.define('WIIMOTE', 1)
conf.env['WIIMOTE'] = True
conf.define('WINDOWS_KEY', opts.windows_key)
conf.env['PROGRAM_NAME'] = opts.program_name
if opts.rt_alloc_debug:
@ -601,7 +608,7 @@ const char* const ardour_config_info = "\\n\\
write_config_text('Wiimote support', opts.wiimote)
write_config_text('Windows key', opts.windows_key)
write_config_text('C compiler flags', conf.env['CCFLAGS'])
write_config_text('C compiler flags', conf.env['CFLAGS'])
write_config_text('C++ compiler flags', conf.env['CXXFLAGS'])
config_text.write ('";\n}\n')
@ -644,11 +651,11 @@ def build(bld):
'JACK_INPUT' : 'auditioner'
}
obj = bld.new_task_gen('subst')
obj = bld(features = 'subst')
obj.source = 'ardour.rc.in'
obj.target = 'ardour_system.rc'
obj.dict = rc_subst_dict
obj.install_path = '${CONFIGDIR}/ardour3'
obj.install_path = '${SYSCONF}/ardour3'
def i18n(bld):
bld.recurse (i18n_children)