From be0e3581c248c0e4476e8ea550588070d28e407c Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Thu, 30 Oct 2014 17:54:36 +0100 Subject: [PATCH] Guile 2 pre-compilation improvements 1. Tell the engine to look in the build dir for the backend modules Guile compilation loads the engine libraries for some guile modules. This triggers the engine initialization code which tries to load the xml backend module and optionally the dbi module as well. By default it looks for these modules in the installed directory but during build they are not installed yet, so use a few environment variables to tell the engine to look in the build dir instead. 2. Wait for the c library to be linked before attempting to compile the guile files. Some guile files need the library to be available. Note that neither fix is necessary for all directories that has scheme files to compile. For consistency between makefiles, I have chosen to add them to all, which won't hurt. --- src/app-utils/Makefile.am | 4 +++- src/business/business-gnome/Makefile.am | 4 +++- src/core-utils/Makefile.am | 4 +++- src/engine/Makefile.am | 4 +++- src/gnc-module/Makefile.am | 4 +++- src/gnome-utils/Makefile.am | 4 +++- src/import-export/qif-imp/Makefile.am | 4 +++- src/report/business-reports/Makefile.am | 5 ++++- src/report/locale-specific/us/Makefile.am | 4 +++- src/report/report-gnome/Makefile.am | 4 +++- src/report/report-system/Makefile.am | 4 +++- src/report/standard-reports/Makefile.am | 4 +++- src/report/stylesheets/Makefile.am | 4 +++- src/report/utility-reports/Makefile.am | 6 +++++- src/tax/us/Makefile.am | 4 +++- src/test-core/Makefile.am | 4 +++- 16 files changed, 51 insertions(+), 16 deletions(-) diff --git a/src/app-utils/Makefile.am b/src/app-utils/Makefile.am index 2425e27334..4800aff3aa 100644 --- a/src/app-utils/Makefile.am +++ b/src/app-utils/Makefile.am @@ -214,7 +214,9 @@ GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/core-utils \ --library-dir ${top_builddir}/src/gnc-module -%.go : %.scm .scm-links +%.go : %.scm .scm-links $(pkglib_LTLIBRARIES) + GNC_UNINSTALLED=yes \ + GNC_BUILDDIR=${top_builddir} \ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \ $(GUILD) compile -o $@ $< diff --git a/src/business/business-gnome/Makefile.am b/src/business/business-gnome/Makefile.am index 759c22169c..760cfe8aa7 100644 --- a/src/business/business-gnome/Makefile.am +++ b/src/business/business-gnome/Makefile.am @@ -130,7 +130,9 @@ GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/core-utils \ --library-dir ${top_builddir}/src/gnc-module -%.go : %.scm .scm-links +%.go : %.scm .scm-links $(pkglib_LTLIBRARIES) + GNC_UNINSTALLED=yes \ + GNC_BUILDDIR=${top_builddir} \ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \ $(GUILD) compile -o $@ $< diff --git a/src/core-utils/Makefile.am b/src/core-utils/Makefile.am index d412f2d3c0..c63d1954a5 100644 --- a/src/core-utils/Makefile.am +++ b/src/core-utils/Makefile.am @@ -116,7 +116,9 @@ if GNC_HAVE_GUILE_2 GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/core-utils -%.go : %.scm .scm-links +%.go : %.scm .scm-links $(pkglib_LTLIBRARIES) + GNC_UNINSTALLED=yes \ + GNC_BUILDDIR=${top_builddir} \ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \ $(GUILD) compile -o $@ $< diff --git a/src/engine/Makefile.am b/src/engine/Makefile.am index 723ce48e79..3c6b480b26 100644 --- a/src/engine/Makefile.am +++ b/src/engine/Makefile.am @@ -196,7 +196,9 @@ GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/engine \ --library-dir ${top_builddir}/src/gnc-module -%.go : %.scm .scm-links +%.go : %.scm .scm-links $(pkglib_LTLIBRARIES) + GNC_UNINSTALLED=yes \ + GNC_BUILDDIR=${top_builddir} \ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \ $(GUILD) compile -o $@ $< diff --git a/src/gnc-module/Makefile.am b/src/gnc-module/Makefile.am index 5e9819cf43..17e96a3623 100644 --- a/src/gnc-module/Makefile.am +++ b/src/gnc-module/Makefile.am @@ -69,7 +69,9 @@ if GNC_HAVE_GUILE_2 GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/gnc-module -%.go : %.scm .scm-links +%.go : %.scm .scm-links $(pkglib_LTLIBRARIES) + GNC_UNINSTALLED=yes \ + GNC_BUILDDIR=${top_builddir} \ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \ $(GUILD) compile -o $@ $< diff --git a/src/gnome-utils/Makefile.am b/src/gnome-utils/Makefile.am index 2b02800457..8959df0bca 100644 --- a/src/gnome-utils/Makefile.am +++ b/src/gnome-utils/Makefile.am @@ -283,7 +283,9 @@ GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/gnc-module \ --library-dir ${top_builddir}/src/gnome-utils -%.go : %.scm .scm-links +%.go : %.scm .scm-links $(pkglib_LTLIBRARIES) + GNC_UNINSTALLED=yes \ + GNC_BUILDDIR=${top_builddir} \ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \ $(GUILD) compile -o $@ $< diff --git a/src/import-export/qif-imp/Makefile.am b/src/import-export/qif-imp/Makefile.am index 7bfe27b1fe..1e78cd21e2 100644 --- a/src/import-export/qif-imp/Makefile.am +++ b/src/import-export/qif-imp/Makefile.am @@ -108,7 +108,9 @@ GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/gnome \ --library-dir ${top_builddir}/src/gnc-module -%.go : %.scm .scm-links +%.go : %.scm .scm-links $(pkglib_LTLIBRARIES) + GNC_UNINSTALLED=yes \ + GNC_BUILDDIR=${top_builddir} \ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \ $(GUILD) compile -o $@ $< diff --git a/src/report/business-reports/Makefile.am b/src/report/business-reports/Makefile.am index c5f167ebcc..f2548bf580 100644 --- a/src/report/business-reports/Makefile.am +++ b/src/report/business-reports/Makefile.am @@ -50,6 +50,7 @@ GUILE_COMPILE_ENV = \ --gnc-module-dir ${top_builddir}/src/gnome-utils \ --gnc-module-dir ${top_builddir}/src/html \ --gnc-module-dir ${top_builddir}/src/report/report-system \ + --gnc-module-dir ${top_builddir}/src/report/standard-reports \ --guile-load-dir ${top_builddir}/src/app-utils \ --guile-load-dir ${top_builddir}/src/core-utils \ --guile-load-dir ${top_builddir}/src/engine \ @@ -62,7 +63,9 @@ GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/core-utils \ --library-dir ${top_builddir}/src/gnc-module -%.go : %.scm .scm-links +%.go : %.scm .scm-links $(pkglib_LTLIBRARIES) + GNC_UNINSTALLED=yes \ + GNC_BUILDDIR=${top_builddir} \ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \ $(GUILD) compile -o $@ $< diff --git a/src/report/locale-specific/us/Makefile.am b/src/report/locale-specific/us/Makefile.am index 1fb4dc830b..7284e91a6f 100644 --- a/src/report/locale-specific/us/Makefile.am +++ b/src/report/locale-specific/us/Makefile.am @@ -72,7 +72,9 @@ GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/gnc-module \ --library-dir ${top_builddir}/src/gnome-utils -%.go : %.scm .scm-links +%.go : %.scm .scm-links $(pkglib_LTLIBRARIES) + GNC_UNINSTALLED=yes \ + GNC_BUILDDIR=${top_builddir} \ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \ $(GUILD) compile -o $@ $< diff --git a/src/report/report-gnome/Makefile.am b/src/report/report-gnome/Makefile.am index ee65689319..4d55c9670a 100644 --- a/src/report/report-gnome/Makefile.am +++ b/src/report/report-gnome/Makefile.am @@ -120,7 +120,9 @@ GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/gnome-utils \ --library-dir ${top_builddir}/src/report/report-gnome -%.go : %.scm .scm-links +%.go : %.scm .scm-links $(pkglib_LTLIBRARIES) + GNC_UNINSTALLED=yes \ + GNC_BUILDDIR=${top_builddir} \ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \ $(GUILD) compile -o $@ $< diff --git a/src/report/report-system/Makefile.am b/src/report/report-system/Makefile.am index d0f0f809a0..8f103cc561 100644 --- a/src/report/report-system/Makefile.am +++ b/src/report/report-system/Makefile.am @@ -125,7 +125,9 @@ GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/gnc-module \ --library-dir ${top_builddir}/src/report/report-system -%.go : %.scm .scm-links +%.go : %.scm .scm-links $(pkglib_LTLIBRARIES) + GNC_UNINSTALLED=yes \ + GNC_BUILDDIR=${top_builddir} \ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \ $(GUILD) compile -o $@ $< diff --git a/src/report/standard-reports/Makefile.am b/src/report/standard-reports/Makefile.am index 3c540bcbf4..b940b52243 100644 --- a/src/report/standard-reports/Makefile.am +++ b/src/report/standard-reports/Makefile.am @@ -93,7 +93,9 @@ GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/gnc-module \ --library-dir ${top_builddir}/src/report/report-system -%.go : %.scm .scm-links +%.go : %.scm .scm-links $(pkglib_LTLIBRARIES) + GNC_UNINSTALLED=yes \ + GNC_BUILDDIR=${top_builddir} \ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \ $(GUILD) compile -o $@ $< diff --git a/src/report/stylesheets/Makefile.am b/src/report/stylesheets/Makefile.am index ecc1af6284..9882f0ca24 100644 --- a/src/report/stylesheets/Makefile.am +++ b/src/report/stylesheets/Makefile.am @@ -80,7 +80,9 @@ GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/gnc-module \ --library-dir ${top_builddir}/src/gnome-utils -%.go : %.scm .scm-links +%.go : %.scm .scm-links $(pkglib_LTLIBRARIES) + GNC_UNINSTALLED=yes \ + GNC_BUILDDIR=${top_builddir} \ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \ $(GUILD) compile -o $@ $< diff --git a/src/report/utility-reports/Makefile.am b/src/report/utility-reports/Makefile.am index cb0dcdc1fd..003fdac6ad 100644 --- a/src/report/utility-reports/Makefile.am +++ b/src/report/utility-reports/Makefile.am @@ -50,12 +50,14 @@ if GNC_HAVE_GUILE_2 GUILE_COMPILE_ENV = \ --gnc-module-dir ${top_builddir}/src/app-utils \ --gnc-module-dir ${top_builddir}/src/engine \ + --gnc-module-dir ${top_builddir}/src/gnome-utils \ --gnc-module-dir ${top_builddir}/src/html \ --gnc-module-dir ${top_builddir}/src/report/report-system \ --guile-load-dir ${top_builddir}/src/app-utils \ --guile-load-dir ${top_builddir}/src/core-utils \ --guile-load-dir ${top_builddir}/src/engine \ --guile-load-dir ${top_builddir}/src/gnc-module \ + --guile-load-dir ${top_builddir}/src/gnome-utils \ --guile-load-dir ${top_builddir}/src/report/report-system \ --guile-load-dir ${top_builddir}/src/scm \ --library-dir ${top_builddir}/src/app-utils \ @@ -63,7 +65,9 @@ GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/gnc-module \ --library-dir ${top_builddir}/src/report/report-system -%.go : %.scm .scm-links +%.go : %.scm .scm-links $(pkglib_LTLIBRARIES) + GNC_UNINSTALLED=yes \ + GNC_BUILDDIR=${top_builddir} \ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \ $(GUILD) compile -o $@ $< diff --git a/src/tax/us/Makefile.am b/src/tax/us/Makefile.am index 0b75b98520..bdfd0c7b51 100644 --- a/src/tax/us/Makefile.am +++ b/src/tax/us/Makefile.am @@ -56,7 +56,9 @@ GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/core-utils \ --library-dir ${top_builddir}/src/gnc-module -%.go : %.scm .scm-links +%.go : %.scm .scm-links $(pkglib_LTLIBRARIES) + GNC_UNINSTALLED=yes \ + GNC_BUILDDIR=${top_builddir} \ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \ $(GUILD) compile -o $@ $< diff --git a/src/test-core/Makefile.am b/src/test-core/Makefile.am index 0aea4c637b..65da7f0abf 100644 --- a/src/test-core/Makefile.am +++ b/src/test-core/Makefile.am @@ -101,7 +101,9 @@ if GNC_HAVE_GUILE_2 GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/test-core -%.go : %.scm .scm-links +%.go : %.scm .scm-links $(pkglib_LTLIBRARIES) + GNC_UNINSTALLED=yes \ + GNC_BUILDDIR=${top_builddir} \ $(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \ $(GUILD) compile -o $@ $<