@LIBDIR@ apparently now includes @INSTALL_PREFIX@, so just use that on its own (...
[ardour.git] / gtk2_ardour / ardour.sh.in
1 #!/bin/sh
2
3 export GTK_PATH=@LIBDIR@/ardour3${GTK_PATH:+:$GTK_PATH}
4
5 export LD_LIBRARY_PATH=@LIBDIR@/ardour3${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
6 # DYLD_LIBRARY_PATH is for Darwin
7 export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH
8
9 ## Memlock check
10
11 MLOCK_LIMIT=$(ulimit -l)
12 if [ "$MLOCK_LIMIT" != "unlimited" ]; then
13         echo "WARNING: Your system has a limit for maximum amount of locked memory!"
14         echo "         This might cause Ardour to run out of memory before your system runs"
15         echo "         out of memory. You can view the memory limit with 'ulimit -l', and it"
16         echo "         is normally controlled by /etc/security/limits.conf"
17         echo ""
18
19 fi
20
21 ## Glib atomic test
22
23 GLIB=$(ldd @LIBDIR@/ardour3/ardour-@VERSION@ 2> /dev/null | grep glib-2.0 | sed 's/.*=> \([^ ]*\) .*/\1/')
24
25 if [ "$GLIB" = "" ]; then
26         echo "WARNING: Could not check your glib-2.0 for mutex locking atomic operations."
27         echo ""
28 elif [ $(nm -D --radix=dec --defined-only -S $GLIB | grep -w g_atomic_int_add | cut -d ' ' -f 2) -gt 32 ]; then
29         echo "WARNING: Your system contains a suspect libglib-2.0. Your version might be built"
30         echo "         to use mutex locking atomic operations. This is a fallback solution to"
31         echo "         a more robust hardware supported atomicity. It might cause reduced "
32         echo "         performance and/or deadlocks. Please contact your distribution support"
33         echo "         about this issue."
34         echo "         Unfortunately this check is not 100% accurate, so this might not be"
35         echo "         the case with your system."
36         echo ""
37 fi
38
39 exec @LIBDIR@/ardour3/ardour-@VERSION@ "$@"
40
41