Index: src/bin/gnucash-valgrind.in
===================================================================
--- src/bin/gnucash-valgrind.in	(revision 18551)
+++ src/bin/gnucash-valgrind.in	(working copy)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-. @-BIN_DIR-@/gnucash-setup-env
+. @-BIN_DIR-@/@-GNUCASH_SETUP_ENV_INSTALL_NAME-@
 
 TOP_SRC_DIR="@-TOP_SRC_DIR-@"
 #
@@ -19,4 +19,4 @@
     --error-limit=no \
     --tool=memcheck \
 	--leak-check=full \
-    gnucash-bin "$@"
+    @-GNUCASH_BIN_INSTALL_NAME-@ "$@"
Index: src/bin/gnucash-gdb.in
===================================================================
--- src/bin/gnucash-gdb.in	(revision 18551)
+++ src/bin/gnucash-gdb.in	(working copy)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-. @-BIN_DIR-@/gnucash-setup-env
+. @-BIN_DIR-@/@-GNUCASH_SETUP_ENV_INSTALL_NAME-@
 
-exec gdb gnucash-bin "$@"
+exec gdb @-GNUCASH_BIN_INSTALL_NAME-@ "$@"
Index: src/bin/Makefile.am
===================================================================
--- src/bin/Makefile.am	(revision 18551)
+++ src/bin/Makefile.am	(working copy)
@@ -32,17 +32,24 @@
   ${top_builddir}/src/core-utils/libgnc-core-utils.la \
   ${top_builddir}/src/gnc-module/libgnc-module.la
 
+GNUCASH_BIN_INSTALL_NAME=`echo gnucash-bin | sed -e '$(transform)'`
+GNUCASH_SETUP_ENV_INSTALL_NAME=`echo gnucash-setup-env | sed -e '$(transform)'`
+
 gnucash: gnucash.in gnucash-setup-env ${top_builddir}/config.status Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
-	    -e 's#@-BIN_DIR-@#${bindir}#g'
+	    -e 's#@-BIN_DIR-@#${bindir}#g' \
+	    -e "s#@-GNUCASH_SETUP_ENV_INSTALL_NAME-@#${GNUCASH_SETUP_ENV_INSTALL_NAME}#g" \
+	    -e "s#@-GNUCASH_BIN_INSTALL_NAME-@#${GNUCASH_BIN_INSTALL_NAME}#g"
 	mv $@.tmp $@
 	chmod u+x $@
 
 gnucash-gdb: gnucash-gdb.in gnucash-setup-env ${top_builddir}/config.status Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
-	    -e 's#@-BIN_DIR-@#${bindir}#g'
+	    -e 's#@-BIN_DIR-@#${bindir}#g' \
+	    -e "s#@-GNUCASH_SETUP_ENV_INSTALL_NAME-@#${GNUCASH_SETUP_ENV_INSTALL_NAME}#g" \
+	    -e "s#@-GNUCASH_BIN_INSTALL_NAME-@#${GNUCASH_BIN_INSTALL_NAME}#g"
 	mv $@.tmp $@
 	chmod u+x $@
 
@@ -50,7 +57,9 @@
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
 	    -e 's#@-BIN_DIR-@#${bindir}#g' \
-	    -e "s#@-TOP_SRC_DIR-@#`pwd`/${top_srcdir}#g"
+	    -e "s#@-TOP_SRC_DIR-@#`pwd`/${top_srcdir}#g" \
+	    -e "s#@-GNUCASH_SETUP_ENV_INSTALL_NAME-@#${GNUCASH_SETUP_ENV_INSTALL_NAME}#g" \
+	    -e "s#@-GNUCASH_BIN_INSTALL_NAME-@#${GNUCASH_BIN_INSTALL_NAME}#g"
 	mv $@.tmp $@
 	chmod u+x $@
 
Index: src/bin/gnucash.in
===================================================================
--- src/bin/gnucash.in	(revision 18551)
+++ src/bin/gnucash.in	(working copy)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-. @-BIN_DIR-@/gnucash-setup-env
+. @-BIN_DIR-@/@-GNUCASH_SETUP_ENV_INSTALL_NAME-@
 
-exec gnucash-bin "$@"
+exec @-GNUCASH_BIN_INSTALL_NAME-@ "$@"
