most of the 2.X->3.0 commit (up to rev 4299) except for gtk2_ardour/editor_canvas...
[ardour.git] / gtk2_ardour / ardour.sh.in
index 4a7219823ceca934e99cd8a20cc4645569ed8d7a..077073bdf6b9b5ab057f7d4e725f9106d601cbb5 100644 (file)
@@ -18,6 +18,25 @@ if [ "$MLOCK_LIMIT" != "unlimited" ]; then
 
 fi
 
+## Glib atomic test
+
+GLIB=$(ldd %INSTALL_PREFIX%/%LIBDIR%/ardour2/ardour-%VERSION% 2> /dev/null | grep glib-2.0 | sed 's/.*=> \([^ ]*\) .*/\1/')
+
+if [ "$GLIB" = "" ]; then
+       echo "WARNING: Could not check your glib-2.0 for mutex locking atomic operations."
+       echo ""
+elif [ $(nm -D --radix=dec --defined-only -S $GLIB | grep -w g_atomic_int_add | cut -d ' ' -f 2) -gt 32 ]; then
+       echo "WARNING: Your system contains a suspect libglib-2.0. Your version might be built"
+       echo "         to use mutex locking atomic operations. This is a fallback solution to"
+       echo "         a more robust hardware supported atomicity. It might cause reduced "
+       echo "         performance and/or deadlocks. Please contact your distribution support"
+       echo "         about this issue."
+       echo "         Unfortunately this check is not 100% accurate, so this might not be"
+       echo "         the case with your system."
+       echo ""
+fi
+
+exec %INSTALL_PREFIX%/%LIBDIR%/ardour2/ardour-%VERSION% "$@"
 
 ## Glib atomic test