Build and run in separate directory

Mike Alexander mta at umich.edu
Wed Feb 8 03:19:42 EST 2006


If you try to build gnucash in a directory other than the source 
directory you get a couple of build errors.  If you try to run from 
that directory, it doesn't work quite right either.  It is probably 
better to use an lndir directory for building, but if you don't want to 
do this, the attached patch fixes some of the problems related to 
building and running in a separate directory.  It still uses some 
things from the install tree when running from the build directory, and 
won't work right if you've never installed it, but these patches help 
some.  I'm sending them here since I didn't think this was worth a bug 
report.

-- 
Mike Alexander           mta at umich.edu
Ann Arbor, MI            PGP key ID: BEA343A6
-------------- next part --------------
        * configure.in:
        * intl-scm/Makefile.am:
        * lib/guile-www/Makefile.am:
        * src/app-utils/Makefile.am:
        * src/business/business-gnome/Makefile.am:
        * src/business/business-reports/Makefile.am:
        * src/business/business-utils/Makefile.am:
        * src/business/dialog-tax-table/Makefile.am:
        * src/engine/Makefile.am:
        * src/gnome-utils/Makefile.am:
        * src/import-export/Makefile.am:
        * src/import-export/qif-import/Makefile.am:
        * src/import-export/qif-io-core/Makefile.am:
        * src/report/report-gnome/Makefile.am:
        * src/report/report-system/Makefile.am:
        * src/report/standard-reports/Makefile.am:
        * src/report/stylesheets/Makefile.am:
        * src/report/utility-reports/Makefile.am:
        * src/scm/gnumeric/Makefile.am:
        * src/scm/Makefile.am:
        * src/scm/printing/Makefile.am:
        * src/tax/us/Makefile.am:
          Make the build work if the build directory is not the source
          directory.  Also symlink .scm files into the build directory
          so it's possible to run from it.
          
Index: configure.in
===================================================================
--- configure.in	(revision 13074)
+++ configure.in	(working copy)
@@ -453,7 +453,7 @@
 fi
 if test x$QOF_XML_DIR = x; then
 	QOF_LIB_DIR='${libdir}'
-	QOF_CFLAGS='-I${top_srcdir}/lib/libqof/qof'
+	QOF_CFLAGS='-I${top_srcdir}/lib/libqof/qof -I${top_builddir}/lib/libqof/qof'
 	QOF_LIBS='${top_builddir}/lib/libqof/qof/libqof.la'
 	QOF_VERSION="internal"
 	QOF_PREFIX="internal"
Index: intl-scm/Makefile.am
===================================================================
--- intl-scm/Makefile.am	(revision 13074)
+++ intl-scm/Makefile.am	(working copy)
@@ -8,7 +8,7 @@
 
 BUILT_SOURCES = guile-strings.c
 
-SCMFILES = $(shell find ${top_srcdir}/src -name test -prune -o -name '*.scm' -print )
+SCMFILES = $(shell cd ${srcdir} && find ../src -name test -prune -o -name '*.scm' -print )
 
 # This needs to be generated in srcdir
 guile-strings.c: $(SCMFILES)
Index: lib/guile-www/Makefile.am
===================================================================
--- lib/guile-www/Makefile.am	(revision 13074)
+++ lib/guile-www/Makefile.am	(working copy)
@@ -10,10 +10,20 @@
 
 noinst_DATA = .scm-links
 
+if GNUCASH_SEPARATE_BUILDDIR
+SCM_FILE_LINKS = cgi.scm http.scm main.scm url.scm
+endif
+
 .scm-links: 
 	rm -f www
 	ln -sf . www
+if GNUCASH_SEPARATE_BUILDDIR
+	for X in ${SCM_FILE_LINKS} ; do \
+	  ln -sf ${srcdir}/$$X . ; \
+	done
+endif
 	touch .scm-links
+
 CLEANFILES = www .scm-links
 
 endif # GNC_HAVE_GUILE_WWW (else clause)
Index: src/app-utils/Makefile.am
===================================================================
--- src/app-utils/Makefile.am	(revision 13074)
+++ src/app-utils/Makefile.am	(working copy)
@@ -107,7 +107,15 @@
 #For compiling
 SCM_FILE_LINKS = gw-app-utils-spec.scm
 #For executing test cases
-SCM_FILE_LINKS += app-utils.scm
+SCM_FILE_LINKS += app-utils.scm \
+  c-interface.scm \
+  config-var.scm \
+  date-utilities.scm \
+  hooks.scm \
+  kvp-option-registry.scm \
+  options.scm \
+  prefs.scm \
+  simple-obj.scm
 endif
 
 .scm-links: 
Index: src/business/business-gnome/Makefile.am
===================================================================
--- src/business/business-gnome/Makefile.am	(revision 13074)
+++ src/business/business-gnome/Makefile.am	(working copy)
@@ -104,7 +104,7 @@
 
 if GNUCASH_SEPARATE_BUILDDIR
 #Only needed when srcdir and builddir are different
-SCM_FILE_LINKS = gw-business-gnome-spec.scm
+SCM_FILE_LINKS = gw-business-gnome-spec.scm business-gnome.scm
 endif
 
 .scm-links: 
Index: src/business/business-reports/Makefile.am
===================================================================
--- src/business/business-reports/Makefile.am	(revision 13074)
+++ src/business/business-reports/Makefile.am	(working copy)
@@ -1,3 +1,15 @@
+if GNUCASH_SEPARATE_BUILDDIR
+SCM_FILE_LINKS = \
+   business-reports.scm \
+   aging.scm \
+   easy-invoice.scm \
+   fancy-invoice.scm \
+   payables.scm \
+   receivables.scm \
+   invoice.scm \
+   owner-report.scm
+endif
+
 .scm-links:
 	rm -f gnucash report
 	ln -sf . gnucash
@@ -2,2 +14,7 @@
 	ln -sf ${srcdir} report 
+if GNUCASH_SEPARATE_BUILDDIR
+	for X in ${SCM_FILE_LINKS} ; do \
+	  ln -sf ${srcdir}/$$X . ; \
+	done
+endif
 	touch .scm-links
Index: src/business/business-utils/Makefile.am
===================================================================
--- src/business/business-utils/Makefile.am	(revision 13074)
+++ src/business/business-utils/Makefile.am	(working copy)
@@ -41,9 +41,20 @@
 
 noinst_DATA = .scm-links
 
+if GNUCASH_SEPARATE_BUILDDIR
+SCM_FILE_LINKS = business-utils.scm \
+  business-options.scm \
+  business-prefs.scm
+endif
+
 .scm-links: 
 	rm -f gnucash
 	ln -sf ${srcdir} gnucash 
+if GNUCASH_SEPARATE_BUILDDIR
+	for X in ${SCM_FILE_LINKS} ; do \
+	  ln -sf ${srcdir}/$$X . ; \
+	done
+endif
 	touch .scm-links
 
 DISTCLEANFILES = gnucash .scm-links
Index: src/business/dialog-tax-table/Makefile.am
===================================================================
--- src/business/dialog-tax-table/Makefile.am	(revision 13074)
+++ src/business/dialog-tax-table/Makefile.am	(working copy)
@@ -61,7 +61,7 @@
 
 if GNUCASH_SEPARATE_BUILDDIR
 #Only needed when srcdir and builddir are different
-SCM_FILE_LINKS = gw-dialog-tax-table-spec.scm
+SCM_FILE_LINKS = gw-dialog-tax-table-spec.scm dialog-tax-table.scm
 endif
 
 .scm-links: 
Index: src/engine/Makefile.am
===================================================================
--- src/engine/Makefile.am	(revision 13074)
+++ src/engine/Makefile.am	(working copy)
@@ -151,7 +151,12 @@
 #For compiling
 SCM_FILE_LINKS = gw-engine-spec.scm gw-kvp-spec.scm iso-4217-currencies.scm
 #For executing test cases
-SCM_FILE_LINKS += engine.scm
+SCM_FILE_LINKS += \
+  commodity-table.scm \
+  engine.scm \
+  engine-interface.scm \
+  engine-utilities.scm \
+  gnc-numeric.scm
 endif
 
 .scm-links: 
Index: src/gnome-utils/Makefile.am
===================================================================
--- src/gnome-utils/Makefile.am	(revision 13074)
+++ src/gnome-utils/Makefile.am	(working copy)
@@ -278,7 +278,7 @@
 #For compiling
 SCM_FILE_LINKS = gw-gnome-utils-spec.scm
 #For executing test cases
-SCM_FILE_LINKS += gnome-utils-spec.scm gnome-utils.scm
+SCM_FILE_LINKS += gnc-menu-extensions.scm gnome-utils.scm
 endif
 
 .scm-links: 
Index: src/import-export/Makefile.am
===================================================================
--- src/import-export/Makefile.am	(revision 13074)
+++ src/import-export/Makefile.am	(working copy)
@@ -88,6 +88,11 @@
 	ln -sf . gnucash
 	ln -sf . generic-import
 	ln -sf . g-wrapped
+if GNUCASH_SEPARATE_BUILDDIR
+	for X in ${SCM_FILE_LINKS} ; do \
+	  ln -sf ${srcdir}/$$X . ; \
+	done
+endif
 	touch .scm-links
 
 DISTCLEANFILES = gnucash generic-import g-wrapped .scm-links import-export
Index: src/import-export/qif-import/Makefile.am
===================================================================
--- src/import-export/qif-import/Makefile.am	(revision 13074)
+++ src/import-export/qif-import/Makefile.am	(working copy)
@@ -78,6 +78,19 @@
 
 CLEANFILES =
 
+if GNUCASH_SEPARATE_BUILDDIR
+SCM_FILE_LINKS = \
+  qif-dialog-utils.scm \
+  qif-file.scm \
+  qif-guess-map.scm \
+  qif-import.scm \
+  qif-merge-groups.scm \
+  qif-objects.scm \
+  qif-parse.scm \
+  qif-to-gnc.scm \
+  qif-utils.scm
+endif
+
 noinst_DATA = .scm-links
 
 .scm-links: 
@@ -86,5 +99,11 @@
 	ln -sf . import-export
 	ln -sf . gnucash 
 	ln -sf . g-wrapped 
+if GNUCASH_SEPARATE_BUILDDIR
+	for X in ${SCM_FILE_LINKS} ; do \
+	  ln -sf ${srcdir}/$$X . ; \
+	done
+endif
 	touch .scm-links
+
 CLEANFILES += qif-import import-export gnucash g-wrapped .scm-links
Index: src/import-export/qif-io-core/Makefile.am
===================================================================
--- src/import-export/qif-io-core/Makefile.am	(revision 13074)
+++ src/import-export/qif-io-core/Makefile.am	(working copy)
@@ -8,10 +8,27 @@
 
 noinst_DATA = .scm-links
 
+if GNUCASH_SEPARATE_BUILDDIR
+SCM_FILE_LINKS = \
+	qif-acct-table.scm \
+	qif-bank-xtn-import.scm \
+	qif-file.scm \
+	qif-format-check.scm \
+	qif-invst-xtn-import.scm \
+	qif-objects.scm \
+	qif-parse.scm \
+	qif-record-xform.scm 
+endif
+
 .scm-links:
 	rm -f gnucash import-export 
 	ln -sf . gnucash
 	ln -sf . import-export
+if GNUCASH_SEPARATE_BUILDDIR
+	for X in ${SCM_FILE_LINKS} ; do \
+	  ln -sf ${srcdir}/$$X . ; \
+	done
+endif
 	touch .scm-links
 
 gncscmmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash/import-export/
Index: src/report/report-gnome/Makefile.am
===================================================================
--- src/report/report-gnome/Makefile.am	(revision 13074)
+++ src/report/report-gnome/Makefile.am	(working copy)
@@ -80,7 +80,7 @@
 
 if GNUCASH_SEPARATE_BUILDDIR
 #Only needed when srcdir and builddir are different
-SCM_FILE_LINKS = gw-report-gnome-spec.scm
+SCM_FILE_LINKS = gw-report-gnome-spec.scm report-gnome.scm
 endif
 
 .scm-links: 
Index: src/report/report-system/Makefile.am
===================================================================
--- src/report/report-system/Makefile.am	(revision 13074)
+++ src/report/report-system/Makefile.am	(working copy)
@@ -24,7 +24,21 @@
 
 if GNUCASH_SEPARATE_BUILDDIR
 #For executing test cases
-SCM_FILE_LINKS = report-system.scm gw-report-system-spec.scm
+SCM_FILE_LINKS = report-system.scm gw-report-system-spec.scm \
+     commodity-utilities.scm  \
+     html-acct-table.scm \
+     html-barchart.scm \
+     html-document.scm \
+     html-piechart.scm \
+     html-scatter.scm \
+     html-style-info.scm \
+     html-style-sheet.scm \
+     html-table.scm \
+     html-text.scm \
+     html-utilities.scm \
+     options-utilities.scm \
+     report-utilities.scm \
+     report.scm 
 endif
 
 .scm-links:
Index: src/report/standard-reports/Makefile.am
===================================================================
--- src/report/standard-reports/Makefile.am	(revision 13074)
+++ src/report/standard-reports/Makefile.am	(working copy)
@@ -10,10 +10,40 @@
   -I${top_srcdir}/src/gnc-module \
   ${GUILE_INCS} ${GLIB_CFLAGS}
 
+if GNUCASH_SEPARATE_BUILDDIR
+#For executing test cases
+SCM_FILE_LINKS = \
+   account-piecharts.scm \
+   account-summary.scm \
+   advanced-portfolio.scm \
+   average-balance.scm \
+   balance-sheet.scm \
+   cash-flow.scm \
+   budget.scm \
+   category-barchart.scm \
+   daily-reports.scm \
+   equity-statement.scm \
+   net-barchart.scm \
+   income-statement.scm \
+   portfolio.scm \
+   price-scatter.scm \
+   register.scm \
+   standard-reports.scm \
+   trial-balance.scm \
+   general-journal.scm \
+   general-ledger.scm \
+   transaction.scm 
+endif
+
 .scm-links:
 	rm -f gnucash report
 	ln -sf . gnucash
 	ln -sf ${srcdir} report 
+if GNUCASH_SEPARATE_BUILDDIR
+	for X in ${SCM_FILE_LINKS} ; do \
+	  ln -sf ${srcdir}/$$X . ; \
+	done
+endif
 	touch .scm-links
 
 noinst_DATA = .scm-links
Index: src/report/stylesheets/Makefile.am
===================================================================
--- src/report/stylesheets/Makefile.am	(revision 13074)
+++ src/report/stylesheets/Makefile.am	(working copy)
@@ -27,10 +27,24 @@
   ${QOF_CFLAGS} \
   ${GNOME_CFLAGS}
 
+if GNUCASH_SEPARATE_BUILDDIR
+#For executing test cases
+SCM_FILE_LINKS = \
+  stylesheets.scm \
+  stylesheet-plain.scm \
+  stylesheet-fancy.scm \
+  stylesheet-easy.scm
+endif
+
 .scm-links:
 	rm -f gnucash report
 	ln -sf . gnucash
 	ln -sf ${srcdir} report 
+if GNUCASH_SEPARATE_BUILDDIR
+	for X in ${SCM_FILE_LINKS} ; do \
+	  ln -sf ${srcdir}/$$X . ; \
+	done
+endif
 	touch .scm-links
 
 noinst_DATA = .scm-links
Index: src/report/utility-reports/Makefile.am
===================================================================
--- src/report/utility-reports/Makefile.am	(revision 13074)
+++ src/report/utility-reports/Makefile.am	(working copy)
@@ -12,10 +12,26 @@
   -I${top_srcdir}/src/gnc-module \
   ${GUILE_INCS} ${GLIB_CFLAGS}
 
+if GNUCASH_SEPARATE_BUILDDIR
+#For separate build directory
+SCM_FILE_LINKS = \
+  hello-world.scm \
+  iframe-url.scm \
+  utility-reports.scm \
+  view-column.scm \
+  welcome-to-gnucash.scm \
+  test-graphing.scm
+endif
+
 .scm-links:
 	rm -f gnucash report
 	ln -sf . gnucash
 	ln -sf ${srcdir} report 
+if GNUCASH_SEPARATE_BUILDDIR
+	for X in ${SCM_FILE_LINKS} ; do \
+	  ln -sf ${srcdir}/$$X . ; \
+	done
+endif
 	touch .scm-links
 
 noinst_DATA = .scm-links
Index: src/scm/gnumeric/Makefile.am
===================================================================
--- src/scm/gnumeric/Makefile.am	(revision 13074)
+++ src/scm/gnumeric/Makefile.am	(working copy)
@@ -1,4 +1,19 @@
+if GNUCASH_SEPARATE_BUILDDIR
+SCM_FILE_LINKS = \
+  gnumeric-utilities.scm \
+  table-utils.scm
+endif
 
+.scm-links:
+if GNUCASH_SEPARATE_BUILDDIR
+	for X in ${SCM_FILE_LINKS} ; do \
+	  ln -sf ${srcdir}/$$X . ; \
+	done
+endif
+	touch .scm-links
+
+noinst_DATA = .scm-links
+
 gncscmdir = ${GNC_SCM_INSTALL_DIR}/gnumeric
 
 gncscm_DATA = \
Index: src/scm/Makefile.am
===================================================================
--- src/scm/Makefile.am	(revision 13074)
+++ src/scm/Makefile.am	(working copy)
@@ -23,9 +23,28 @@
 configdir = ${GNC_CONFIGDIR}
 config_DATA = config
 
+if GNUCASH_SEPARATE_BUILDDIR
+SCM_FILE_LINKS = \
+  command-line.scm \
+  doc.scm \
+  fin.scm \
+  help-topics-index.scm \
+  main-window.scm \
+  main.scm \
+  price-quotes.scm \
+  process.scm \
+  substring-search.scm \
+  xml-generator.scm
+endif
+
 .scm-links: 
 	rm -f gnucash
 	ln -sf ${srcdir} gnucash
+if GNUCASH_SEPARATE_BUILDDIR
+	for X in ${SCM_FILE_LINKS} ; do \
+	  ln -sf ${srcdir}/$$X . ; \
+	done
+endif
 	touch .scm-links
 
 SCM_FILES = ${gncscm_DATA} ${gncscmmod_DATA}
Index: src/scm/printing/Makefile.am
===================================================================
--- src/scm/printing/Makefile.am	(revision 13074)
+++ src/scm/printing/Makefile.am	(working copy)
@@ -1,4 +1,19 @@
+if GNUCASH_SEPARATE_BUILDDIR
+SCM_FILE_LINKS = \
+  print-check.scm \
+  number-to-words.scm
+endif
 
+.scm-links:
+if GNUCASH_SEPARATE_BUILDDIR
+	for X in ${SCM_FILE_LINKS} ; do \
+	  ln -sf ${srcdir}/$$X . ; \
+	done
+endif
+	touch .scm-links
+
+noinst_DATA = .scm-links
+
 gncscmdir = ${GNC_SCM_INSTALL_DIR}/printing
 gncscm_DATA = print-check.scm
 
Index: src/tax/us/Makefile.am
===================================================================
--- src/tax/us/Makefile.am	(revision 13074)
+++ src/tax/us/Makefile.am	(working copy)
@@ -16,7 +16,8 @@
 
 if GNUCASH_SEPARATE_BUILDDIR
 #For executing test cases
-SCM_FILE_LINKS = us.scm de_DE.scm
+SCM_FILE_LINKS = us.scm de_DE.scm \
+  txf.scm txf-help.scm txf-de_DE.scm txf-help-de_DE.scm
 endif
 
 .scm-links:


More information about the gnucash-devel mailing list