X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fardour.sh.in;h=8bcad1bf6ef08632e0f6576885f35001c731806d;hb=ad34eb7e0baa801b579782c8235562a1c90ca993;hp=077073bdf6b9b5ab057f7d4e725f9106d601cbb5;hpb=bc89fe0147c04b67141936d109c00dfd4d69cc4b;p=ardour.git diff --git a/gtk2_ardour/ardour.sh.in b/gtk2_ardour/ardour.sh.in index 077073bdf6..8bcad1bf6e 100644 --- a/gtk2_ardour/ardour.sh.in +++ b/gtk2_ardour/ardour.sh.in @@ -1,17 +1,20 @@ #!/bin/sh -export GTK_PATH=%INSTALL_PREFIX%/%LIBDIR%/ardour3:$GTK_PATH +# +# 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. +# -export LD_LIBRARY_PATH=%INSTALL_PREFIX%/%LIBDIR%/ardour3:$LD_LIBRARY_PATH -# DYLD_LIBRARY_PATH is for Darwin -export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH +export GTK_PATH=@CONFDIR@:@LIBDIR@${GTK_PATH:+:$GTK_PATH} + +export LD_LIBRARY_PATH=@LIBDIR@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ## Memlock check MLOCK_LIMIT=$(ulimit -l) if [ "$MLOCK_LIMIT" != "unlimited" ]; then echo "WARNING: Your system has a limit for maximum amount of locked memory!" - echo " This might cause Ardour to run out of memory before your system runs" + echo " This might cause Ardour to run out of memory before your system runs" 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 "" @@ -20,9 +23,9 @@ fi ## Glib atomic test -GLIB=$(ldd %INSTALL_PREFIX%/%LIBDIR%/ardour2/ardour-%VERSION% 2> /dev/null | grep glib-2.0 | sed 's/.*=> \([^ ]*\) .*/\1/') +GLIB=$(ldd @LIBDIR@/ardour-@VERSION@ 2> /dev/null | grep glib-2.0 | sed 's/.*=> \([^ ]*\) .*/\1/') -if [ "$GLIB" = "" ]; then +if ! type nm >/dev/null 2>&1 || [ "$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 @@ -36,26 +39,32 @@ elif [ $(nm -D --radix=dec --defined-only -S $GLIB | grep -w g_atomic_int_add | echo "" fi -exec %INSTALL_PREFIX%/%LIBDIR%/ardour2/ardour-%VERSION% "$@" +# +# Running Ardour requires these 3 variables to be set +# -## Glib atomic test +export ARDOUR_DATA_PATH=@DATADIR@ +export ARDOUR_CONFIG_PATH=@CONFDIR@ +export ARDOUR_DLL_PATH=@LIBDIR@ -GLIB=$(ldd %INSTALL_PREFIX%/%LIBDIR%/ardour3/ardour-%VERSION% 2> /dev/null | grep glib-2.0 | sed 's/.*=> \([^ ]*\) .*/\1/') +# +# NSM needs a path to this script +# -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 "" +export ARDOUR_SELF="$0" + +# +# VAMP has its own lookup path +# + +export VAMP_PATH=@LIBDIR@/vamp${VAMP_PATH:+:$VAMP_PATH} + +if [ $# -gt 0 ] ; then + case $1 in + -g|--gdb) GDB=gdb; shift ;; + esac fi -exec %INSTALL_PREFIX%/%LIBDIR%/ardour3/ardour-%VERSION% "$@" +exec $GDB @LIBDIR@/ardour-@VERSION@ "$@"