Waf building of libardour (yay!).
authorDavid Robillard <d@drobilla.net>
Wed, 25 Feb 2009 21:48:32 +0000 (21:48 +0000)
committerDavid Robillard <d@drobilla.net>
Wed, 25 Feb 2009 21:48:32 +0000 (21:48 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@4661 d708f5d6-7413-0410-9779-e7cbd77b26cf

12 files changed:
autowaf.py
libs/ardour/ardour/route.h
libs/ardour/audioengine.cc
libs/ardour/port.cc
libs/ardour/wscript [new file with mode: 0644]
libs/pbd/wscript
libs/surfaces/wscript [new file with mode: 0644]
libs/taglib/SConscript
libs/taglib/taglib/mpeg/id3v2/id3v2frame.cpp
libs/taglib/taglib/mpeg/id3v2/id3v2framefactory.cpp
libs/taglib/wscript
wscript

index df6b43beffbb0968308164a6de3d1fc54b2933fa..1015afdb9d753f6cdfce23b73d916a2b7de2ddec 100644 (file)
@@ -52,6 +52,8 @@ def set_options(opt):
                        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',
@@ -163,6 +165,10 @@ def configure(conf):
                        conf.env['DATADIR'] = Options.options.datadir
                else:
                        conf.env['DATADIR'] = conf.env['PREFIX'] + '/share/'
+               if Options.options.configdir:
+                       conf.env['CONFIGDIR'] = Options.options.configdir
+               else:
+                       conf.env['CONFIGDIR'] = conf.env['PREFIX'] + '/etc/'
                if Options.options.htmldir:
                        conf.env['HTMLDIR'] = Options.options.htmldir
                else:
@@ -188,6 +194,7 @@ def configure(conf):
        conf.env['BINDIRNAME'] = chop_prefix(conf, 'BINDIR')
        conf.env['LIBDIRNAME'] = chop_prefix(conf, 'LIBDIR')
        conf.env['DATADIRNAME'] = chop_prefix(conf, 'DATADIR')
+       conf.env['CONFIGDIRNAME'] = chop_prefix(conf, 'CONFIGDIR')
        conf.env['LV2DIRNAME'] = chop_prefix(conf, 'LV2DIR')
        
        if Options.options.debug:
index 9bf2eb8710876c51907ec8df6ea1a81fdf3985cc..a5bd751d2270f3d68b79f311f3f406ac7f1731ef 100644 (file)
@@ -153,7 +153,7 @@ class Route : public IO
        boost::shared_ptr<Processor> nth_processor (uint32_t n) {
                Glib::RWLock::ReaderLock lm (_processor_lock);
                ProcessorList::iterator i;
-               for (i = _processors.begin(); i != _processors.end() && n; ++i, --n);
+               for (i = _processors.begin(); i != _processors.end() && n; ++i, --n) {}
                if (i == _processors.end()) {
                        return boost::shared_ptr<Processor> ();
                } else {
index 4a0b73524e4b385c42c98a48608c2af552520028..3d2c4b7e9dec03da804efd64e1a1b89c5a5b93b5 100644 (file)
@@ -55,12 +55,6 @@ using namespace PBD;
 
 gint AudioEngine::m_meter_exit;
 
-static void 
-ardour_jack_error (const char* msg) 
-{
-       error << "JACK: " << msg << endmsg;
-}
-
 AudioEngine::AudioEngine (string client_name) 
        : ports (new Ports)
 {
@@ -887,7 +881,7 @@ AudioEngine::n_physical_outputs (DataType type) const
                return 0;
        }
 
-       for (i = 0; ports[i]; ++i);
+       for (i = 0; ports[i]; ++i) {}
        free (ports);
 
        return i;
@@ -908,7 +902,7 @@ AudioEngine::n_physical_inputs (DataType type) const
        }
 
        if (ports) {
-               for (i = 0; ports[i]; ++i);
+               for (i = 0; ports[i]; ++i) {}
                free (ports);
        }
        return i;
@@ -982,7 +976,7 @@ AudioEngine::get_nth_physical (DataType type, uint32_t n, int flag)
                return "";
        }
 
-       for (i = 0; i < n && ports[i]; ++i);
+       for (i = 0; i < n && ports[i]; ++i) {}
 
        if (ports[i]) {
                ret = ports[i];
@@ -1116,6 +1110,12 @@ AudioEngine::remove_connections_for (Port& port)
 
 #ifdef HAVE_JACK_CLIENT_OPEN
 
+static void 
+ardour_jack_error (const char* msg) 
+{
+       error << "JACK: " << msg << endmsg;
+}
+
 int
 AudioEngine::connect_to_jack (string client_name)
 {
index 676a6a0e4ff2e3ad0367e10edec25e786fd8220d..8078dfbe084c42b4b80895d7931595e63d2c1277 100644 (file)
 
 #include "ardour/port.h"
 #include "ardour/audioengine.h"
-#include "ardour/i18n.h"
 #include "pbd/failed_constructor.h"
 #include "pbd/error.h"
 #include "pbd/compose.h"
 #include <stdexcept>
 
+#include "i18n.h"
+
 using namespace std;
 using namespace ARDOUR;
 
diff --git a/libs/ardour/wscript b/libs/ardour/wscript
new file mode 100644 (file)
index 0000000..39e9b58
--- /dev/null
@@ -0,0 +1,216 @@
+#!/usr/bin/env python
+import autowaf
+import os
+
+# Version of this package (even if built as a child)
+LIBARDOUR_VERSION = '3.0.0'
+
+# Library version (UNIX style major, minor, micro)
+# major increment <=> incompatible changes
+# minor increment <=> compatible changes (additions)
+# micro increment <=> no interface changes
+LIBARDOUR_LIB_VERSION = '3.0.0'
+
+# Variables for 'waf dist'
+APPNAME = 'libardour'
+VERSION = LIBARDOUR_VERSION
+
+# Mandatory variables
+srcdir = '.'
+blddir = 'build'
+
+def set_options(opt):
+       autowaf.set_options(opt)
+
+def check_header_and_define(conf, header, define):
+       conf.check(header_name=header, define_name=define)
+       if conf.env[define]:
+               conf.env.append_value('CCFLAGS', '-D' + define)
+               conf.env.append_value('CXXFLAGS', '-D' + 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)
+       
+       check_header_and_define(conf, 'wordexp.h', 'HAVE_WORDEXP')
+       check_header_and_define(conf, 'sys/vfs.h', 'HAVE_SYS_VFS_H')
+
+       conf.env.append_value('CCFLAGS', '-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE')
+       conf.env.append_value('CXXFLAGS', '-DENABLE_NLS')
+       
+       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)
+
+def build(bld):
+       # Library
+       obj = bld.new_task_gen('cxx', 'shlib')
+       obj.source = '''
+               amp.cc
+               analyser.cc
+               audio_buffer.cc
+               audio_diskstream.cc
+               audio_library.cc
+               audio_playlist.cc
+               audio_playlist_importer.cc
+               audio_port.cc
+               audio_region_importer.cc
+               audio_track.cc
+               audio_track_importer.cc
+               audioanalyser.cc
+               audioengine.cc
+               audiofile_tagger.cc
+               audiofilesource.cc
+               audioregion.cc
+               audiosource.cc
+               auditioner.cc
+               automatable.cc
+               automation.cc
+               automation_control.cc
+               automation_list.cc
+               beats_frames_converter.cc
+               broadcast_info.cc
+               buffer.cc
+               buffer_set.cc
+               bundle.cc
+               chan_count.cc
+               configuration.cc
+               control_protocol_manager.cc
+               control_protocol_search_path.cc
+               crossfade.cc
+               cycle_timer.cc
+               default_click.cc
+               directory_names.cc
+               diskstream.cc
+               element_import_handler.cc
+               element_importer.cc
+               enums.cc
+               event_type_map.cc
+               export_channel.cc
+               export_channel_configuration.cc
+               export_file_io.cc
+               export_filename.cc
+               export_format_base.cc
+               export_format_manager.cc
+               export_format_specification.cc
+               export_formats.cc
+               export_handler.cc
+               export_preset.cc
+               export_processor.cc
+               export_profile_manager.cc
+               export_status.cc
+               export_timespan.cc
+               export_utilities.cc
+               filename_extensions.cc
+               file_source.cc
+               filesystem_paths.cc
+               filter.cc
+               find_session.cc
+               gain.cc
+               gdither.cc
+               globals.cc
+               import.cc
+               io.cc
+               io_processor.cc
+               jack_slave.cc
+               ladspa_plugin.cc
+               location.cc
+               location_importer.cc
+               meter.cc
+               midi_buffer.cc
+               midi_clock_slave.cc
+               midi_diskstream.cc
+               midi_model.cc
+               midi_patch_manager.cc
+               midi_playlist.cc
+               midi_port.cc
+               midi_region.cc
+               midi_ring_buffer.cc
+               midi_source.cc
+               midi_state_tracker.cc
+               midi_stretch.cc
+               midi_track.cc
+               mix.cc
+               mtc_slave.cc
+               named_selection.cc
+               onset_detector.cc
+               panner.cc
+               pcm_utils.cc
+               playlist.cc
+               playlist_factory.cc
+               plugin.cc
+               plugin_insert.cc
+               plugin_manager.cc
+               port.cc
+               port_insert.cc
+               port_set.cc
+               processor.cc
+               quantize.cc
+               recent_sessions.cc
+               region.cc
+               region_factory.cc
+               resampled_source.cc
+               reverse.cc
+               route.cc
+               route_group.cc
+               send.cc
+               session.cc
+               session_butler.cc
+               session_click.cc
+               session_command.cc
+               session_directory.cc
+               session_events.cc
+               session_export.cc
+               session_metadata.cc
+               session_midi.cc
+               session_process.cc
+               session_state.cc
+               session_state_utils.cc
+               session_time.cc
+               session_transport.cc
+               session_utils.cc
+               smf_source.cc
+               sndfile_helpers.cc
+               sndfileimportable.cc
+               sndfilesource.cc
+               source.cc
+               source_factory.cc
+               svn_revision.cc
+               tape_file_matcher.cc
+               template_utils.cc
+               tempo.cc
+               tempo_map_importer.cc
+               ticker.cc
+               track.cc
+               transient_detector.cc
+               user_bundle.cc
+               utils.cc
+               version.cc
+       '''
+       obj.export_incdirs = ['.']
+       obj.includes     = ['.', '../surfaces/control_protocol']
+       obj.name         = 'libardour'
+       obj.target       = 'ardour'
+       obj.uselib       = 'GLIBMM SIGCPP XML UUID'
+       obj.uselib_local = 'libpbd libmidipp libevoral libvamp libtaglib'
+       obj.vnum         = LIBARDOUR_LIB_VERSION
+       obj.install_path = ''
+       obj.cxxflags     = ' -DPACKAGE=\\\"libardour3\\\"'
+       obj.cxxflags     += ' -DDATA_DIR=\\\"' + os.path.normpath(bld.env['DATADIRNAME']) + '\\\"'
+       obj.cxxflags     += ' -DCONFIG_DIR=\\\"' + os.path.normpath(bld.env['CONFIGDIRNAME']) + '\\\"'
+       obj.cxxflags     += ' -DMODULE_DIR=\\\"' + os.path.normpath(bld.env['LIBDIRNAME']) + '\\\"'
+       obj.cxxflags     += ' -DLOCALEDIR=\\\"' + os.path.join(
+                       os.path.normpath(bld.env['DATADIRNAME']), 'locale') + '\\\"'
+       obj.cxxflags     += ' -DVAMP_DIR=\\\"' + os.path.join(
+                       os.path.normpath(bld.env['LIBDIRNAME']), 'ardour3', 'vamp') + '\\\"'
+       
+def shutdown():
+       autowaf.shutdown()
+
index 9b5dc4cbb2d5cdba27a036e9999d653b20b11ab3..12a3791b648e84ef4b089912a2c2c59528d3a0bb 100644 (file)
@@ -31,7 +31,9 @@ def configure(conf):
        autowaf.check_pkg(conf, 'uuid', uselib_store='UUID', mandatory=True)
 
        conf.check(function_name='getmntent', header_name='mntent.h', define_name='HAVE_GETMNTENT')
-       conf.check(header_name='execinfo.h', define_name='HAVE_EXECINFO')
+
+       # This must be defined for libpbd only, it breaks ardour
+       conf.check(header_name='execinfo.h', define_name='PBD_HAVE_EXECINFO')
 
        conf.env.append_value('CXXFLAGS', '-DHAVE_WAFCONFIG_H')
        conf.write_config_header('wafconfig.h')
@@ -77,6 +79,9 @@ def build(bld):
                xml++.cc
        '''
        obj.export_incdirs = ['.']
+       obj.cxxflags     = '-DPACKAGE=\\\"libpbd\\\"'
+       if bld.env['PBD_HAVE_EXECINFO']:
+               obj.cxxflags += ' -DHAVE_EXECINFO '
        obj.includes     = ['.']
        obj.name         = 'libpbd'
        obj.target       = 'pbd'
diff --git a/libs/surfaces/wscript b/libs/surfaces/wscript
new file mode 100644 (file)
index 0000000..520dd7f
--- /dev/null
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+import autowaf
+
+# Version of this package (even if built as a child)
+LIBSURFACES_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
+LIBSURFACES_LIB_VERSION = '4.1.0'
+
+# Variables for 'waf dist'
+APPNAME = 'libsurfaces'
+VERSION = LIBSURFACES_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, '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)
+
+       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)
+
+def build(bld):
+       # Library
+       obj = bld.new_task_gen('cxx', 'shlib')
+       obj.source = '''
+               control_protocol/basic_ui.cc
+               control_protocol/control_protocol.cc
+               control_protocol/smpte.cc
+       '''
+       obj.export_incdirs = ['./control_protocol']
+       obj.cxxflags     = '-DPACKAGE=\\\"ardour_cp\\\"'
+       obj.includes     = ['.', './control_protocol']
+       obj.name         = 'libsurfaces'
+       obj.target       = 'surfaces'
+       obj.uselib_local = 'libardour'
+       obj.vnum         = LIBSURFACES_LIB_VERSION
+       obj.install_path = ''
+       
+def shutdown():
+       autowaf.shutdown()
+
index d9062889b6afd7b02b7ad6d314b54dfebab04203..26c90aaba90afbd9d707263138ce825ec52c2ed8 100644 (file)
@@ -28,6 +28,7 @@ taglib_files += glob.glob ('taglib/toolkit/*.cpp')
 domain = 'taglib'
 
 taglib.Append(CCFLAGS = "-DPACKAGE=\\\"" + domain + "\\\"")
+taglib.Append(CCFLAGS = "-DHAVE_CONFIG_H=1")
 # mingw may need this
 #taglib.Append(CCFLAGS="-no-undefined")
 taglib.Append(PACKAGE = domain)
index 7c76ac7b94dcb16aa4c33d2990cd865e6ba682b3..52f0849af3497b6bdb18749dcb5b8f35410adb42 100644 (file)
  ***************************************************************************/
 
 #ifndef HAVE_ZLIB
+#ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+#endif
 
 #if HAVE_ZLIB
 #include <zlib.h>
index 48a202216c189e9454a23648c30013102cc19677..0c6f7706f563518d11505541c98b734ca3f4630c 100644 (file)
  ***************************************************************************/
 
 #ifndef HAVE_ZLIB
+#ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+#endif
 
 #include <tdebug.h>
 
index f463ff2ae4b27196b9a11cf9cafe476bd42c1e66..2aad178596762f01c5397a61739b86664ef16206 100644 (file)
@@ -25,7 +25,6 @@ def 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
@@ -66,7 +65,7 @@ def build(bld):
                taglib/ogg/speex
                taglib/ogg/flac
        '''.split()
-       obj.export_incdirs = include_dirs
+       obj.export_incdirs = ['.', 'taglib', 'taglib/toolkit']
        obj.includes     = include_dirs
        obj.name         = 'libtaglib'
        obj.target       = 'taglib'
diff --git a/wscript b/wscript
index bbea7aacfc154b87c54787a04228e18f2319df0e..321e70f1cabc4eb6b75f869f3d9524f32fcf4bb1 100644 (file)
--- a/wscript
+++ b/wscript
@@ -15,8 +15,8 @@ children = [
        'libs/evoral',
        'libs/vamp-sdk',
        'libs/taglib',
-#      'libs/surfaces',
-#      'libs/ardour'
+       'libs/surfaces',
+       'libs/ardour'
 ]
 
 def set_options(opt):
@@ -31,6 +31,7 @@ def sub_config_and_use(conf, name, has_objects = True):
 def configure(conf):
        autowaf.set_recursive()
        autowaf.configure(conf)
+       #conf.env.append_value('CXXFLAGS', '-DBOOST_NO_STD_LOCALE=1')
        for i in children:
                sub_config_and_use(conf, i)