-cd `dirname "$0"`/..
+TOP=`dirname "$0"`/..
#export G_DEBUG=fatal_criticals
-export ARDOUR_PATH=.:gtk2_ardour
-export GTK_PATH=libs/clearlooks
+libs=$TOP/@LIBS@
-export ARDOUR_SURFACES_PATH=libs/surfaces/frontier:libs/surfaces/generic_midi:libs/surfaces/mackie:libs/surfaces/tranzport
+export ARDOUR_PATH=$TOP/gtk2_ardour/icons:$TOP/gtk2_ardour/pixmaps:$TOP/build/default/gtk2_ardour:$TOP/gtk2_ardour:.
+export ARDOUR_SURFACES_PATH=$libs/surfaces/osc:$libs/surfaces/generic_midi:$libs/surfaces/tranzport:$libs/surfaces/powermate:$libs/surfaces/mackie
+export ARDOUR_DATA_PATH=$TOP/gtk2_ardour:build/default/gtk2_ardour:.
-export LD_LIBRARY_PATH=libs/surfaces/control_protocol:libs/ardour:libs/midi++2:libs/pbd:libs/soundtouch:libs/gtkmm2ext:libs/sigc++2:libs/glibmm2:libs/gtkmm2/atk:libs/gtkmm2/pango:libs/gtkmm2/gdk:libs/gtkmm2/gtk:libs/libgnomecanvasmm:libs/libsndfile:libs/appleutility:libs/cairomm:$LD_LIBRARY_PATH
+if test -d $HOME/gtk/inst ; then
+ echo USING NEW CLEARLOOKS
+ export GTK_PATH=~/.ardour3:$libs/clearlooks-newer
+else
+ echo USING OLD CLEARLOOKS
+ export GTK_PATH=~/.ardour3:$libs/clearlooks-older
+fi
-# DYLD_LIBRARY_PATH is for darwin.
-export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH
-# For the internal clearlooks engine
-export GTK_PATH=$PWD/libs/clearlooks:~/.ardour2
+export VAMP_PATH=$libs/vamp-plugins:$VAMP_PATH
+
+export LD_LIBRARY_PATH=$libs/vamp-sdk:$libs/surfaces:$libs/surfaces/control_protocol:$libs/ardour:$libs/midi++2:$libs/pbd:$libs/rubberband:$libs/soundtouch:$libs/gtkmm2ext:$libs/sigc++2:$libs/glibmm2:$libs/gtkmm2/atk:$libs/gtkmm2/pango:$libs/gtkmm2/gdk:$libs/gtkmm2/gtk:$libs/libgnomecanvasmm:$libs/libsndfile:$libs/appleutility:$libs/cairomm:$libs/taglib:$libs/evoral:$libs/evoral/src/libsmf:$LD_LIBRARY_PATH
-EXECUTABLE=gtk2_ardour/ardour-%VERSION%
+# DYLD_LIBRARY_PATH is for darwin.
+export DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH
-ulimit -c unlimited
+EXECUTABLE=@EXECUTABLE@