2006-04-25 20:45:27 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2012-05-18 13:24:06 -04:00
|
|
|
#
|
|
|
|
# This script runs an installed version of Ardour. It sets a few environment variables
|
|
|
|
# and does a few checks before exec'ing the real executable.
|
|
|
|
#
|
|
|
|
|
2014-06-03 08:27:36 -04:00
|
|
|
export GTK_PATH=@CONFDIR@:@LIBDIR@${GTK_PATH:+:$GTK_PATH}
|
2006-11-15 16:06:21 -05:00
|
|
|
|
2014-06-03 08:27:36 -04:00
|
|
|
export LD_LIBRARY_PATH=@LIBDIR@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
|
2006-04-25 20:45:27 -04:00
|
|
|
|
2008-10-26 12:42:42 -04:00
|
|
|
## Memlock check
|
|
|
|
|
2007-01-10 17:14:41 -05:00
|
|
|
MLOCK_LIMIT=$(ulimit -l)
|
|
|
|
if [ "$MLOCK_LIMIT" != "unlimited" ]; then
|
|
|
|
echo "WARNING: Your system has a limit for maximum amount of locked memory!"
|
2009-02-26 23:40:44 -05:00
|
|
|
echo " This might cause Ardour to run out of memory before your system runs"
|
2008-10-26 12:42:42 -04:00
|
|
|
echo " out of memory. You can view the memory limit with 'ulimit -l', and it"
|
|
|
|
echo " is normally controlled by /etc/security/limits.conf"
|
|
|
|
echo ""
|
2007-01-10 17:14:41 -05:00
|
|
|
|
|
|
|
fi
|
|
|
|
|
2008-12-12 09:43:24 -05:00
|
|
|
## Glib atomic test
|
|
|
|
|
2014-06-03 08:27:36 -04:00
|
|
|
GLIB=$(ldd @LIBDIR@/ardour-@VERSION@ 2> /dev/null | grep glib-2.0 | sed 's/.*=> \([^ ]*\) .*/\1/')
|
2008-12-12 09:43:24 -05:00
|
|
|
|
2016-02-22 07:41:44 -05:00
|
|
|
if ! type nm >/dev/null 2>&1 || [ "$GLIB" = "" ]; then
|
2008-12-12 09:43:24 -05:00
|
|
|
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
|
|
|
|
|
2012-05-18 13:24:06 -04:00
|
|
|
#
|
|
|
|
# Running Ardour requires these 3 variables to be set
|
|
|
|
#
|
|
|
|
|
2014-06-03 08:27:36 -04:00
|
|
|
export ARDOUR_DATA_PATH=@DATADIR@
|
|
|
|
export ARDOUR_CONFIG_PATH=@CONFDIR@
|
|
|
|
export ARDOUR_DLL_PATH=@LIBDIR@
|
2012-05-18 13:24:06 -04:00
|
|
|
|
2015-05-04 13:09:37 -04:00
|
|
|
#
|
|
|
|
# NSM needs a path to this script
|
|
|
|
#
|
|
|
|
|
|
|
|
export ARDOUR_SELF="$0"
|
|
|
|
|
2012-12-18 10:26:50 -05:00
|
|
|
#
|
|
|
|
# VAMP has its own lookup path
|
|
|
|
#
|
|
|
|
|
2016-06-24 18:44:04 -04:00
|
|
|
export VAMP_PATH=@LIBDIR@/vamp${VAMP_PATH:+:$VAMP_PATH}
|
2012-12-18 10:26:50 -05:00
|
|
|
|
2012-10-25 13:35:07 -04:00
|
|
|
if [ $# -gt 0 ] ; then
|
|
|
|
case $1 in
|
|
|
|
-g|--gdb) GDB=gdb; shift ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2014-06-03 08:27:36 -04:00
|
|
|
exec $GDB @LIBDIR@/ardour-@VERSION@ "$@"
|
2006-04-25 20:45:27 -04:00
|
|
|
|
|
|
|
|