From 5fe34018143a49d084a8fcdabf7e66e4fac85026 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 25 Feb 2009 19:36:16 +0000 Subject: [PATCH] Waf building of taglib and vamp-sdk. git-svn-id: svn://localhost/ardour2/branches/3.0@4660 d708f5d6-7413-0410-9779-e7cbd77b26cf --- autowaf.py | 7 ++-- libs/taglib/wscript | 78 +++++++++++++++++++++++++++++++++++++++++++ libs/vamp-sdk/wscript | 53 +++++++++++++++++++++++++++++ wscript | 10 +++++- 4 files changed, 145 insertions(+), 3 deletions(-) create mode 100644 libs/taglib/wscript create mode 100644 libs/vamp-sdk/wscript diff --git a/autowaf.py b/autowaf.py index c821ee8cc2..df6b43beff 100644 --- a/autowaf.py +++ b/autowaf.py @@ -89,9 +89,12 @@ def check_tool(conf, name): conf.check_tool(name) checked[name] = True +def nameify(name): + return name.replace('/', '_').replace('++', 'PP').replace('-', '_') + def check_pkg(conf, name, **args): "Check for a package iff it hasn't been checked for yet" - var_name = 'HAVE_' + args['uselib_store'].replace('/', '_').replace('++', 'PP') + 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 @@ -198,7 +201,7 @@ def configure(conf): g_step = 2 def set_local_lib(conf, name, has_objects): - conf.define('HAVE_' + name.upper().replace('/', '_').replace('++', 'PP'), 1) + conf.define('HAVE_' + nameify(name.upper()), 1) if has_objects: if type(conf.env['AUTOWAF_LOCAL_LIBS']) != dict: conf.env['AUTOWAF_LOCAL_LIBS'] = {} diff --git a/libs/taglib/wscript b/libs/taglib/wscript new file mode 100644 index 0000000000..f463ff2ae4 --- /dev/null +++ b/libs/taglib/wscript @@ -0,0 +1,78 @@ +#!/usr/bin/env python +import autowaf +import glob + +# Version of this package (even if built as a child) +LIBTAGLIB_VERSION = '0.0.0' + +# Library version (UNIX style major, minor, micro) +# major increment <=> incompatible changes +# minor increment <=> compatible changes (additions) +# micro increment <=> no interface changes +LIBTAGLIB_LIB_VERSION = '0.0.0' + +# Variables for 'waf dist' +APPNAME = 'libtaglib' +VERSION = LIBTAGLIB_VERSION + +# Mandatory variables +srcdir = '.' +blddir = 'build' + +def set_options(opt): + autowaf.set_options(opt) + +def configure(conf): + autowaf.configure(conf) + autowaf.check_tool(conf, 'compiler_cxx') + conf.write_config_header('config.h') + +def build(bld): + # Library + obj = bld.new_task_gen('cxx', 'shlib') + prefix = 'libs/taglib/' + sources = glob.glob(prefix + 'taglib/*.cpp') + sources += glob.glob(prefix + 'libs//taglib/flac/*.cpp') + sources += glob.glob(prefix + 'taglib/mpc/*.cpp') + sources += glob.glob(prefix + 'taglib/mpeg/*.cpp') + sources += glob.glob(prefix + 'taglib/mpeg/id3v1/*.cpp') + sources += glob.glob(prefix + 'taglib/mpeg/id3v2/*.cpp') + sources += glob.glob(prefix + 'taglib/mpeg/id3v2/frames/*.cpp') + sources += glob.glob(prefix + 'taglib/ogg/*.cpp') + sources += glob.glob(prefix + 'taglib/ogg/vorbis/*.cpp') + sources += glob.glob(prefix + 'taglib/ogg/speex/*.cpp') + sources += glob.glob(prefix + 'taglib/ogg/flac/*.cpp') + sources += glob.glob(prefix + 'taglib/trueaudio/*.cpp') + sources += glob.glob(prefix + 'taglib/wavpack/*.cpp') + sources += glob.glob(prefix + 'taglib/ape/*.cpp') + sources += glob.glob(prefix + 'taglib/toolkit/*.cpp') + obj.source = [] + for i in sources: + obj.source += [ i.replace(prefix, '') ] + + include_dirs = ''' + taglib + taglib/toolkit + taglib/flac + taglib/ape + taglib/mpc + taglib/mpeg + taglib/mpeg/id3v1 + taglib/mpeg/id3v2 + taglib/wavpack + taglib/trueaudio + taglib/ogg + taglib/ogg/vorbis + taglib/ogg/speex + taglib/ogg/flac + '''.split() + obj.export_incdirs = include_dirs + obj.includes = include_dirs + obj.name = 'libtaglib' + obj.target = 'taglib' + obj.vnum = LIBTAGLIB_LIB_VERSION + obj.install_path = '' + +def shutdown(): + autowaf.shutdown() + diff --git a/libs/vamp-sdk/wscript b/libs/vamp-sdk/wscript new file mode 100644 index 0000000000..bbbae61308 --- /dev/null +++ b/libs/vamp-sdk/wscript @@ -0,0 +1,53 @@ +#!/usr/bin/env python +import autowaf + +# Version of this package (even if built as a child) +LIBVAMP_VERSION = '0.0.0' + +# Library version (UNIX style major, minor, micro) +# major increment <=> incompatible changes +# minor increment <=> compatible changes (additions) +# micro increment <=> no interface changes +LIBVAMP_LIB_VERSION = '0.0.0' + +# Variables for 'waf dist' +APPNAME = 'libvamp' +VERSION = LIBVAMP_VERSION + +# Mandatory variables +srcdir = '.' +blddir = 'build' + +def set_options(opt): + autowaf.set_options(opt) + +def configure(conf): + autowaf.configure(conf) + autowaf.check_tool(conf, 'compiler_cxx') + autowaf.check_pkg(conf, 'fftw3', uselib_store='FFTW3', mandatory=True) + autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F', mandatory=True) + conf.env.append_value('CXXFLAGS', '-DHAVE_FFTW3') + +def build(bld): + # Library + obj = bld.new_task_gen('cxx', 'shlib') + obj.source = ''' + vamp-sdk/PluginHostAdapter.cpp + vamp-sdk/hostext/PluginBufferingAdapter.cpp + vamp-sdk/hostext/PluginChannelAdapter.cpp + vamp-sdk/hostext/PluginInputDomainAdapter.cpp + vamp-sdk/hostext/PluginLoader.cpp + vamp-sdk/hostext/PluginWrapper.cpp + vamp-sdk/RealTime.cpp + ''' + obj.export_incdirs = ['.'] + obj.includes = ['.'] + obj.name = 'libvamp' + obj.target = 'vamp' + obj.uselib = 'FFTW3 FFTW3F' + obj.vnum = LIBVAMP_LIB_VERSION + obj.install_path = '' + +def shutdown(): + autowaf.shutdown() + diff --git a/wscript b/wscript index 9a3fd390f2..bbea7aacfc 100644 --- a/wscript +++ b/wscript @@ -9,7 +9,15 @@ APPNAME = 'ardour' srcdir = '.' blddir = 'build' -children = [ 'libs/pbd', 'libs/midi++2', 'libs/evoral' ] +children = [ + 'libs/pbd', + 'libs/midi++2', + 'libs/evoral', + 'libs/vamp-sdk', + 'libs/taglib', +# 'libs/surfaces', +# 'libs/ardour' +] def set_options(opt): autowaf.set_options(opt)