Index: gnucash-2.6.6/src/app-utils/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/app-utils/Makefile.am
+++ gnucash-2.6.6/src/app-utils/Makefile.am
@@ -222,10 +222,10 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV}) \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 
-gncscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@
+gncscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@
 gncscmcache_DATA = $(gncscm_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/app-utils/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/app-utils/Makefile.in
+++ gnucash-2.6.6/src/app-utils/Makefile.in
@@ -694,9 +694,9 @@ EXTRA_DIST = swig-app-utils-python.c app
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/engine \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/app-utils
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
-@GNC_HAVE_GUILE_2_TRUE@gncscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@
+@GNC_HAVE_GUILE_2_TRUE@gncscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@
 @GNC_HAVE_GUILE_2_TRUE@gncscmcache_DATA = $(gncscm_DATA:.scm=.go)
 CLEANFILES = \
 	${SCM_FILE_LINKS} \
Index: gnucash-2.6.6/src/business/business-gnome/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/business/business-gnome/Makefile.am
+++ gnucash-2.6.6/src/business/business-gnome/Makefile.am
@@ -144,7 +144,7 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV}) \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/business/business-gnome/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/business/business-gnome/Makefile.in
+++ gnucash-2.6.6/src/business/business-gnome/Makefile.in
@@ -639,7 +639,7 @@ EXTRA_DIST = \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/html \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/report/report-system
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 noinst_DATA = .scm-links
 CLEANFILES = \
Index: gnucash-2.6.6/src/core-utils/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/core-utils/Makefile.am
+++ gnucash-2.6.6/src/core-utils/Makefile.am
@@ -124,7 +124,7 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV})  \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/core-utils/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/core-utils/Makefile.in
+++ gnucash-2.6.6/src/core-utils/Makefile.in
@@ -593,7 +593,7 @@ gncscmmod_DATA = core-utils.scm
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/core-utils \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/libqof/qof
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 noinst_DATA = .scm-links
 BUILT_SOURCES = gncla-dir.h gnc-version.h
Index: gnucash-2.6.6/src/engine/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/engine/Makefile.am
+++ gnucash-2.6.6/src/engine/Makefile.am
@@ -201,10 +201,10 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV}) \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 
-gncscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@
+gncscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@
 gncscmcache_DATA = $(gncscm_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/engine/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/engine/Makefile.in
+++ gnucash-2.6.6/src/engine/Makefile.in
@@ -722,9 +722,9 @@ EXTRA_DIST = \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/core-utils \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/libqof/qof
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
-@GNC_HAVE_GUILE_2_TRUE@gncscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@
+@GNC_HAVE_GUILE_2_TRUE@gncscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@
 @GNC_HAVE_GUILE_2_TRUE@gncscmcache_DATA = $(gncscm_DATA:.scm=.go)
 noinst_DATA = .scm-links
 
Index: gnucash-2.6.6/src/gnc-module/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/gnc-module/Makefile.am
+++ gnucash-2.6.6/src/gnc-module/Makefile.am
@@ -77,7 +77,7 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV}) \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/gnc-module/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/gnc-module/Makefile.in
+++ gnucash-2.6.6/src/gnc-module/Makefile.in
@@ -539,7 +539,7 @@ EXTRA_DIST = \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/core-utils \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/libqof/qof
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 CLEANFILES = .scm-links ${SCM_FILE_LINKS} ${gncscmmodcache_DATA}
 MAINTAINERCLEANFILES = swig-gnc-module.c
Index: gnucash-2.6.6/src/gnome-utils/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/gnome-utils/Makefile.am
+++ gnucash-2.6.6/src/gnome-utils/Makefile.am
@@ -293,10 +293,10 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV}) \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 
-gncscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@
+gncscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@
 gncscmcache_DATA = $(gncscm_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/gnome-utils/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/gnome-utils/Makefile.in
+++ gnucash-2.6.6/src/gnome-utils/Makefile.in
@@ -782,9 +782,9 @@ EXTRA_DIST = \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/backend/xml \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/gnome-utils
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
-@GNC_HAVE_GUILE_2_TRUE@gncscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@
+@GNC_HAVE_GUILE_2_TRUE@gncscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@
 @GNC_HAVE_GUILE_2_TRUE@gncscmcache_DATA = $(gncscm_DATA:.scm=.go)
 noinst_DATA = .scm-links
 CLEANFILES = \
Index: gnucash-2.6.6/src/import-export/qif-imp/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/import-export/qif-imp/Makefile.am
+++ gnucash-2.6.6/src/import-export/qif-imp/Makefile.am
@@ -128,10 +128,10 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV}) \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/import-export
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/import-export
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 
-gncscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/qif-import
+gncscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/qif-import
 gncscmcache_DATA = $(gncscm_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/import-export/qif-imp/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/import-export/qif-imp/Makefile.in
+++ gnucash-2.6.6/src/import-export/qif-imp/Makefile.in
@@ -611,9 +611,9 @@ noinst_DATA = .scm-links
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/register/ledger-core \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/gnome-search
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/import-export
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/import-export
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
-@GNC_HAVE_GUILE_2_TRUE@gncscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/qif-import
+@GNC_HAVE_GUILE_2_TRUE@gncscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/qif-import
 @GNC_HAVE_GUILE_2_TRUE@gncscmcache_DATA = $(gncscm_DATA:.scm=.go)
 DISTCLEANFILES = ${SCM_FILE_LINKS}
 all: all-recursive
Index: gnucash-2.6.6/src/report/business-reports/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/report/business-reports/Makefile.am
+++ gnucash-2.6.6/src/report/business-reports/Makefile.am
@@ -77,7 +77,7 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV}) \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/report/business-reports/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/report/business-reports/Makefile.in
+++ gnucash-2.6.6/src/report/business-reports/Makefile.in
@@ -464,7 +464,7 @@ gncscmtpl_DATA = \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/gnc-module \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/report/report-system
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 noinst_DATA = .scm-links
 EXTRA_DIST = \
Index: gnucash-2.6.6/src/report/locale-specific/us/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/report/locale-specific/us/Makefile.am
+++ gnucash-2.6.6/src/report/locale-specific/us/Makefile.am
@@ -84,10 +84,10 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV}) \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 
-gncscmrptcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report/locale-specific
+gncscmrptcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report/locale-specific
 gncscmrptcache_DATA = $(gncscmrpt_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/report/locale-specific/us/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/report/locale-specific/us/Makefile.in
+++ gnucash-2.6.6/src/report/locale-specific/us/Makefile.in
@@ -565,9 +565,9 @@ gncscmmod_DATA = taxtxf.scm taxtxf-de_DE
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/html \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/report/report-system
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
-@GNC_HAVE_GUILE_2_TRUE@gncscmrptcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report/locale-specific
+@GNC_HAVE_GUILE_2_TRUE@gncscmrptcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report/locale-specific
 @GNC_HAVE_GUILE_2_TRUE@gncscmrptcache_DATA = $(gncscmrpt_DATA:.scm=.go)
 noinst_DATA = .scm-links
 EXTRA_DIST = \
Index: gnucash-2.6.6/src/report/report-gnome/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/report/report-gnome/Makefile.am
+++ gnucash-2.6.6/src/report/report-gnome/Makefile.am
@@ -132,7 +132,7 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV}) \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/report/report-gnome/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/report/report-gnome/Makefile.in
+++ gnucash-2.6.6/src/report/report-gnome/Makefile.in
@@ -605,7 +605,7 @@ EXTRA_DIST = \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/report/report-system \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/report/report-gnome
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 CLEANFILES = report .scm-links ${SCM_FILE_LINKS} ${gncscmmodcache_DATA}
 MAINTAINERCLEANFILES = swig-report-gnome.c
Index: gnucash-2.6.6/src/report/report-system/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/report/report-system/Makefile.am
+++ gnucash-2.6.6/src/report/report-system/Makefile.am
@@ -137,13 +137,13 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV}) \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 
-gncmodscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report/report-system
+gncmodscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report/report-system
 gncmodscmcache_DATA = $(gncmodscm_DATA:.scm=.go)
 
-gncscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@
+gncscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@
 gncscmcache_DATA = $(gncscm_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/report/report-system/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/report/report-system/Makefile.in
+++ gnucash-2.6.6/src/report/report-system/Makefile.in
@@ -611,11 +611,11 @@ gncscmmod_DATA = \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/html \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/report/report-system
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
-@GNC_HAVE_GUILE_2_TRUE@gncmodscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report/report-system
+@GNC_HAVE_GUILE_2_TRUE@gncmodscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report/report-system
 @GNC_HAVE_GUILE_2_TRUE@gncmodscmcache_DATA = $(gncmodscm_DATA:.scm=.go)
-@GNC_HAVE_GUILE_2_TRUE@gncscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@
+@GNC_HAVE_GUILE_2_TRUE@gncscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@
 @GNC_HAVE_GUILE_2_TRUE@gncscmcache_DATA = $(gncscm_DATA:.scm=.go)
 noinst_DATA = .scm-links
 EXTRA_DIST = report-system.i ${gncscmmod_DATA} ${gncscm_DATA} ${gncmodscm_DATA}
Index: gnucash-2.6.6/src/report/standard-reports/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/report/standard-reports/Makefile.am
+++ gnucash-2.6.6/src/report/standard-reports/Makefile.am
@@ -105,10 +105,10 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV}) \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 
-gncscmrptcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report/standard-reports
+gncscmrptcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report/standard-reports
 gncscmrptcache_DATA = $(gncscmrpt_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/report/standard-reports/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/report/standard-reports/Makefile.in
+++ gnucash-2.6.6/src/report/standard-reports/Makefile.in
@@ -583,9 +583,9 @@ gncscmrpt_DATA = \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/html \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/report/report-system
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
-@GNC_HAVE_GUILE_2_TRUE@gncscmrptcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report/standard-reports
+@GNC_HAVE_GUILE_2_TRUE@gncscmrptcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report/standard-reports
 @GNC_HAVE_GUILE_2_TRUE@gncscmrptcache_DATA = $(gncscmrpt_DATA:.scm=.go)
 noinst_DATA = .scm-links
 EXTRA_DIST = \
Index: gnucash-2.6.6/src/report/stylesheets/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/report/stylesheets/Makefile.am
+++ gnucash-2.6.6/src/report/stylesheets/Makefile.am
@@ -92,7 +92,7 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV}) \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/report/stylesheets/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/report/stylesheets/Makefile.in
+++ gnucash-2.6.6/src/report/stylesheets/Makefile.in
@@ -577,7 +577,7 @@ gncscmmod_DATA = \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/html \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/report/report-system
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 noinst_DATA = .scm-links
 uidir = $(GNC_UI_DIR)
Index: gnucash-2.6.6/src/report/utility-reports/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/report/utility-reports/Makefile.am
+++ gnucash-2.6.6/src/report/utility-reports/Makefile.am
@@ -77,7 +77,7 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV}) \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/report/utility-reports/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/report/utility-reports/Makefile.in
+++ gnucash-2.6.6/src/report/utility-reports/Makefile.in
@@ -560,7 +560,7 @@ gncscmmod_DATA = \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/html \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/report/report-system
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/report
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 noinst_DATA = .scm-links
 EXTRA_DIST = ${gncscmmod_DATA}
Index: gnucash-2.6.6/src/scm/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/scm/Makefile.am
+++ gnucash-2.6.6/src/scm/Makefile.am
@@ -55,10 +55,10 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV}) \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 
-gncscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@
+gncscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@
 gncscmcache_DATA = $(gncscm_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/scm/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/scm/Makefile.in
+++ gnucash-2.6.6/src/scm/Makefile.in
@@ -499,9 +499,9 @@ config_DATA = config
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/gnc-module \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/libqof/qof
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
-@GNC_HAVE_GUILE_2_TRUE@gncscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@
+@GNC_HAVE_GUILE_2_TRUE@gncscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@
 @GNC_HAVE_GUILE_2_TRUE@gncscmcache_DATA = $(gncscm_DATA:.scm=.go)
 SCM_FILES = ${gncscm_DATA} ${gncscmmod_DATA}
 EXTRA_DIST = \
Index: gnucash-2.6.6/src/scm/gnumeric/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/scm/gnumeric/Makefile.am
+++ gnucash-2.6.6/src/scm/gnumeric/Makefile.am
@@ -24,7 +24,7 @@ if GNC_HAVE_GUILE_2
 	$(GUILD) compile \
 	-o $@ $<
 
-gncscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnumeric
+gncscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnumeric
 gncscmcache_DATA = $(gncscm_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/scm/gnumeric/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/scm/gnumeric/Makefile.in
+++ gnucash-2.6.6/src/scm/gnumeric/Makefile.in
@@ -416,7 +416,7 @@ gncscm_DATA = \
 @GNUCASH_SEPARATE_BUILDDIR_TRUE@SCM_FILE_LINKS = \
 @GNUCASH_SEPARATE_BUILDDIR_TRUE@  ${gncscm_DATA}
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnumeric
+@GNC_HAVE_GUILE_2_TRUE@gncscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnumeric
 @GNC_HAVE_GUILE_2_TRUE@gncscmcache_DATA = $(gncscm_DATA:.scm=.go)
 noinst_DATA = .scm-links
 EXTRA_DIST = \
Index: gnucash-2.6.6/src/tax/us/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/tax/us/Makefile.am
+++ gnucash-2.6.6/src/tax/us/Makefile.am
@@ -64,10 +64,10 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV}) \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/tax
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/tax
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 
-gncscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@
+gncscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@
 gncscmcache_DATA = $(gncscm_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/tax/us/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/tax/us/Makefile.in
+++ gnucash-2.6.6/src/tax/us/Makefile.in
@@ -546,9 +546,9 @@ gncscm_DATA = txf.scm txf-help.scm txf-d
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/core-utils \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/gnc-module
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/tax
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash/tax
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
-@GNC_HAVE_GUILE_2_TRUE@gncscmcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@
+@GNC_HAVE_GUILE_2_TRUE@gncscmcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@
 @GNC_HAVE_GUILE_2_TRUE@gncscmcache_DATA = $(gncscm_DATA:.scm=.go)
 noinst_DATA = .scm-links
 EXTRA_DIST = \
Index: gnucash-2.6.6/src/test-core/Makefile.am
===================================================================
--- gnucash-2.6.6.orig/src/test-core/Makefile.am
+++ gnucash-2.6.6/src/test-core/Makefile.am
@@ -109,7 +109,7 @@ GUILE_COMPILE_ENV = \
 	$(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GUILE_COMPILE_ENV}) \
 	$(GUILD) compile -o $@ $<
 
-gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
+gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
 gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 endif
 
Index: gnucash-2.6.6/src/test-core/Makefile.in
===================================================================
--- gnucash-2.6.6.orig/src/test-core/Makefile.in
+++ gnucash-2.6.6/src/test-core/Makefile.in
@@ -553,7 +553,7 @@ SCM_FILES = $(gncscmmod_DATA)
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/test-core \
 @GNC_HAVE_GUILE_2_TRUE@  --library-dir    ${top_builddir}/src/libqof/qof
 
-@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${GNC_SCM_INSTALL_DIR}/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
+@GNC_HAVE_GUILE_2_TRUE@gncscmmodcachedir = ${pkglibdir}/scm/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
 @GNC_HAVE_GUILE_2_TRUE@gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
 noinst_DATA = .scm-links
 CLEANFILES = .scm-links ${gncscmmodcache_DATA}
Index: gnucash-2.6.6/src/bin/environment.in
===================================================================
--- gnucash-2.6.6.orig/src/bin/environment.in
+++ gnucash-2.6.6/src/bin/environment.in
@@ -53,7 +53,7 @@ GUILE_WARN_DEPRECATED=no
 # GUILE_LIBS=
 # GUILE_COMPILED_LIBS=
 GUILE_LOAD_PATH={GNC_DATA}/scm;{GUILE_LIBS};{GUILE_LOAD_PATH}
-GUILE_LOAD_COMPILED_PATH={GNC_DATA}/scm/ccache/@-GUILE_EFFECTIVE_VERSION-@;{GUILE_COMPILED_LIBS};{GUILE_LOAD_COMPILED_PATH}
+GUILE_LOAD_COMPILED_PATH={GNC_LIB}/scm/ccache/@-GUILE_EFFECTIVE_VERSION-@;{GUILE_COMPILED_LIBS};{GUILE_LOAD_COMPILED_PATH}
 
 # Tell Guile where to find GnuCash specific shared libraries
 GNC_LIBRARY_PATH={SYS_LIB};{GNC_LIB}
