From 0c0e689d3c4d61b670198db481839e912407293f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 25 Feb 2009 23:21:49 +0000 Subject: [PATCH] Waf building of gtk2_ardour. git-svn-id: svn://localhost/ardour2/branches/3.0@4662 d708f5d6-7413-0410-9779-e7cbd77b26cf --- autowaf.py | 4 +++- gtk2_ardour/logmeter.h | 4 ++-- gtk2_ardour/sfdb_ui.cc | 5 +++-- libs/ardour/wscript | 20 +++++++++++++------- libs/evoral/wscript | 10 +++++----- libs/midi++2/wscript | 16 ++++++++-------- libs/pbd/wscript | 14 +++++++------- libs/surfaces/wscript | 14 +++++++------- libs/taglib/wscript | 2 +- wscript | 4 +++- 10 files changed, 52 insertions(+), 41 deletions(-) diff --git a/autowaf.py b/autowaf.py index 1015afdb9d..b61a39f4bf 100644 --- a/autowaf.py +++ b/autowaf.py @@ -95,6 +95,8 @@ def nameify(name): return name.replace('/', '_').replace('++', 'PP').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 @@ -130,7 +132,7 @@ def configure(conf): def append_cxx_flags(val): conf.env.append_value('CCFLAGS', val) conf.env.append_value('CXXFLAGS', val) - conf.line_just = 42 + conf.line_just = 43 check_tool(conf, 'misc') check_tool(conf, 'compiler_cc') check_tool(conf, 'compiler_cxx') diff --git a/gtk2_ardour/logmeter.h b/gtk2_ardour/logmeter.h index c9addec8f5..0bbce787b2 100644 --- a/gtk2_ardour/logmeter.h +++ b/gtk2_ardour/logmeter.h @@ -21,13 +21,13 @@ #define __ardour_gtk_log_meter_h__ #if 1 -inline float +static inline float _log_meter (float power, double lower_db, double upper_db, double non_linearity) { return (power < lower_db ? 0.0 : pow((power-lower_db)/(upper_db-lower_db), non_linearity)); } -inline float +static inline float alt_log_meter (float power) { return _log_meter (power, -192.0, 0.0, 8.0); diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index dcd041c44b..91620becdb 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -37,7 +37,7 @@ #include -#include "evoral/SMFReader.hpp" +#include "evoral/SMF.hpp" #include "ardour/audio_library.h" #include "ardour/auditioner.h" @@ -1100,7 +1100,8 @@ SoundFileOmega::check_info (const vector& paths, bool& same_size, bool& } else if (SMFSource::safe_midi_file_extension (*i)) { - Evoral::SMFReader reader(*i); + Evoral::SMF reader; + reader.open(*i); if (reader.num_tracks() > 1) { multichannel = true; // "channel" == track here... } diff --git a/libs/ardour/wscript b/libs/ardour/wscript index 39e9b5836c..99f72146bd 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -31,10 +31,14 @@ def check_header_and_define(conf, header, define): def configure(conf): autowaf.configure(conf) autowaf.check_tool(conf, 'compiler_cxx') - autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2', mandatory=True) - autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0', mandatory=True) - autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0', mandatory=True) - autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML', mandatory=True) + autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2') + autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0') + autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.109.0') + autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML') + autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0') + autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18') + autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18') + autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH') check_header_and_define(conf, 'wordexp.h', 'HAVE_WORDEXP') check_header_and_define(conf, 'sys/vfs.h', 'HAVE_SYS_VFS_H') @@ -46,8 +50,8 @@ def configure(conf): conf.write_config_header('wafconfig.h') # Boost headers - autowaf.check_header(conf, 'boost/shared_ptr.hpp', mandatory=True) - autowaf.check_header(conf, 'boost/weak_ptr.hpp', mandatory=True) + autowaf.check_header(conf, 'boost/shared_ptr.hpp') + autowaf.check_header(conf, 'boost/weak_ptr.hpp') def build(bld): # Library @@ -198,7 +202,7 @@ def build(bld): obj.includes = ['.', '../surfaces/control_protocol'] obj.name = 'libardour' obj.target = 'ardour' - obj.uselib = 'GLIBMM SIGCPP XML UUID' + obj.uselib = 'GLIBMM SIGCPP XML UUID JACK SNDFILE' obj.uselib_local = 'libpbd libmidipp libevoral libvamp libtaglib' obj.vnum = LIBARDOUR_LIB_VERSION obj.install_path = '' @@ -210,6 +214,8 @@ def build(bld): os.path.normpath(bld.env['DATADIRNAME']), 'locale') + '\\\"' obj.cxxflags += ' -DVAMP_DIR=\\\"' + os.path.join( os.path.normpath(bld.env['LIBDIRNAME']), 'ardour3', 'vamp') + '\\\"' + obj.source += ' st_stretch.cc st_pitch.cc ' + obj.uselib += ' SOUNDTOUCH ' def shutdown(): autowaf.shutdown() diff --git a/libs/evoral/wscript b/libs/evoral/wscript index 91577b95c0..a06a3d4c0f 100644 --- a/libs/evoral/wscript +++ b/libs/evoral/wscript @@ -26,14 +26,14 @@ def set_options(opt): def configure(conf): autowaf.configure(conf) autowaf.check_tool(conf, 'compiler_cxx') - autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2', mandatory=True) - autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0', mandatory=True) - autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.14.0', mandatory=True) + autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2') + autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0') + autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.14.0') autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False) # Boost headers - autowaf.check_header(conf, 'boost/shared_ptr.hpp', mandatory=True) - autowaf.check_header(conf, 'boost/weak_ptr.hpp', mandatory=True) + autowaf.check_header(conf, 'boost/shared_ptr.hpp') + autowaf.check_header(conf, 'boost/weak_ptr.hpp') def build(bld): # Headers diff --git a/libs/midi++2/wscript b/libs/midi++2/wscript index 3b5401b327..789daa43bc 100644 --- a/libs/midi++2/wscript +++ b/libs/midi++2/wscript @@ -24,22 +24,22 @@ def set_options(opt): def configure(conf): autowaf.configure(conf) autowaf.check_tool(conf, 'compiler_cxx') - autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2', mandatory=True) - autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0', mandatory=True) - autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0', mandatory=True) - autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML', mandatory=True) - autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.109.0', mandatory=True) + autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2') + autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0') + autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0') + autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML') + autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.109.0') conf.env.append_value('CXXFLAGS', '-DHAVE_WAFCONFIG_H') conf.write_config_header('wafconfig.h') # TODO - conf.env['SYSMIDI'] == 'JACK MIDI' + conf.env['SYSMIDI'] = 'JACK MIDI' conf.env.append_value('CXXFLAGS', '-DWITH_JACK_MIDI') # Boost headers - autowaf.check_header(conf, 'boost/shared_ptr.hpp', mandatory=True) - autowaf.check_header(conf, 'boost/weak_ptr.hpp', mandatory=True) + autowaf.check_header(conf, 'boost/shared_ptr.hpp') + autowaf.check_header(conf, 'boost/weak_ptr.hpp') def build(bld): # Library diff --git a/libs/pbd/wscript b/libs/pbd/wscript index 12a3791b64..278869ba6c 100644 --- a/libs/pbd/wscript +++ b/libs/pbd/wscript @@ -24,11 +24,11 @@ def set_options(opt): def configure(conf): autowaf.configure(conf) autowaf.check_tool(conf, 'compiler_cxx') - autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2', mandatory=True) - autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0', mandatory=True) - autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0', mandatory=True) - autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML', mandatory=True) - autowaf.check_pkg(conf, 'uuid', uselib_store='UUID', mandatory=True) + autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2') + autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0') + autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0') + autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML') + autowaf.check_pkg(conf, 'uuid', uselib_store='UUID') conf.check(function_name='getmntent', header_name='mntent.h', define_name='HAVE_GETMNTENT') @@ -39,8 +39,8 @@ def configure(conf): conf.write_config_header('wafconfig.h') # Boost headers - autowaf.check_header(conf, 'boost/shared_ptr.hpp', mandatory=True) - autowaf.check_header(conf, 'boost/weak_ptr.hpp', mandatory=True) + autowaf.check_header(conf, 'boost/shared_ptr.hpp') + autowaf.check_header(conf, 'boost/weak_ptr.hpp') def build(bld): # Library diff --git a/libs/surfaces/wscript b/libs/surfaces/wscript index 520dd7ff47..b0576ee715 100644 --- a/libs/surfaces/wscript +++ b/libs/surfaces/wscript @@ -24,18 +24,18 @@ def set_options(opt): def configure(conf): autowaf.configure(conf) autowaf.check_tool(conf, 'compiler_cxx') - autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2', mandatory=True) - autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0', mandatory=True) - autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0', mandatory=True) - autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML', mandatory=True) - autowaf.check_pkg(conf, 'uuid', uselib_store='UUID', mandatory=True) + autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2') + autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0') + autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0') + autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML') + autowaf.check_pkg(conf, 'uuid', uselib_store='UUID') conf.env.append_value('CXXFLAGS', '-DHAVE_WAFCONFIG_H') conf.write_config_header('wafconfig.h') # Boost headers - autowaf.check_header(conf, 'boost/shared_ptr.hpp', mandatory=True) - autowaf.check_header(conf, 'boost/weak_ptr.hpp', mandatory=True) + autowaf.check_header(conf, 'boost/shared_ptr.hpp') + autowaf.check_header(conf, 'boost/weak_ptr.hpp') def build(bld): # Library diff --git a/libs/taglib/wscript b/libs/taglib/wscript index 2aad178596..12a707ab32 100644 --- a/libs/taglib/wscript +++ b/libs/taglib/wscript @@ -31,7 +31,7 @@ def build(bld): 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/flac/*.cpp') sources += glob.glob(prefix + 'taglib/mpc/*.cpp') sources += glob.glob(prefix + 'taglib/mpeg/*.cpp') sources += glob.glob(prefix + 'taglib/mpeg/id3v1/*.cpp') diff --git a/wscript b/wscript index 321e70f1ca..ea00dae3e8 100644 --- a/wscript +++ b/wscript @@ -16,7 +16,9 @@ children = [ 'libs/vamp-sdk', 'libs/taglib', 'libs/surfaces', - 'libs/ardour' + 'libs/ardour', + 'libs/gtkmm2ext', + 'gtk2_ardour' ] def set_options(opt):