Merge branch 'mingw-updates' of https://github.com/mojofunk/ardour into cairocanvas
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 19 May 2014 21:19:43 +0000 (17:19 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 19 May 2014 21:19:43 +0000 (17:19 -0400)
17 files changed:
gtk2_ardour/add_video_dialog.h
gtk2_ardour/ardour_ui_dialogs.cc
gtk2_ardour/editor_timefx.cc
gtk2_ardour/video_server_dialog.cc
headless/load_session.cc
libs/ardour/audioengine.cc
libs/backends/dummy/dummy_audiobackend.cc
libs/pbd/pbd/abstract_ui.h
libs/pbd/pbd/localtime_r.h
libs/pbd/wscript
tools/windows_packaging/copydll-fedora.sh [new file with mode: 0755]
tools/windows_packaging/copydll-waves.sh [new file with mode: 0755]
tools/windows_packaging/mingw-env.sh
tools/windows_packaging/package-f19.sh [new file with mode: 0755]
tools/windows_packaging/package-f20.sh [new file with mode: 0755]
tools/windows_packaging/package.sh
wscript

index 203df3ad3dc122f2575931a5379b3e3b6258ec34..3d5ff540305d9e40db49d672dad6a2ed0fe93406 100644 (file)
 
 #include <string>
 
+#ifdef interface
+#undef interface
+#endif
+
 #include <gtkmm.h>
 
 #include "ardour/types.h"
index 35dbe3cfc9702da1038bfecdd915b22a2c0ef022..6fef5b94e49d6dead1bbcc54141db8c1cf6f8d87 100644 (file)
 #include "ardour/profile.h"
 #include "ardour/session.h"
 
-#ifdef interface
-#undef interface
-#endif
-
 #include "actions.h"
 #include "add_route_dialog.h"
 #include "add_video_dialog.h"
index 2528c823b7996ac9f75346ece542476c47378f87..765030507b649adaf16d916d36ca97fada65f1f8 100644 (file)
@@ -403,7 +403,7 @@ Editor::timefx_thread (void *arg)
         */
 
 #ifdef PLATFORM_WINDOWS
-       Sleep(2000);
+       Glib::usleep(2 * G_USEC_PER_SEC);
 #else
         struct timespec t = { 2, 0 };
         nanosleep (&t, 0);
index e4c9a7f51abf0d5e07a698c5477ce4f9e8fdac26..6d9bb229781532b044cf6bdd503f326d5f3db4ef 100644 (file)
 #include "utils_videotl.h"
 #include "i18n.h"
 
+#ifdef PLATFORM_WINDOWS
+#include <windows.h>
+#endif
+
 using namespace Gtk;
 using namespace std;
 using namespace PBD;
index dc2644c4288567eb581a44bb022b04e414681f15..a9037214cc33f3fa6874e0c8f7f75ff024cbe7f4 100644 (file)
@@ -17,6 +17,7 @@ using namespace ARDOUR;
 using namespace PBD;
 
 #ifdef PLATFORM_WINDOWS
+#include <windows.h>
 #define sleep(X) Sleep((X) * 1000)
 #endif
 
index 8d4b17ebd4c607f27065bd79d66b703e4518b46a..77d7731edf3824478ef5f50a357a2580d07b1ad3 100644 (file)
@@ -480,7 +480,7 @@ AudioEngine::discover_backends ()
                Glib::PatternSpec dll_extension_pattern("*backendRDC.dll");
        #endif
 #else
-       Glib::PatternSpec dll_extension_pattern("*backend.dll");
+       Glib::PatternSpec dll_extension_pattern("*backend*.dll");
 #endif
        
        find_matching_files_in_search_path (backend_search_path (),
index 5f72c935199f319b5289644eba64892449cc0b4c..01e8085e04614e9dc4f24441fabff47a11bc4f38 100644 (file)
@@ -20,6 +20,8 @@
 #include <sys/time.h>
 #include <regex.h>
 
+#include <glibmm.h>
+
 #include "dummy_audiobackend.h"
 #include "pbd/error.h"
 #include "i18n.h"
@@ -318,7 +320,7 @@ DummyAudioBackend::_start (bool /*for_latency_measurement*/)
        }
 
        int timeout = 5000;
-       while (!_running && --timeout > 0) { usleep (1000); }
+       while (!_running && --timeout > 0) { Glib::usleep (1000); }
 
        if (timeout == 0 || !_running) {
                PBD::error << _("DummyAudioBackend: failed to start process thread.") << endmsg;
@@ -446,15 +448,9 @@ DummyAudioBackend::in_process_thread ()
 {
        for (std::vector<pthread_t>::const_iterator i = _threads.begin (); i != _threads.end (); ++i)
        {
-#ifdef COMPILER_MINGW
-               if (*i == GetCurrentThread ()) {
-                       return true;
-               }
-#else // pthreads
                if (pthread_equal (*i, pthread_self ()) != 0) {
                        return true;
                }
-#endif
        }
        return false;
 }
@@ -1014,13 +1010,13 @@ DummyAudioBackend::main_process_thread ()
                        const int64_t nomial_time = 1e6 * _samples_per_period / _samplerate;
                        _dsp_load = elapsed_time / (float) nomial_time;
                        if (elapsed_time < nomial_time) {
-                               ::usleep (nomial_time - elapsed_time);
+                               Glib::usleep (nomial_time - elapsed_time);
                        } else {
-                               ::usleep (100); // don't hog cpu
+                               Glib::usleep (100); // don't hog cpu
                        }
                } else {
                        _dsp_load = 1.0;
-                       ::usleep (100); // don't hog cpu
+                       Glib::usleep (100); // don't hog cpu
                }
                clock1 = g_get_monotonic_time();
        }
index 8e386aa4ebed3f6212093ff3d7623aa8d0d5de70..a8602c7d7877663b00081e04d03c5321a8f3aadc 100644 (file)
@@ -75,8 +75,20 @@ class ABSTRACT_UI_API AbstractUI : public BaseUI
         };
        typedef typename RequestBuffer::rw_vector RequestBufferVector;
 
+#if defined(COMPILER_MINGW) && defined(PTW32_VERSION)
+       struct pthread_cmp
+       {
+               bool operator() (const ptw32_handle_t& thread1, const ptw32_handle_t& thread2)
+               {
+                       return thread1.p < thread2.p;
+               }
+       };
+       typedef typename std::map<pthread_t,RequestBuffer*, pthread_cmp>::iterator RequestBufferMapIterator;
+       typedef std::map<pthread_t,RequestBuffer*, pthread_cmp> RequestBufferMap;
+#else
        typedef typename std::map<pthread_t,RequestBuffer*>::iterator RequestBufferMapIterator;
        typedef std::map<pthread_t,RequestBuffer*> RequestBufferMap;
+#endif
 
        RequestBufferMap request_buffers;
         static Glib::Threads::Private<RequestBuffer> per_thread_request_buffer;
index 532bb3ed12349dc9e3b99273cb572a4b1f3624af..2a4502481d8b139f8f77ea863c0f6f9978e581be 100644 (file)
@@ -7,7 +7,7 @@
 #define localtime_r( _clock, _result ) \
        ( *(_result) = *localtime( (_clock) ), (_result) )
 
-#elif defined __MINGW64__
+#elif defined COMPILER_MINGW
 
 #  ifdef localtime_r
 #  undef localtime_r
index 3e7b423fc74133728de701451b0ccf387f92a87c..2ba79d0c34d6fdd8ec2fbcf59fcadcadd9774c0a 100644 (file)
@@ -106,7 +106,7 @@ def configure(conf):
     # Boost headers
     autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
     autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
-    if conf.env['WINDOWS_VST_SUPPORT'] == True and Options.options.dist_target == 'mingw':
+    if Options.options.dist_target == 'mingw':
         conf.check(compiler='cxx',
                    lib='ole32',
                    mandatory=True,
diff --git a/tools/windows_packaging/copydll-fedora.sh b/tools/windows_packaging/copydll-fedora.sh
new file mode 100755 (executable)
index 0000000..dcfbc41
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+function copydll () {
+       if [ -f $MINGW_ROOT/bin/$1 ] ; then
+               echo "cp $MINGW_ROOT/bin/$1 $2"
+               cp $MINGW_ROOT/bin/$1 $2 || return 1
+               return 0
+       fi
+
+       echo "ERROR: File $1 does not exist"
+       return 1
+}
diff --git a/tools/windows_packaging/copydll-waves.sh b/tools/windows_packaging/copydll-waves.sh
new file mode 100755 (executable)
index 0000000..fe2b5ed
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/bash\r
+\r
+function copydll () {\r
+       if [ -f $GTK/bin/$1 ] ; then\r
+               echo "cp $GTK/bin/$1 $2"\r
+               cp $GTK/bin/$1 $2 || return 1\r
+               return 0\r
+       fi\r
+       \r
+       if [ -f $GTK/lib/$1 ] ; then\r
+               echo "cp $GTK/lib/$1 $2"\r
+               cp $GTK/lib/$1 $2 || return 1\r
+               return 0\r
+       fi\r
+       \r
+       if [ -f $A3/bin/$1 ] ; then\r
+               echo "cp $A3/bin/$1 $2"\r
+               cp $A3/bin/$1 $2 || return 1\r
+               return 0\r
+       fi\r
+\r
+       if [ -f $A3/lib/$1 ] ; then\r
+               echo "$A3/lib/$1 $2"\r
+               cp $A3/lib/$1 $2 || return 1\r
+               return 0\r
+       fi\r
+       if which $1 ; then        \r
+         echo "cp `which $1` $2"\r
+         cp `which $1` $2 || return 1\r
+         return 0\r
+       fi\r
+       \r
+       echo "there is no $1"\r
+       return 1\r
+}\r
index 983e6d0b9b382091a7f30d0270e515fbd7b5ec75..00145de2adddb6e46fd59eaf5684e1a88314640b 100755 (executable)
@@ -1,11 +1,23 @@
 #!/bin/bash
 
-BASE=$(readlink -f $0)
-BASE=$(dirname $BASE) # up one
-BASE=$(dirname $BASE) # up one more
-BASE=$(dirname $BASE) # up one more
+if [ -z "$ARCH" ]; then
+       echo "ARCH not set defaulting to win32"
+       ARCH=win32
+elif [ "$ARCH" == "win32" ]; then
+       echo "ARCH set to win32"
+elif [ "$ARCH" == "win64" ]; then
+       echo "ARCH set to win64"
+else
+       echo "ARCH set invalid value aborting..."
+       exit 1
+fi
+
+if [ "$ARCH" == "win32" ]; then
+       HOST=i686-w64-mingw32
+else
+       HOST=x86_64-w64-mingw32
+fi
 
-HOST=i686-w64-mingw32
 MINGW_ROOT=/usr/$HOST/sys-root/mingw
 
 export PKG_CONFIG_PREFIX=$MINGW_ROOT
@@ -22,6 +34,11 @@ export LINK_CXX=$HOST-g++
 export WINRC=$HOST-windres
 export STRIP=$HOST-strip
 
+BASE=$(readlink -f $0)
+BASE=$(dirname $BASE) # up one
+BASE=$(dirname $BASE) # up one more
+BASE=$(dirname $BASE) # up one more
+
 BUILD_DIR=$BASE/build
 BUILD_CACHE_FILE=$BUILD_DIR/c4che/_cache.py
 TOOLS_DIR=$BASE/tools/windows_packaging
@@ -35,9 +52,9 @@ then
 
        # Figure out the Build Type
        if [ x$DEBUG = xT ]; then
-               PACKAGE_DIR="$APPNAME-${release_version}-win32-dbg"
+               PACKAGE_DIR="$APPNAME-${release_version}-$ARCH-dbg"
        else
-               PACKAGE_DIR="$APPNAME-${release_version}-win32"
+               PACKAGE_DIR="$APPNAME-${release_version}-$ARCH"
        fi
 
        if grep -q "BUILD_TESTS = True" $BUILD_CACHE_FILE; then
diff --git a/tools/windows_packaging/package-f19.sh b/tools/windows_packaging/package-f19.sh
new file mode 100755 (executable)
index 0000000..3900571
--- /dev/null
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+DLLS='
+jack-0.dll
+jackserver-0.dll
+libatk-1.0-0.dll
+libatkmm-1.6-1.dll
+libbz2-1.dll
+libcairo-2.dll
+libcairo-gobject-2.dll
+libcairomm-1.0-1.dll
+libcairo-script-interpreter-2.dll
+libcppunit-1-12-1.dll
+libcrypto-10.dll
+libcurl-4.dll
+libexpat-1.dll
+libfftw3-3.dll
+libfftw3f-3.dll
+libfontconfig-1.dll
+libfreetype-6.dll
+libgailutil-18.dll
+libgcc_s_sjlj-1.dll
+libgdkmm-2.4-1.dll
+libgdk_pixbuf-2.0-0.dll
+libgdk-win32-2.0-0.dll
+libgio-2.0-0.dll
+libgiomm-2.4-1.dll
+libglib-2.0-0.dll
+libglibmm-2.4-1.dll
+libglibmm_generate_extra_defs-2.4-1.dll
+libgmodule-2.0-0.dll
+libgnurx-0.dll
+libgobject-2.0-0.dll
+libgthread-2.0-0.dll
+libgtkmm-2.4-1.dll
+libgtk-win32-2.0-0.dll
+libharfbuzz-0.dll
+iconv.dll
+libFLAC-8.dll
+libogg-0.dll
+libvorbis-0.dll
+libvorbisenc-2.dll
+libffi-6.dll
+libidn-11.dll
+libintl-8.dll
+liblo-7.dll
+libpango-1.0-0.dll
+libpangocairo-1.0-0.dll
+libpangoft2-1.0-0.dll
+libpangomm-1.4-1.dll
+libpangowin32-1.0-0.dll
+libpixman-1-0.dll
+libpng15-15.dll
+rubberband-2.dll
+libsamplerate-0.dll
+libsigc-2.0-0.dll
+libsndfile-1.dll
+libssh2-1.dll
+libssl-10.dll
+libstdc++-6.dll
+libtag.dll
+libxml2-2.dll
+pthreadGC2.dll
+portaudio-2.dll
+vamp-hostsdk-3.dll
+vamp-sdk-2.dll
+zlib1.dll
+'
+
+WITH_JACK='TRUE'
+
+. ./copydll-fedora.sh
+. ./package.sh
diff --git a/tools/windows_packaging/package-f20.sh b/tools/windows_packaging/package-f20.sh
new file mode 100755 (executable)
index 0000000..50cbcd9
--- /dev/null
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+DLLS='
+jack-0.dll
+jackserver-0.dll
+libatk-1.0-0.dll
+libatkmm-1.6-1.dll
+libbz2-1.dll
+libcairo-2.dll
+libcairo-gobject-2.dll
+libcairomm-1.0-1.dll
+libcairo-script-interpreter-2.dll
+libcppunit-1-12-1.dll
+libcrypto-10.dll
+libcurl-4.dll
+libexpat-1.dll
+libfftw3-3.dll
+libfftw3f-3.dll
+libfontconfig-1.dll
+libfreetype-6.dll
+libgailutil-18.dll
+libgcc_s_sjlj-1.dll
+libgdkmm-2.4-1.dll
+libgdk_pixbuf-2.0-0.dll
+libgdk-win32-2.0-0.dll
+libgio-2.0-0.dll
+libgiomm-2.4-1.dll
+libglib-2.0-0.dll
+libglibmm-2.4-1.dll
+libglibmm_generate_extra_defs-2.4-1.dll
+libgmodule-2.0-0.dll
+libgnurx-0.dll
+libgobject-2.0-0.dll
+libgthread-2.0-0.dll
+libgtkmm-2.4-1.dll
+libgtk-win32-2.0-0.dll
+libharfbuzz-0.dll
+iconv.dll
+libFLAC-8.dll
+libogg-0.dll
+libvorbis-0.dll
+libvorbisenc-2.dll
+libffi-6.dll
+libidn-11.dll
+libintl-8.dll
+liblo-7.dll
+libpango-1.0-0.dll
+libpangocairo-1.0-0.dll
+libpangoft2-1.0-0.dll
+libpangomm-1.4-1.dll
+libpangowin32-1.0-0.dll
+libpixman-1-0.dll
+libpng16-16.dll
+rubberband-2.dll
+libsamplerate-0.dll
+libsigc-2.0-0.dll
+libsndfile-1.dll
+libssh2-1.dll
+libssl-10.dll
+libstdc++-6.dll
+libtag.dll
+libxml2-2.dll
+libwinpthread-1.dll
+portaudio-2.dll
+vamp-hostsdk-3.dll
+vamp-sdk-2.dll
+zlib1.dll
+'
+
+WITH_JACK='TRUE'
+
+. ./copydll-fedora.sh
+. ./package.sh
index dd1ec881196a09ee7db8defee11f0a66c9cec2ef..33eaa350e3a18e254c944ddc4dcd5c5757925e43 100755 (executable)
@@ -4,6 +4,11 @@
 
 . ./print-env.sh
 
+if [ -z "$DLLS" ]; then
+       echo "ERROR: DLLS variable is not defined..."
+       exit 1
+fi
+
 cd $BASE || exit 1
 
 if ! test -f $BUILD_CACHE_FILE; then
@@ -50,90 +55,30 @@ cp -r $MINGW_ROOT/lib/gtk-2.0 $PACKAGE_DIR/lib
 cp -r $MINGW_ROOT/lib/gdk-pixbuf-2.0 $PACKAGE_DIR/lib
 cp $TOOLS_DIR/loaders.cache $PACKAGE_DIR/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
 
-mkdir -p $PACKAGE_DIR/lib/pango/1.6.0/modules
-cp -r $MINGW_ROOT/lib/pango/1.6.0/modules/*.dll $PACKAGE_DIR/lib/pango/1.6.0/modules
+if test x$WITH_PANGO_1_6 != x; then
+       mkdir -p $PACKAGE_DIR/lib/pango/1.6.0/modules
+       cp -r $MINGW_ROOT/lib/pango/1.6.0/modules/*.dll $PACKAGE_DIR/lib/pango/1.6.0/modules
+else
+       mkdir -p $PACKAGE_DIR/lib/pango/1.8.0/modules
+       cp -r $MINGW_ROOT/lib/pango/1.8.0/modules/*.dll $PACKAGE_DIR/lib/pango/1.8.0/modules
+fi
+
 cp $TOOLS_DIR/pango.modules $PACKAGE_DIR/etc/pango
 
 cp $TOOLS_DIR/README $PACKAGE_DIR
 
-DLLS='
-jack-0.dll
-jackserver-0.dll
-libart_lgpl_2-2.dll
-libatk-1.0-0.dll
-libatkmm-1.6-1.dll
-libbz2-1.dll
-libcairo-2.dll
-libcairo-gobject-2.dll
-libcairomm-1.0-1.dll
-libcairo-script-interpreter-2.dll
-libcppunit-1-12-1.dll
-libcrypto-10.dll
-libcurl-4.dll
-libexpat-1.dll
-libfftw3-3.dll
-libfftw3f-3.dll
-libfontconfig-1.dll
-libfreetype-6.dll
-libgailutil-18.dll
-libgcc_s_sjlj-1.dll
-libgdkmm-2.4-1.dll
-libgdk_pixbuf-2.0-0.dll
-libgdk-win32-2.0-0.dll
-libgio-2.0-0.dll
-libgiomm-2.4-1.dll
-libglib-2.0-0.dll
-libglibmm-2.4-1.dll
-libglibmm_generate_extra_defs-2.4-1.dll
-libgmodule-2.0-0.dll
-libgnomecanvas-2-0.dll
-libgnomecanvasmm-2.6-1.dll
-libgnurx-0.dll
-libgobject-2.0-0.dll
-libgthread-2.0-0.dll
-libgtkmm-2.4-1.dll
-libgtk-win32-2.0-0.dll
-libharfbuzz-0.dll
-libiconv-2.dll
-iconv.dll
-libFLAC-8.dll
-libogg-0.dll
-libvorbis-0.dll
-libvorbisenc-2.dll
-libffi-6.dll
-libidn-11.dll
-libintl-8.dll
-liblo-7.dll
-libpango-1.0-0.dll
-libpangocairo-1.0-0.dll
-libpangoft2-1.0-0.dll
-libpangomm-1.4-1.dll
-libpangowin32-1.0-0.dll
-libpixman-1-0.dll
-libpng15-15.dll
-libsamplerate-0.dll
-libsigc-2.0-0.dll
-libsndfile-1.dll
-libssh2-1.dll
-libssl-10.dll
-libstdc++-6.dll
-libxml2-2.dll
-pthreadGC2.dll
-zlib1.dll
-'
-
 echo "Copying mingw shared libraries to $PACKAGE_DIR ..."
 
 for i in $DLLS;
 do
-cp $MINGW_ROOT/bin/$i $PACKAGE_DIR
+       copydll "$i" "$PACKAGE_DIR" || exit 1
 done
 
-echo "Copying JACK server and drivers to $PACKAGE_DIR ..."
-
-cp $MINGW_ROOT/bin/jackd.exe $PACKAGE_DIR
-cp -r $MINGW_ROOT/bin/jack $PACKAGE_DIR
-cp $MINGW_ROOT/bin/libportaudio-2.dll $PACKAGE_DIR
+if test x$WITH_JACK != x; then
+       echo "Copying JACK server and drivers to $PACKAGE_DIR ..."
+       cp $MINGW_ROOT/bin/jackd.exe $PACKAGE_DIR
+       cp -r $MINGW_ROOT/bin/jack $PACKAGE_DIR
+fi
 
 SRC_DIRS='
 libs/ardour
@@ -156,9 +101,11 @@ if [ x$DEBUG = xT ]; then
        do
        cp -r -p $BASE/$i $PACKAGE_SRC_DIR/libs
        done
-       
-       echo "Copying JACK utility programs to $PACKAGE_DIR ..."
-       cp $MINGW_ROOT/bin/jack_*.exe $PACKAGE_DIR
+
+       if test x$WITH_JACK != x; then
+               echo "Copying JACK utility programs to $PACKAGE_DIR ..."
+               cp $MINGW_ROOT/bin/jack_*.exe $PACKAGE_DIR
+       fi
 
        #echo "Copying any debug files to $PACKAGE_DIR ..."
        #cp $MINGW_ROOT/bin/*.debug $PACKAGE_DIR
diff --git a/wscript b/wscript
index 52d1ec6e28ad31fb9fc657aab65e170ff1e35712..fbb1a31dd4b910deb45d83aaff8753196bf4bd55 100644 (file)
--- a/wscript
+++ b/wscript
@@ -665,6 +665,7 @@ def configure(conf):
 
     # executing a test program is n/a when cross-compiling
     if Options.options.dist_target != 'mingw':
+        conf.check_cc(function_name='dlopen', header_name='dlfcn.h', lib='dl', uselib_store='DL')
         conf.check_cxx(fragment = "#include <boost/version.hpp>\nint main(void) { return (BOOST_VERSION >= 103900 ? 0 : 1); }\n",
                   execute = "1",
                   mandatory = True,
@@ -701,16 +702,6 @@ def configure(conf):
         # TODO put this only where it is needed
         conf.env.append_value('LIB', 'regex')
 
-    if Options.options.dist_target != 'mingw':
-        conf.check_cc(function_name='dlopen', header_name='dlfcn.h', lib='dl', uselib_store='DL')
-
-        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',
-                      okmsg = 'ok',
-                      errmsg = 'too old\nPlease install boost version 1.39 or higher.')
-
     # Tell everyone that this is a waf build
 
     conf.env.append_value('CFLAGS', '-DWAF_BUILD')