From 3ea7529c14c73f015807643c2d979fda4a3335d0 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 26 Nov 2013 21:54:48 -0500 Subject: fix broken situation with respect to taglib on windows where we used to use symlinks to fix up taglib's insane header/directory structure Symlinks don't work correctly with git on windows, so instead we now copy the required "public" headers into the build tree as part of the build. Works on Linux. --- libs/taglib/wscript | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/taglib/wscript b/libs/taglib/wscript index 8c1f1fdd1e..219cbd3f08 100644 --- a/libs/taglib/wscript +++ b/libs/taglib/wscript @@ -34,6 +34,79 @@ def build(bld): if bld.is_defined('USE_EXTERNAL_LIBS'): return + # the story: taglib distributes its headers all over the place then copies them + # into place during an install. but we're not planning to do an install. so this + # doesn't work when code does #include . + # + # one approach is to store symlinks in the repository. but this breaks on windows + # where symlink support and git are not very well developed (if at all) + # + # the approach here is to copy the header files as part of the build step, if necessary + + headers = [ + './ape/apefooter.h', + './ape/apeitem.h', + './ape/apetag.h', + './mpeg/id3v2/frames/attachedpictureframe.h', + './mpeg/id3v2/frames/commentsframe.h', + './flac/flacfile.h', + './flac/flacproperties.h', + './mpeg/id3v2/frames/generalencapsulatedobjectframe.h', + './mpeg/id3v1/id3v1genres.h', + './mpeg/id3v1/id3v1tag.h', + './mpeg/id3v2/id3v2extendedheader.h', + './mpeg/id3v2/id3v2footer.h', + './mpeg/id3v2/id3v2framefactory.h', + './mpeg/id3v2/id3v2frame.h', + './mpeg/id3v2/id3v2header.h', + './mpeg/id3v2/id3v2synchdata.h', + './mpeg/id3v2/id3v2tag.h', + './mpc/mpcfile.h', + './mpc/mpcproperties.h', + './mpeg/mpegfile.h', + './mpeg/mpegheader.h', + './mpeg/mpegproperties.h', + './ogg/oggfile.h', + './ogg/flac/oggflacfile.h', + './ogg/oggpage.h', + './ogg/oggpageheader.h', + './mpeg/id3v2/frames/relativevolumeframe.h', + './ogg/speex/speexfile.h', + './ogg/speex/speexproperties.h', + './toolkit/taglib.h', + './toolkit/tbytevector.h', + './toolkit/tbytevectorlist.h', + './toolkit/tdebug.h', + './mpeg/id3v2/frames/textidentificationframe.h', + './toolkit/tfile.h', + './toolkit/tlist.h', + 'toolkit/tlist.tcc', + './toolkit/tmap.h', + 'toolkit/tmap.tcc', + './trueaudio/trueaudiofile.h', + './trueaudio/trueaudioproperties.h', + './toolkit/tstring.h', + './toolkit/tstringlist.h', + './toolkit/unicode.h', + './mpeg/id3v2/frames/uniquefileidentifierframe.h', + './mpeg/id3v2/frames/unknownframe.h', + './mpeg/id3v2/frames/unsynchronizedlyricsframe.h', + './mpeg/id3v2/frames/urllinkframe.h', + './ogg/vorbis/vorbisfile.h', + './ogg/vorbis/vorbisproperties.h', + './wavpack/wavpackfile.h', + './wavpack/wavpackproperties.h', + './mpeg/xingheader.h', + './ogg/xiphcomment.h', + ] + + for h in headers: + tgt = bld.path.get_bld().make_node (os.path.join ('taglib', os.path.basename (h))) + if not os.path.exists (tgt.bldpath()): + bld (rule = "cp ${SRC} ${TGT}", + source = bld.path.make_node (os.path.join ('taglib', h)), + target = tgt) + # Library obj = bld(features = 'cxx cxxshlib') sources = bld.path.ant_glob('taglib/*.cpp') @@ -69,7 +142,7 @@ def build(bld): taglib/ogg/speex taglib/ogg/flac '''.split() - obj.export_includes = ['.', 'taglib', 'taglib/toolkit'] + obj.export_includes = ['.', 'taglib' ] obj.includes = include_dirs obj.defines = ['MAKE_TAGLIB_LIB'] obj.name = 'libtaglib' -- cgit v1.2.3 From 796f39b9670f28b4db4b695e8e3f33ca521d0103 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Mon, 2 Dec 2013 21:10:08 +1000 Subject: Fix compilation on linux now that libardour no longer links to libjack Similar change has already been made in master branch --- libs/ardour/io.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index ebd295411e..2cc213f797 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -1414,7 +1414,7 @@ IO::find_port_hole (const char* base) std::vector buf (AudioEngine::instance()->port_name_size()); PortSet::iterator i = _ports.begin(); - snprintf (&buf[0], jack_port_name_size(), _("%s %u"), base, n); + snprintf (&buf[0], buf.size()+1, _("%s %u"), base, n); for ( ; i != _ports.end(); ++i) { if (string(i->name()) == string(&buf[0])) { -- cgit v1.2.3 From e80d18b0b3ecf9890d83a273a5a77de112022790 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Mon, 21 Oct 2013 20:41:24 +1000 Subject: Revert unfinished export visibility commits by John Emmas These break the mingw build and the visibility work will make this code redundant --- libs/ardour/ardour/session_event.h | 4 ++-- libs/ardour/ardour/visibility.h | 30 ------------------------------ 2 files changed, 2 insertions(+), 32 deletions(-) (limited to 'libs') diff --git a/libs/ardour/ardour/session_event.h b/libs/ardour/ardour/session_event.h index e90ab71e26..8629f83c85 100644 --- a/libs/ardour/ardour/session_event.h +++ b/libs/ardour/ardour/session_event.h @@ -36,7 +36,7 @@ namespace ARDOUR { class Slave; class Region; -class LIBARDOUR_API SessionEvent { +class SessionEvent { public: enum Type { SetTransportSpeed, @@ -151,7 +151,7 @@ private: friend class Butler; }; -class LIBARDOUR_API SessionEventManager { +class SessionEventManager { public: SessionEventManager () : pending_events (2048), auto_loop_event(0), punch_out_event(0), punch_in_event(0) {} diff --git a/libs/ardour/ardour/visibility.h b/libs/ardour/ardour/visibility.h index b702e94edb..09287b877d 100644 --- a/libs/ardour/ardour/visibility.h +++ b/libs/ardour/ardour/visibility.h @@ -20,36 +20,6 @@ #ifndef __libardour_visibility_h__ #define __libardour_visibility_h__ -#ifdef LIBARDOUR_IS_IN_WIN_STATIC_LIB // #define if your project uses libardour (under Windows) as a static library -#define LIBARDOUR_IS_IN_WINDLL 0 -#endif - -#if !defined(LIBARDOUR_IS_IN_WINDLL) - #if defined(COMPILER_MSVC) || defined(COMPILER_MINGW) - // If you need '__declspec' compatibility, add extra compilers to the above as necessary - #define LIBARDOUR_IS_IN_WINDLL 1 - #else - #define LIBARDOUR_IS_IN_WINDLL 0 - #endif -#endif - -#if LIBARDOUR_IS_IN_WINDLL && !defined(LIBARDOUR_API) - #if defined(BUILDING_LIBARDOUR) - #define LIBARDOUR_API __declspec(dllexport) - #define LIBARDOUR_APICALLTYPE __cdecl - #elif defined(COMPILER_MSVC) || defined(COMPILER_MINGW) // Probably needs Cygwin too, at some point - #define LIBARDOUR_API __declspec(dllimport) - #define LIBARDOUR_APICALLTYPE __cdecl - #else - #error "Attempting to define __declspec with an incompatible compiler !" - #endif -#elif !defined(LIBARDOUR_API) - // Other compilers / platforms could be accommodated here (as an example, see LIBARDOUR_HELPER_DLL, below) - #define LIBARDOUR_API - #define LIBARDOUR_APICALLTYPE -#endif - - /* _WIN32 is defined by most compilers targetting Windows, but within the * ardour source tree, we also define COMPILER_MSVC or COMPILER_MINGW depending * on how a Windows build is built. -- cgit v1.2.3 From 30da95b60930d2ce45cf2a3b9b2d3bc612002471 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Wed, 14 Aug 2013 18:03:34 +1000 Subject: Remove duplicate ALSA pkgconfig --- libs/ardour/wscript | 3 --- 1 file changed, 3 deletions(-) (limited to 'libs') diff --git a/libs/ardour/wscript b/libs/ardour/wscript index e7dcf45635..b509db361f 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -259,9 +259,6 @@ def configure(conf): autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0') - if re.search ("linux", sys.platform) != None: - autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA') - if Options.options.lv2: autowaf.check_pkg(conf, 'lv2', uselib_store='LV2', atleast_version='1.0.0', mandatory=True) -- cgit v1.2.3 From 9b5440ec03edaaf7a795d819c211f40134a67dd4 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Fri, 27 Sep 2013 22:51:57 +1000 Subject: Use PBD::pthread_name in MTC_Slave for portability --- libs/ardour/mtc_slave.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'libs') diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc index 0dee2a071b..1a1c5f2bec 100644 --- a/libs/ardour/mtc_slave.cc +++ b/libs/ardour/mtc_slave.cc @@ -309,11 +309,7 @@ MTC_Slave::update_mtc_time (const MIDI::byte *msg, bool was_full, framepos_t now to use a timestamp indicating when this MTC time was received. example: when we received a locate command via MMC. */ -#ifdef COMPILER_MSVC - DEBUG_TRACE (DEBUG::MTC, string_compose ("MTC::update_mtc_time - TID:%1\n", ::pthread_self().p)); -#else - DEBUG_TRACE (DEBUG::MTC, string_compose ("MTC::update_mtc_time - TID:%1\n", ::pthread_self())); -#endif + DEBUG_TRACE (DEBUG::MTC, string_compose ("MTC::update_mtc_time - TID:%1\n", pthread_name())); TimecodeFormat tc_format; bool reset_tc = true; -- cgit v1.2.3 From 18a59dd7fa65eddeef5eab4d76df2f458aa9f7ad Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Fri, 27 Sep 2013 22:52:32 +1000 Subject: Include pbd/localtime_r.h in session_jack.cc for MinGW --- libs/backends/jack/jack_session.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libs') diff --git a/libs/backends/jack/jack_session.cc b/libs/backends/jack/jack_session.cc index 7cd7f6c62b..60d11a8f0c 100644 --- a/libs/backends/jack/jack_session.cc +++ b/libs/backends/jack/jack_session.cc @@ -25,6 +25,8 @@ #include #include +#include "pbd/localtime_r.h" + #include "ardour/audioengine.h" #include "ardour/filename_extensions.h" #include "ardour/session.h" -- cgit v1.2.3 From c3d2b1ea18d71f98a75ad19d09a8b982b879305e Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Fri, 27 Sep 2013 22:53:30 +1000 Subject: Use PBD::canonical_path instead of ::realpath This is a previous change that seems to have been lost in master -> windows merge --- libs/ardour/session_state.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'libs') diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index bbd3432205..5c3ffae3cc 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -136,14 +136,7 @@ Session::pre_engine_init (string fullpath) /* discover canonical fullpath */ - char buf[PATH_MAX+1]; - if (!realpath (fullpath.c_str(), buf) && (errno != ENOENT)) { - error << string_compose(_("Could not use path %1 (%2)"), buf, strerror(errno)) << endmsg; - destroy (); - throw failed_constructor(); - } - - _path = string(buf); + _path = canonical_path(fullpath); /* we require _path to end with a dir separator */ -- cgit v1.2.3 From a9fc076d2ec9d3868119ab227c14832ced496060 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Fri, 27 Sep 2013 22:54:54 +1000 Subject: Waf options are not valid during build stage so use environment variable --- libs/backends/jack/wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/backends/jack/wscript b/libs/backends/jack/wscript index c5c506525a..1dd28dc0c3 100644 --- a/libs/backends/jack/wscript +++ b/libs/backends/jack/wscript @@ -43,7 +43,7 @@ def build(bld): obj.includes = ['.'] obj.name = 'jack_audiobackend' obj.target = 'jack_audiobackend' - if Options.options.dist_target == 'mingw': + if (bld.env['build_target'] == 'mingw'): obj.uselib = [ 'JACK', 'PORTAUDIO' ] else: obj.uselib = [ 'JACK' ] -- cgit v1.2.3 From ad906794b873362bfac8e028a1ac7fb0fadb9b31 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Fri, 11 Oct 2013 21:51:37 +1000 Subject: Fix pattern used to search for audio backends on windows The audio backend dlls have a number postfix after the library/module name --- libs/ardour/audioengine.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 0119aa642c..607606f4c7 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -472,7 +472,7 @@ AudioEngine::discover_backends () Glib::PatternSpec so_extension_pattern("*backend.so"); Glib::PatternSpec dylib_extension_pattern("*backend.dylib"); - Glib::PatternSpec dll_extension_pattern("*backend.dll"); + Glib::PatternSpec dll_extension_pattern("*backend*.dll"); find_matching_files_in_search_path (backend_search_path (), so_extension_pattern, backend_modules); -- cgit v1.2.3 From f74521b0cdee78b108922f71dc480f5186260e88 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Mon, 21 Oct 2013 20:54:37 +1000 Subject: Remove command line string quoting when forming jack command line on windows This used to be necessary when we started the JACK server but now that we write a .jackdrc it only causes problems. I have fixed this before in some branch, must have been lost in a merge. --- libs/backends/jack/jack_utils.cc | 4 ---- 1 file changed, 4 deletions(-) (limited to 'libs') diff --git a/libs/backends/jack/jack_utils.cc b/libs/backends/jack/jack_utils.cc index 331c164353..01af13fe9c 100644 --- a/libs/backends/jack/jack_utils.cc +++ b/libs/backends/jack/jack_utils.cc @@ -891,11 +891,7 @@ ARDOUR::get_jack_command_line_string (JackCommandLineOptions& options, string& c ostringstream oss; for (vector::const_iterator i = args.begin(); i != args.end();) { -#ifdef WIN32 - oss << quote_string (*i); -#else oss << *i; -#endif if (++i != args.end()) oss << ' '; } -- cgit v1.2.3 From 4a1b43b9d551d82252adf070a253a21cd77647a5 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Mon, 2 Dec 2013 19:57:51 +1000 Subject: Replace non-portable printf format specifier This caused Diskstream state to be restored incorrectly --- libs/ardour/audio_diskstream.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index f4d10c2043..0a9393e980 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -1789,7 +1789,7 @@ AudioDiskstream::get_state () LocaleGuard lg (X_("POSIX")); boost::shared_ptr c = channels.reader(); - snprintf (buf, sizeof(buf), "%zd", c->size()); + snprintf (buf, sizeof(buf), "%d", c->size()); node.add_property ("channels", buf); if (!capturing_sources.empty() && _session.get_record_enabled()) { -- cgit v1.2.3 From 0f6a65e405792d434e61f8e86fe67bbceaa4cabe Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Tue, 3 Dec 2013 20:07:32 +1000 Subject: Use Sleep instead of usleep on windows in JACK backend --- libs/backends/jack/jack_connection.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libs') diff --git a/libs/backends/jack/jack_connection.cc b/libs/backends/jack/jack_connection.cc index 09e6c9d6e7..77c86b9143 100644 --- a/libs/backends/jack/jack_connection.cc +++ b/libs/backends/jack/jack_connection.cc @@ -145,7 +145,11 @@ JackConnection::close () _jack = 0; /* If we started JACK, it will be closing down */ +#ifdef PLATFORM_WINDOWS + Sleep(500); +#else usleep (500000); +#endif Disconnected (""); /* EMIT SIGNAL */ -- cgit v1.2.3 From a420328354c3e8a9cd52b0fceb23b2b2a6b45c26 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Tue, 3 Dec 2013 20:21:17 +1000 Subject: Reinstate call to package config for JACK backend Not sure how this got lost, merge perhaps. --- libs/backends/jack/wscript | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libs') diff --git a/libs/backends/jack/wscript b/libs/backends/jack/wscript index 1dd28dc0c3..b827c95cfe 100644 --- a/libs/backends/jack/wscript +++ b/libs/backends/jack/wscript @@ -20,6 +20,8 @@ def options(opt): autowaf.set_options(opt) def configure(conf): + autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.121.0') + # # PortAudio is currently used to get a list of audio device names. # We should find a better way to do this that doesn't involve this -- cgit v1.2.3 From 0258f2958b05c420105d0e684681193e404201ac Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 3 Dec 2013 10:24:05 -0500 Subject: switch from using Sleep/usleep to Glib::usleep() --- libs/backends/jack/jack_connection.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'libs') diff --git a/libs/backends/jack/jack_connection.cc b/libs/backends/jack/jack_connection.cc index 77c86b9143..fee1b299ba 100644 --- a/libs/backends/jack/jack_connection.cc +++ b/libs/backends/jack/jack_connection.cc @@ -21,6 +21,8 @@ #include #include +#include + #include "pbd/epa.h" #include "jack_connection.h" @@ -145,11 +147,7 @@ JackConnection::close () _jack = 0; /* If we started JACK, it will be closing down */ -#ifdef PLATFORM_WINDOWS - Sleep(500); -#else - usleep (500000); -#endif + Glib::usleep (500000); Disconnected (""); /* EMIT SIGNAL */ -- cgit v1.2.3 From b7835cd7b131d2843404b117f2313a0b708d3fe0 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 5 Dec 2013 14:45:17 -0500 Subject: workaround compilation issues with assembler in fpu code and mingw --- libs/pbd/fpu.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/pbd/fpu.cc b/libs/pbd/fpu.cc index 5d81cd2fd3..ef5d21ab4d 100644 --- a/libs/pbd/fpu.cc +++ b/libs/pbd/fpu.cc @@ -39,11 +39,14 @@ FPU::FPU () _flags = Flags (0); +#if defined(__MINGW64__) // Vkamyshniy: under __MINGW64__ the assembler code below is not compiled + return; +#endif + #if !( (defined __x86_64__) || (defined __i386__) ) // !ARCH_X86 return; #else - #ifndef _LP64 //USE_X86_64_ASM asm volatile ( "mov $1, %%eax\n" -- cgit v1.2.3 From 597c9c9b25790808c9ab8b0fb021bd8b9352d79f Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 5 Dec 2013 14:46:40 -0500 Subject: make mingw-based pthread comparison function work with both 32 and 64 bit variants of mingw --- libs/pbd/pbd/abstract_ui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/pbd/pbd/abstract_ui.h b/libs/pbd/pbd/abstract_ui.h index 905074c474..e3f1f36b4e 100644 --- a/libs/pbd/pbd/abstract_ui.h +++ b/libs/pbd/pbd/abstract_ui.h @@ -57,7 +57,7 @@ class AbstractUI : public BaseUI }; typedef typename RequestBuffer::rw_vector RequestBufferVector; -#if defined(__MINGW32__) +#ifdef COMPILER_MINGW struct pthread_cmp { -- cgit v1.2.3 From 8970446d7ec292e71a937f8f7c38389595d75b42 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 5 Dec 2013 14:48:45 -0500 Subject: additional source file for mingw build --- libs/pbd/wscript | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libs') diff --git a/libs/pbd/wscript b/libs/pbd/wscript index 59f7a3368b..317ffd0c45 100644 --- a/libs/pbd/wscript +++ b/libs/pbd/wscript @@ -125,6 +125,8 @@ def build(bld): if bld.env['build_target'] != 'mingw': obj.source += [ 'crossthread.cc' ] + else: + obj.source += [ 'mingw64/mingw64_pbd.cc' ] obj.export_includes = ['.'] obj.includes = ['.'] -- cgit v1.2.3 From 3144a81acb7d62ee7069dd814f7b5e8d3b7bcb76 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 5 Dec 2013 14:49:03 -0500 Subject: additional header needed for mingw build to get realpath() --- libs/ardour/session_state.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libs') diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 5c3ffae3cc..7847c932ec 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -76,6 +76,10 @@ #include "pbd/clear_dir.h" #include "pbd/localtime_r.h" +#if defined(__MINGW64__) // for realpath +#include "pbd/mingw64_pbd.h" +#endif + #include "ardour/amp.h" #include "ardour/audio_diskstream.h" #include "ardour/audio_track.h" -- cgit v1.2.3 From c0e5506994094862337d8c9050aa056268c1147a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 5 Dec 2013 17:21:50 -0500 Subject: we don't use realpath() anymore so there is need for a special mingw include --- libs/pbd/mingw64/mingw64_pbd.cc | 71 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 libs/pbd/mingw64/mingw64_pbd.cc (limited to 'libs') diff --git a/libs/pbd/mingw64/mingw64_pbd.cc b/libs/pbd/mingw64/mingw64_pbd.cc new file mode 100644 index 0000000000..07c3e9708c --- /dev/null +++ b/libs/pbd/mingw64/mingw64_pbd.cc @@ -0,0 +1,71 @@ +/* + Copyright (C) 2009 John Emmas + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifdef __MINGW64__ + +#include +#include + +//*************************************************************** +// +// realpath() +// +// Emulates POSIX realpath() using Win32 _fullpath(). +// +// Returns: +// +// On Success: A pointer to the resolved (absolute) path +// On Failure: NULL +// + +extern "C" { + +char* +realpath (const char *original_path, char resolved_path[_MAX_PATH+1]) +{ +char *pRet = NULL; +bool bIsSymLink = 0; // We'll probably need to test the incoming path + // to find out if it points to a Windows shortcut + // (or a hard link) and set this appropriately. + if (bIsSymLink) + { + // At the moment I'm not sure if Windows '_fullpath()' is directly + // equivalent to POSIX 'realpath()' - in as much as the latter will + // resolve the supplied path if it happens to point to a symbolic + // link ('_fullpath()' probably DOESN'T do this but I'm not really + // sure if Ardour needs such functionality anyway). Therefore we'll + // possibly need to add that functionality here at a later date. + } + else + { + char temp[(MAX_PATH+1)*6]; // Allow for maximum length of a path in UTF8 characters + + // POSIX 'realpath()' requires that the buffer size is at + // least PATH_MAX+1, so assume that the user knew this !! + pRet = _fullpath(temp, Glib::locale_from_utf8(original_path).c_str(), _MAX_PATH); + if (NULL != pRet) + strcpy(resolved_path, Glib::locale_to_utf8(temp).c_str()); + } + + return (pRet); +} + +} + +#endif // __MINGW64__ -- cgit v1.2.3 From bab60c2e8c307f0c9455d4083c4850b2d0163845 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 5 Dec 2013 17:23:18 -0500 Subject: we don't use realpath() anymore so there is need for a special mingw include --- libs/pbd/mingw64/mingw64_pbd.cc | 71 ----------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 libs/pbd/mingw64/mingw64_pbd.cc (limited to 'libs') diff --git a/libs/pbd/mingw64/mingw64_pbd.cc b/libs/pbd/mingw64/mingw64_pbd.cc deleted file mode 100644 index 07c3e9708c..0000000000 --- a/libs/pbd/mingw64/mingw64_pbd.cc +++ /dev/null @@ -1,71 +0,0 @@ -/* - Copyright (C) 2009 John Emmas - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#ifdef __MINGW64__ - -#include -#include - -//*************************************************************** -// -// realpath() -// -// Emulates POSIX realpath() using Win32 _fullpath(). -// -// Returns: -// -// On Success: A pointer to the resolved (absolute) path -// On Failure: NULL -// - -extern "C" { - -char* -realpath (const char *original_path, char resolved_path[_MAX_PATH+1]) -{ -char *pRet = NULL; -bool bIsSymLink = 0; // We'll probably need to test the incoming path - // to find out if it points to a Windows shortcut - // (or a hard link) and set this appropriately. - if (bIsSymLink) - { - // At the moment I'm not sure if Windows '_fullpath()' is directly - // equivalent to POSIX 'realpath()' - in as much as the latter will - // resolve the supplied path if it happens to point to a symbolic - // link ('_fullpath()' probably DOESN'T do this but I'm not really - // sure if Ardour needs such functionality anyway). Therefore we'll - // possibly need to add that functionality here at a later date. - } - else - { - char temp[(MAX_PATH+1)*6]; // Allow for maximum length of a path in UTF8 characters - - // POSIX 'realpath()' requires that the buffer size is at - // least PATH_MAX+1, so assume that the user knew this !! - pRet = _fullpath(temp, Glib::locale_from_utf8(original_path).c_str(), _MAX_PATH); - if (NULL != pRet) - strcpy(resolved_path, Glib::locale_to_utf8(temp).c_str()); - } - - return (pRet); -} - -} - -#endif // __MINGW64__ -- cgit v1.2.3 From e0cc10540d76a2d3c87ea1dd1742eb4d894b1eec Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 5 Dec 2013 17:24:39 -0500 Subject: extra source no longer required --- libs/pbd/wscript | 2 -- 1 file changed, 2 deletions(-) (limited to 'libs') diff --git a/libs/pbd/wscript b/libs/pbd/wscript index 317ffd0c45..59f7a3368b 100644 --- a/libs/pbd/wscript +++ b/libs/pbd/wscript @@ -125,8 +125,6 @@ def build(bld): if bld.env['build_target'] != 'mingw': obj.source += [ 'crossthread.cc' ] - else: - obj.source += [ 'mingw64/mingw64_pbd.cc' ] obj.export_includes = ['.'] obj.includes = ['.'] -- cgit v1.2.3 From 550b991176b31c644947ad6184633b437d11eb0f Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 5 Dec 2013 17:39:41 -0500 Subject: remove unnecessary recently-added include for realpath, which is not actively used --- libs/ardour/session_state.cc | 4 ---- 1 file changed, 4 deletions(-) (limited to 'libs') diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 7847c932ec..5c3ffae3cc 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -76,10 +76,6 @@ #include "pbd/clear_dir.h" #include "pbd/localtime_r.h" -#if defined(__MINGW64__) // for realpath -#include "pbd/mingw64_pbd.h" -#endif - #include "ardour/amp.h" #include "ardour/audio_diskstream.h" #include "ardour/audio_track.h" -- cgit v1.2.3 From ef2c1ff92fd15de2f7ff4125f8ba698927ce07da Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 5 Dec 2013 17:40:21 -0500 Subject: add (likely, partial) windows implementation of POSIX realpath() for COMPILER_MINGW where the latter is not available, to the only place realpath() is used --- libs/pbd/pathexpand.cc | 52 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 4 deletions(-) (limited to 'libs') diff --git a/libs/pbd/pathexpand.cc b/libs/pbd/pathexpand.cc index 5784ec9428..4935297ea0 100644 --- a/libs/pbd/pathexpand.cc +++ b/libs/pbd/pathexpand.cc @@ -33,12 +33,57 @@ using std::string; using std::vector; +#ifdef COMPILER_MINGW + +#include +#include + +/**************************************************************** + * Emulate POSIX realpath() using Win32 _fullpath() since realpath() + * is not available. + * + * Returns: + * On Success: A pointer to the resolved (absolute) path + * On Failure: 0 (NULL) + */ + +static char* +realpath (const char *original_path, char resolved_path[_MAX_PATH+1]) +{ + char *rpath = 0; + bool bIsSymLink = false; // We'll probably need to test the incoming path + // to find out if it points to a Windows shortcut + // (or a hard link) and set this appropriately. + + if (bIsSymLink) { + // At the moment I'm not sure if Windows '_fullpath()' is directly + // equivalent to POSIX 'realpath()' - in as much as the latter will + // resolve the supplied path if it happens to point to a symbolic + // link ('_fullpath()' probably DOESN'T do this but I'm not really + // sure if Ardour needs such functionality anyway). Therefore we'll + // possibly need to add that functionality here at a later date. + } else { + char temp[(MAX_PATH+1)*6]; // Allow for maximum length of a path in wchar characters + + // POSIX 'realpath()' requires that the buffer size is at + // least PATH_MAX+1, so assume that the user knew this !! + + rpath = _fullpath (temp, Glib::locale_from_utf8 (original_path).c_str(), _MAX_PATH); + + if (0 != rpath) { + snprintf (resolved_path, _MAX_PATH+1, Glib::locale_to_utf8 (temp).c_str()); + } + + } + + return (rpath); +} + +#endif // COMPILER_MINGW + string PBD::canonical_path (const std::string& path) { -#ifdef COMPILER_MINGW - return path; -#else char buf[PATH_MAX+1]; if (!realpath (path.c_str(), buf) && (errno != ENOENT)) { @@ -46,7 +91,6 @@ PBD::canonical_path (const std::string& path) } return string (buf); -#endif } string -- cgit v1.2.3 From a7961f04cf7d74a3cada760908b364b0e4453690 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 5 Dec 2013 17:43:15 -0500 Subject: fix error in mingw version of realpath() --- libs/pbd/pathexpand.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/pbd/pathexpand.cc b/libs/pbd/pathexpand.cc index 4935297ea0..203bdcd069 100644 --- a/libs/pbd/pathexpand.cc +++ b/libs/pbd/pathexpand.cc @@ -71,7 +71,7 @@ realpath (const char *original_path, char resolved_path[_MAX_PATH+1]) rpath = _fullpath (temp, Glib::locale_from_utf8 (original_path).c_str(), _MAX_PATH); if (0 != rpath) { - snprintf (resolved_path, _MAX_PATH+1, Glib::locale_to_utf8 (temp).c_str()); + snprintf (resolved_path, _MAX_PATH+1, "%s", Glib::locale_to_utf8 (temp).c_str()); } } -- cgit v1.2.3 From dc60753ddebf29f8da056120513b6592684622f3 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Sat, 7 Dec 2013 20:20:12 +1000 Subject: Use correct header include for _fullpath According to http://msdn.microsoft.com/en-us/library/506720ff(v=vs.120).aspx --- libs/pbd/pathexpand.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libs') diff --git a/libs/pbd/pathexpand.cc b/libs/pbd/pathexpand.cc index 203bdcd069..26454e4164 100644 --- a/libs/pbd/pathexpand.cc +++ b/libs/pbd/pathexpand.cc @@ -35,7 +35,7 @@ using std::vector; #ifdef COMPILER_MINGW -#include +#include #include /**************************************************************** @@ -63,7 +63,7 @@ realpath (const char *original_path, char resolved_path[_MAX_PATH+1]) // sure if Ardour needs such functionality anyway). Therefore we'll // possibly need to add that functionality here at a later date. } else { - char temp[(MAX_PATH+1)*6]; // Allow for maximum length of a path in wchar characters + char temp[(_MAX_PATH+1)*6]; // Allow for maximum length of a path in wchar characters // POSIX 'realpath()' requires that the buffer size is at // least PATH_MAX+1, so assume that the user knew this !! -- cgit v1.2.3 From be376350b549ddac13a258db650acc55c100c817 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Fri, 11 Oct 2013 21:54:40 +1000 Subject: A few basic tests for AudioEngine --- libs/ardour/test/audio_engine_test.cc | 53 +++++++++++++++++++++++++++++++++++ libs/ardour/test/audio_engine_test.h | 14 +++++++++ libs/ardour/wscript | 2 ++ 3 files changed, 69 insertions(+) create mode 100644 libs/ardour/test/audio_engine_test.cc create mode 100644 libs/ardour/test/audio_engine_test.h (limited to 'libs') diff --git a/libs/ardour/test/audio_engine_test.cc b/libs/ardour/test/audio_engine_test.cc new file mode 100644 index 0000000000..b992caf73e --- /dev/null +++ b/libs/ardour/test/audio_engine_test.cc @@ -0,0 +1,53 @@ +#include + +#include "ardour/audioengine.h" +#include "ardour/audio_backend.h" +#include "ardour/backend_search_path.h" + +#include "audio_engine_test.h" +#include "test_common.h" + +CPPUNIT_TEST_SUITE_REGISTRATION (AudioEngineTest); + +using namespace std; +using namespace ARDOUR; +using namespace PBD; + +void +print_audio_backend_info (AudioBackendInfo const* abi) +{ + cerr << "Audio Backend, name:" << abi->name << endl; +} + +void +AudioEngineTest::test_backends () +{ + AudioEngine* engine = AudioEngine::create (); + + CPPUNIT_ASSERT (engine); + + std::vector backends = engine->available_backends (); + + CPPUNIT_ASSERT (backends.size () != 0); + + for (std::vector::const_iterator i = backends.begin(); + i != backends.end(); ++i) { + print_audio_backend_info(*i); + } +} + +void +AudioEngineTest::test_start () +{ + AudioEngine* engine = AudioEngine::create (); + + CPPUNIT_ASSERT_NO_THROW (engine->set_default_backend ()); + + init_post_engine (); + + CPPUNIT_ASSERT (engine->start () == 0); + + // sleep + // stop + // destroy +} diff --git a/libs/ardour/test/audio_engine_test.h b/libs/ardour/test/audio_engine_test.h new file mode 100644 index 0000000000..9a6d9cc241 --- /dev/null +++ b/libs/ardour/test/audio_engine_test.h @@ -0,0 +1,14 @@ +#include +#include + +class AudioEngineTest : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE (AudioEngineTest); + CPPUNIT_TEST (test_backends); + CPPUNIT_TEST (test_start); + CPPUNIT_TEST_SUITE_END (); + +public: + void test_backends (); + void test_start (); +}; diff --git a/libs/ardour/wscript b/libs/ardour/wscript index b509db361f..4ba8f4a0ed 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -434,6 +434,7 @@ def build(bld): testcommon.source += [ 'sse_functions_64bit.s' ] if bld.env['SINGLE_TESTS']: + create_ardour_test_program(bld, obj.includes, 'audio_engine_test', 'test_audio_engine', ['test/audio_engine_test.cc']) create_ardour_test_program(bld, obj.includes, 'automation_list_property_test', 'test_automation_list_property', ['test/automation_list_property_test.cc']) create_ardour_test_program(bld, obj.includes, 'bbt', 'test_bbt', ['test/bbt_test.cc']) create_ardour_test_program(bld, obj.includes, 'tempo', 'test_tempo', ['test/tempo_test.cc']) @@ -452,6 +453,7 @@ def build(bld): create_ardour_test_program(bld, obj.includes, 'session_test', 'test_session', ['test/session_test.cc']) test_sources = ''' + test/audio_engine_test.cc test/automation_list_property_test.cc test/bbt_test.cc test/tempo_test.cc -- cgit v1.2.3 From 94993816cc5da618d3bab4fa9eb145db575ba1b1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 19 Dec 2013 12:55:52 -0500 Subject: move portable copyfile function into tools/autowaf.py and use it in both gtk2_ardour and taglib --- gtk2_ardour/wscript | 7 +------ libs/taglib/wscript | 2 +- tools/autowaf.py | 7 +++++++ waf | Bin 94823 -> 94861 bytes 4 files changed, 9 insertions(+), 7 deletions(-) (limited to 'libs') diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index cd606029eb..f5ff15e9c6 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -365,11 +365,6 @@ def build_color_scheme(path, prefix): f.close() return color_scheme -def copyfile (task): - src = task.inputs[0].abspath() - tgt = task.outputs[0].abspath() - shutil.copy2 (src, tgt) - def build(bld): VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR']) @@ -644,7 +639,7 @@ def build(bld): obj.install_path = None set_subst_dict(obj, light_rc_subst_dict) - obj = bld(rule = copyfile) + obj = bld(rule = autowaf.copyfile) obj.source = [ 'ardour3_widget_list.rc' ] obj.target = 'ardour3_widgets.rc' obj.install_path = None diff --git a/libs/taglib/wscript b/libs/taglib/wscript index 219cbd3f08..709eb0fd90 100644 --- a/libs/taglib/wscript +++ b/libs/taglib/wscript @@ -103,7 +103,7 @@ def build(bld): for h in headers: tgt = bld.path.get_bld().make_node (os.path.join ('taglib', os.path.basename (h))) if not os.path.exists (tgt.bldpath()): - bld (rule = "cp ${SRC} ${TGT}", + bld (rule = autowaf.copyfile, source = bld.path.make_node (os.path.join ('taglib', h)), target = tgt) diff --git a/tools/autowaf.py b/tools/autowaf.py index 46c563519f..7d4da7b061 100644 --- a/tools/autowaf.py +++ b/tools/autowaf.py @@ -10,6 +10,7 @@ import glob import os import subprocess import sys +import shutil from waflib import Configure, Context, Logs, Node, Options, Task, Utils from waflib.TaskGen import feature, before, after @@ -91,6 +92,12 @@ def set_options(opt, debug_by_default=False): help="LV2 bundles [Default: LIBDIR/lv2]") g_step = 1 +def copyfile (task): + # a cross-platform utility for copying files as part of tasks + src = task.inputs[0].abspath() + tgt = task.outputs[0].abspath() + shutil.copy2 (src, tgt) + def check_header(conf, lang, name, define='', mandatory=True): "Check for a header" includes = '' # search default system include paths diff --git a/waf b/waf index 927b8ae126..c29d226aff 100755 Binary files a/waf and b/waf differ -- cgit v1.2.3 From b1231696caa7d08c80055ca59b18f4b634dc47cf Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 19 Dec 2013 13:04:04 -0500 Subject: Mingw64 has pthread_t available, and does not need a thread ID comparison function --- libs/pbd/pbd/abstract_ui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/pbd/pbd/abstract_ui.h b/libs/pbd/pbd/abstract_ui.h index e3f1f36b4e..ad97f25781 100644 --- a/libs/pbd/pbd/abstract_ui.h +++ b/libs/pbd/pbd/abstract_ui.h @@ -57,7 +57,7 @@ class AbstractUI : public BaseUI }; typedef typename RequestBuffer::rw_vector RequestBufferVector; -#ifdef COMPILER_MINGW +#if defined(__MINGW32__) && !defined (__MINGW64__) struct pthread_cmp { -- cgit v1.2.3