[Gnucash-changes] Converting to GModule backends
Neil Williams
codehelp at cvs.gnucash.org
Thu Oct 13 08:28:10 EDT 2005
Log Message:
-----------
Converting to GModule backends
Tags:
----
gnucash-gnome2-dev
Modified Files:
--------------
gnucash/po:
POTFILES.in
gnucash/src/backend/file:
Makefile.am
gnc-backend-file.c
gnucash/src/backend/file/test:
.cvsignore
Makefile.am
test-load-xml2.c
gnucash/src/backend/postgres:
Makefile.am
PostgresBackend.c
PostgresBackend.h
kvp-sql.c
gnucash/src/backend/postgres/test:
.cvsignore
Makefile.am
test-db.c
test-period.c
gnucash/src/backend/qsf:
Makefile.am
gnucash/src/business/business-core/test:
Makefile.am
gnucash/src/engine:
gnc-engine.c
qofsession.c
gnucash/src/gnome-utils:
Makefile.am
gnucash/src/gnome:
Makefile.am
gnucash/src/import-export/qif-import/test:
Makefile.am
Revision Data
-------------
Index: POTFILES.in
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/po/POTFILES.in,v
retrieving revision 1.88.2.7
retrieving revision 1.88.2.8
diff -Lpo/POTFILES.in -Lpo/POTFILES.in -u -r1.88.2.7 -r1.88.2.8
--- po/POTFILES.in
+++ po/POTFILES.in
@@ -266,7 +266,6 @@
src/backend/file/test/test-kvp-frames.c
src/backend/file/io-utils.c
src/backend/file/sixtp-dom-generators.c
-src/backend/file/gncmod-backend-file.c
src/backend/file/gnc-commodity-xml-v2.c
src/backend/file/gnc-lot-xml-v2.c
src/backend/file/io-gncxml-gen.c
@@ -294,7 +293,6 @@
src/backend/postgres/escape.c
src/backend/postgres/PostgresBackend.c
src/backend/postgres/txn.c
-src/backend/postgres/gncmod-backend-postgres.c
src/backend/postgres/upgrade.c
src/backend/postgres/book.c
src/backend/postgres/account.c
Index: gnc-backend-file.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/file/gnc-backend-file.c,v
retrieving revision 1.23.4.14
retrieving revision 1.23.4.15
diff -Lsrc/backend/file/gnc-backend-file.c -Lsrc/backend/file/gnc-backend-file.c -u -r1.23.4.14 -r1.23.4.15
--- src/backend/file/gnc-backend-file.c
+++ src/backend/file/gnc-backend-file.c
@@ -53,10 +53,6 @@
#include "gnc-backend-api.h"
#include "gnc-backend-file.h"
-#ifdef GNUCASH_MAJOR_VERSION
-#include "qsf-xml.h"
-#endif
-
#define GNC_BE_DAYS "file_retention_days"
#define GNC_BE_ZIP "file_compression"
@@ -432,19 +428,9 @@
return GNC_BOOK_XML2_FILE;
}
else if(gnc_is_bin_file(path)) { return GNC_BOOK_BIN_FILE; }
-#ifdef GNUCASH_MAJOR_VERSION
- else if(is_our_qsf_object(path)) {
- return QSF_GNC_OBJECT; /**< QSF object file using only GnuCash QOF objects */
- } else if(is_qsf_object(path)) {
- return QSF_OBJECT; /**< QSF object file that needs a QSF map */
- } else if(is_qsf_map(path)) {
- return QSF_MAP; /**< QSF map file */
- }
-#endif
return GNC_BOOK_NOT_OURS;
}
-#ifndef GNUCASH_MAJOR_VERSION
static gboolean
gnc_determine_file_type (const char *path)
{
@@ -467,7 +453,6 @@
PINFO (" %s is not a gnc file", path);
return FALSE;
}
-#endif
static gboolean
gnc_file_be_backup_file(FileBackend *be)
@@ -892,23 +877,6 @@
rc = qof_session_load_from_xml_file (book, be->fullpath);
if (FALSE == rc) error = ERR_FILEIO_PARSE_ERROR;
break;
-#ifdef GNUCASH_MAJOR_VERSION
- case QSF_GNC_OBJECT:
- error = qof_session_load_our_qsf_object(qof_session_get_current_session(), be->fullpath);
- PINFO (" QSF_GNC_OBJECT error=%d", error);
- break;
-
- case QSF_OBJECT:
- /* a QSF object file needs a QSF map to convert external objects */
- error = qof_session_load_qsf_object(qof_session_get_current_session(), be->fullpath);
- PINFO (" QSF_OBJECT error=%d", error);
- break;
-
- case QSF_MAP:
- error = ERR_QSF_MAP_NOT_OBJ;
- PINFO (" QSF_MAP error=%d", error);
- break;
-#endif
case GNC_BOOK_BIN_FILE:
qof_session_load_from_binfile(book, be->fullpath);
error = gnc_get_binfile_io_error();
@@ -953,44 +921,10 @@
}
/* ================================================================= */
-#ifdef GNUCASH_MAJOR_VERSION
+#if 0 //def GNUCASH_MAJOR_VERSION
QofBackend *
libgncmod_backend_file_LTX_gnc_backend_new(void)
{
- FileBackend *fbe;
- QofBackend *be;
-
- fbe = g_new0(FileBackend, 1);
- be = (QofBackend*)fbe;
- qof_backend_init(be);
-
- be->session_begin = file_session_begin;
- be->session_end = file_session_end;
- be->destroy_backend = file_destroy_backend;
-
- be->load = gnc_file_be_load_from_file;
- be->save_may_clobber_data = gnc_file_be_save_may_clobber_data;
-
- /* The file backend treats accounting periods transactionally. */
- be->begin = file_begin_edit;
- be->commit = file_commit_edit;
- be->rollback = file_rollback_edit;
-
- /* The file backend always loads all data ... */
- be->compile_query = NULL;
- be->free_query = NULL;
- be->run_query = NULL;
- be->price_lookup = NULL;
-
- be->counter = NULL;
-
- /* The file backend will never be multi-user... */
- be->events_pending = NULL;
- be->process_events = NULL;
-
- be->sync = file_sync_all;
- be->load_config = gnc_file_be_set_config;
- be->export = gnc_file_be_write_accounts_to_file;
fbe->dirname = NULL;
fbe->fullpath = NULL;
@@ -1052,7 +986,6 @@
return be;
}
-#ifndef GNUCASH_MAJOR_VERSION
static void
gnc_provider_free (QofBackendProvider *prov)
{
@@ -1080,6 +1013,5 @@
prov->check_data_type = gnc_determine_file_type;
qof_backend_register_provider (prov);
}
-#endif
/* ========================== END OF FILE ===================== */
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/file/Makefile.am,v
retrieving revision 1.16.4.5
retrieving revision 1.16.4.6
diff -Lsrc/backend/file/Makefile.am -Lsrc/backend/file/Makefile.am -u -r1.16.4.5 -r1.16.4.6
--- src/backend/file/Makefile.am
+++ src/backend/file/Makefile.am
@@ -1,21 +1,20 @@
SUBDIRS = . test
-pkglib_LTLIBRARIES = libgncmod-backend-file.la
+#Now a shared GModule, not a package library.
+lib_LTLIBRARIES = libgnc-backend-file.la
AM_CFLAGS = \
-I.. -I../.. \
+ -DLOCALE_DIR=\""$(datadir)/locale"\" \
-I${top_srcdir}/src/backend \
-I${top_srcdir}/src/engine \
- -I${top_srcdir}/src/gnc-module \
-I${top_srcdir}/src/core-utils\
-I${top_srcdir}/lib/libc\
- -I${top_srcdir}/src/backend/qsf \
${XML_CFLAGS} \
${GLIB_CFLAGS} \
${GCONF_CFLAGS}
-libgncmod_backend_file_la_SOURCES = \
- gncmod-backend-file.c \
+libgnc_backend_file_la_SOURCES = \
gnc-account-xml-v2.c \
gnc-backend-file.c \
gnc-book-xml-v2.c \
@@ -55,9 +54,7 @@
sixtp-stack.h \
sixtp-utils.h
-libgncmod_backend_file_la_LDFLAGS = -module
-libgncmod_backend_file_la_LIBADD = \
+libgnc_backend_file_la_LDFLAGS = -module
+libgnc_backend_file_la_LIBADD = \
${GLIB_LIBS} ${GCONF_LIBS} ${XML_LIBS} \
- ${top_builddir}/src/engine/libgncmod-engine.la \
- ${top_builddir}/src/backend/qsf/libqof-backend-qsf.la
-
+ ${top_builddir}/src/engine/libgncmod-engine.la
Index: .cvsignore
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/file/test/.cvsignore,v
retrieving revision 1.5.6.2
retrieving revision 1.5.6.3
diff -Lsrc/backend/file/test/.cvsignore -Lsrc/backend/file/test/.cvsignore -u -r1.5.6.2 -r1.5.6.3
--- src/backend/file/test/.cvsignore
+++ src/backend/file/test/.cvsignore
@@ -5,6 +5,7 @@
test-string-converters
test-xml-account
test-xml2-is-file
+test-load-backend
test-load-xml2
test-load-example-account
test-xml-commodity
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/file/test/Makefile.am,v
retrieving revision 1.28.4.4
retrieving revision 1.28.4.5
diff -Lsrc/backend/file/test/Makefile.am -Lsrc/backend/file/test/Makefile.am -u -r1.28.4.4 -r1.28.4.5
--- src/backend/file/test/Makefile.am
+++ src/backend/file/test/Makefile.am
@@ -1,11 +1,166 @@
SUBDIRS = test-files
+test_date_converting_SOURCES = \
+ ${top_srcdir}/src/backend/file/sixtp-dom-parsers.c \
+ ${top_srcdir}/src/backend/file/sixtp-dom-generators.c \
+ ${top_srcdir}/src/backend/file/sixtp-utils.c \
+ ${top_srcdir}/src/backend/file/sixtp.c \
+ ${top_srcdir}/src/backend/file/sixtp-stack.c \
+ ${top_srcdir}/src/backend/file/sixtp-to-dom-parser.c \
+ test-date-converting.c
+
+test_dom_converters1_SOURCES = \
+ ${top_srcdir}/src/backend/file/sixtp-dom-parsers.c \
+ ${top_srcdir}/src/backend/file/sixtp-dom-generators.c \
+ ${top_srcdir}/src/backend/file/sixtp-utils.c \
+ ${top_srcdir}/src/backend/file/sixtp.c \
+ ${top_srcdir}/src/backend/file/sixtp-stack.c \
+ ${top_srcdir}/src/backend/file/sixtp-to-dom-parser.c \
+ test-dom-converters1.c
+
+test_kvp_frames_SOURCES = \
+ ${top_srcdir}/src/backend/file/sixtp-dom-parsers.c \
+ ${top_srcdir}/src/backend/file/sixtp-dom-generators.c \
+ ${top_srcdir}/src/backend/file/sixtp-utils.c \
+ ${top_srcdir}/src/backend/file/sixtp.c \
+ ${top_srcdir}/src/backend/file/sixtp-stack.c \
+ ${top_srcdir}/src/backend/file/sixtp-to-dom-parser.c \
+ test-kvp-frames.c
+
+# the file backend is now a GModule - this test does
+# not load it as a module and cannot link to it
+# and remain portable.
+
+test_load_example_account_SOURCES = \
+ ${top_srcdir}/src/backend/file/sixtp-dom-parsers.c \
+ ${top_srcdir}/src/backend/file/sixtp-dom-generators.c \
+ ${top_srcdir}/src/backend/file/sixtp-utils.c \
+ ${top_srcdir}/src/backend/file/sixtp.c \
+ ${top_srcdir}/src/backend/file/sixtp-stack.c \
+ ${top_srcdir}/src/backend/file/sixtp-to-dom-parser.c \
+ ${top_srcdir}/src/backend/file/io-example-account.c \
+ ${top_srcdir}/src/backend/file/gnc-account-xml-v2.c \
+ ${top_srcdir}/src/backend/file/io-gncxml-gen.c \
+ ${top_srcdir}/src/backend/file/io-gncxml-v2.c \
+ ${top_srcdir}/src/backend/file/io-utils.c \
+ ${top_srcdir}/src/backend/file/gnc-lot-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-schedxaction-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-freqspec-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-transaction-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-commodity-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-book-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-pricedb-xml-v2.c \
+ test-load-example-account.c
+
+test_string_converters_SOURCES = \
+ ${top_srcdir}/src/backend/file/sixtp-dom-parsers.c \
+ ${top_srcdir}/src/backend/file/sixtp-dom-generators.c \
+ ${top_srcdir}/src/backend/file/sixtp-utils.c \
+ ${top_srcdir}/src/backend/file/sixtp.c \
+ ${top_srcdir}/src/backend/file/sixtp-stack.c \
+ ${top_srcdir}/src/backend/file/sixtp-to-dom-parser.c \
+ test-string-converters.c
+
+test_xml_account_SOURCES = \
+ ${top_srcdir}/src/backend/file/sixtp-dom-parsers.c \
+ ${top_srcdir}/src/backend/file/sixtp-dom-generators.c \
+ ${top_srcdir}/src/backend/file/sixtp-utils.c \
+ ${top_srcdir}/src/backend/file/sixtp.c \
+ ${top_srcdir}/src/backend/file/sixtp-stack.c \
+ ${top_srcdir}/src/backend/file/sixtp-to-dom-parser.c \
+ ${top_srcdir}/src/backend/file/io-gncxml-gen.c \
+ ${top_srcdir}/src/backend/file/gnc-account-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-lot-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-schedxaction-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-freqspec-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-transaction-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-commodity-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-book-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-pricedb-xml-v2.c \
+ test-xml-account.c
+
+test_xml_commodity_SOURCES = \
+ ${top_srcdir}/src/backend/file/sixtp-dom-parsers.c \
+ ${top_srcdir}/src/backend/file/sixtp-dom-generators.c \
+ ${top_srcdir}/src/backend/file/sixtp-utils.c \
+ ${top_srcdir}/src/backend/file/sixtp.c \
+ ${top_srcdir}/src/backend/file/sixtp-stack.c \
+ ${top_srcdir}/src/backend/file/sixtp-to-dom-parser.c \
+ ${top_srcdir}/src/backend/file/io-gncxml-gen.c \
+ ${top_srcdir}/src/backend/file/gnc-account-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-lot-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-schedxaction-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-freqspec-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-transaction-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-commodity-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-book-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-pricedb-xml-v2.c \
+ test-xml-commodity.c
+
+test_xml_pricedb_SOURCES = \
+ ${top_srcdir}/src/backend/file/sixtp-dom-parsers.c \
+ ${top_srcdir}/src/backend/file/sixtp-dom-generators.c \
+ ${top_srcdir}/src/backend/file/sixtp-utils.c \
+ ${top_srcdir}/src/backend/file/sixtp.c \
+ ${top_srcdir}/src/backend/file/sixtp-stack.c \
+ ${top_srcdir}/src/backend/file/sixtp-to-dom-parser.c \
+ ${top_srcdir}/src/backend/file/io-gncxml-gen.c \
+ ${top_srcdir}/src/backend/file/gnc-account-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-lot-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-schedxaction-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-freqspec-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-transaction-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-commodity-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-book-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-pricedb-xml-v2.c \
+ test-xml-pricedb.c
+
+test_xml_transaction_SOURCES = \
+ ${top_srcdir}/src/backend/file/sixtp-dom-parsers.c \
+ ${top_srcdir}/src/backend/file/sixtp-dom-generators.c \
+ ${top_srcdir}/src/backend/file/sixtp-utils.c \
+ ${top_srcdir}/src/backend/file/sixtp.c \
+ ${top_srcdir}/src/backend/file/sixtp-stack.c \
+ ${top_srcdir}/src/backend/file/sixtp-to-dom-parser.c \
+ ${top_srcdir}/src/backend/file/io-gncxml-gen.c \
+ ${top_srcdir}/src/backend/file/gnc-account-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-lot-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-schedxaction-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-freqspec-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-transaction-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-commodity-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-book-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-pricedb-xml-v2.c \
+ ${top_srcdir}/src/backend/file/io-gncxml-v2.c \
+ ${top_srcdir}/src/backend/file/io-utils.c \
+ test-xml-transaction.c
+
+test_xml2_is_file_SOURCES = \
+ ${top_srcdir}/src/backend/file/sixtp-dom-parsers.c \
+ ${top_srcdir}/src/backend/file/sixtp-dom-generators.c \
+ ${top_srcdir}/src/backend/file/sixtp-utils.c \
+ ${top_srcdir}/src/backend/file/sixtp.c \
+ ${top_srcdir}/src/backend/file/sixtp-stack.c \
+ ${top_srcdir}/src/backend/file/sixtp-to-dom-parser.c \
+ ${top_srcdir}/src/backend/file/gnc-account-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-lot-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-schedxaction-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-freqspec-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-transaction-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-commodity-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-book-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-pricedb-xml-v2.c \
+ ${top_srcdir}/src/backend/file/io-gncxml-gen.c \
+ ${top_srcdir}/src/backend/file/io-gncxml-v2.c \
+ ${top_srcdir}/src/backend/file/io-utils.c \
+ test-xml2-is-file.c
+
TESTS = \
test-date-converting \
test-dom-converters1 \
test-kvp-frames \
test-load-example-account \
- test-load-module \
+ test-load-backend \
test-load-xml2 \
test-real-data.sh \
test-string-converters \
@@ -18,7 +173,6 @@
GNC_TEST_DEPS := \
--gnc-module-dir ${top_builddir}/src/gnc-module \
--gnc-module-dir ${top_builddir}/src/engine \
- --gnc-module-dir ${top_builddir}/src/backend/file \
--gnc-module-dir ${top_srcdir}/src/gnc-module \
--gnc-module-dir ${top_srcdir}/src/engine \
--guile-load-dir ${G_WRAP_MODULE_DIR} \
@@ -38,6 +192,7 @@
test-date-converting \
test-dom-converters1 \
test-kvp-frames \
+ test-load-backend \
test-load-example-account \
test-load-xml2 \
test-save-in-lang \
@@ -56,8 +211,8 @@
${top_builddir}/src/engine/libgw-engine.la \
${top_builddir}/src/engine/libgw-kvp.la \
${top_builddir}/src/engine/test-core/libgncmod-test-engine.la \
- ${top_builddir}/src/backend/file/libgncmod-backend-file.la \
./libgnc-test-file-stuff.la \
+ ${LIBXML2_LIBS} \
${top_builddir}/lib/libc/libc-missing.la
AM_CFLAGS = \
@@ -77,6 +232,5 @@
EXTRA_DIST = \
grab-types.pl \
test-dom-parser1.c \
- test-load-module \
test-real-data.sh \
test-xml2-is-file.c
Index: test-load-xml2.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/file/test/test-load-xml2.c,v
retrieving revision 1.10.4.2
retrieving revision 1.10.4.3
diff -Lsrc/backend/file/test/test-load-xml2.c -Lsrc/backend/file/test/test-load-xml2.c -u -r1.10.4.2 -r1.10.4.3
--- src/backend/file/test/test-load-xml2.c
+++ src/backend/file/test/test-load-xml2.c
@@ -1,10 +1,31 @@
+/***************************************************************************
+ * test-load-xml2.c
+ *
+ * Fri Oct 7 20:51:46 2005
+ * Copyright 2005 Neil Williams
+ * linux at codehelp.co.uk
+ ****************************************************************************/
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
/* @file test-load-xml2.c
- * @breif test the loading of a vrsion-2 gnucash XML file
+ * @brief test the loading of a version-2 gnucash XML file
*/
#include <glib.h>
-#include <libguile.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
@@ -12,20 +33,20 @@
#include <unistd.h>
#include <dirent.h>
#include <string.h>
-
-#include "qofsession.h"
+#include "cashobjects.h"
#include "Group.h"
#include "TransLog.h"
#include "gnc-engine.h"
#include "gnc-backend-file.h"
-#include "qofsession-p.h"
-#include "gnc-module.h"
#include "io-gncxml-v2.h"
#include "test-stuff.h"
#include "test-engine-stuff.h"
#include "test-file-stuff.h"
+#define GNC_LIB_NAME "libgnc-backend-file.la"
+#define GNC_LIB_INIT "gnc_provider_init"
+
static void
remove_files_pattern(const char *begining, const char *ending)
{
@@ -54,21 +75,21 @@
{
QofSession *session;
QofBook *book;
- QofBackend *be;
+ AccountGroup *grp;
gboolean ignore_lock;
session = qof_session_new();
remove_locks(filename);
- ignore_lock = (strcmp(getenv("SRCDIR"), ".") != 0);
+ ignore_lock = (safe_strcmp(getenv("SRCDIR"), ".") != 0);
qof_session_begin(session, filename, ignore_lock, FALSE);
+ qof_session_load(session, NULL);
book = qof_session_get_book (session);
- be = qof_session_get_backend (session);
- qof_session_load_from_xml_file_v2((FileBackend *)be, book);
- do_test (xaccGroupGetBook (xaccGetAccountGroup (book)) == book,
+ grp = xaccGetAccountGroup(book);
+ do_test (xaccGroupGetBook (grp) == book,
"book and group don't match");
do_test_args(
@@ -76,22 +97,26 @@
"session load xml2", __FILE__, __LINE__, "%d for file %s",
qof_session_get_error(session), filename);
- qof_session_destroy(session);
+ qof_session_end(session);
}
-static void
-guile_main (void *closure, int argc, char **argv)
+int
+main (int argc, char ** argv)
{
const char *location = getenv("GNC_TEST_FILES");
DIR *xml2_dir;
+ qof_init();
+ cashobjects_register();
+ do_test(
+ qof_load_backend_library ("../", GNC_LIB_NAME, GNC_LIB_INIT),
+ " loading gnc-backend-file GModule failed");
+
if (!location)
{
location = "test-files/xml2";
}
- gnc_module_system_init();
- gnc_module_load("gnucash/engine", 0);
xaccLogDisable();
@@ -129,15 +154,6 @@
closedir(xml2_dir);
print_test_results();
- exit(get_rv());
-}
-
-int
-main (int argc, char ** argv)
-{
- /* getchar (); */
-
- scm_boot_guile(argc, argv, guile_main, NULL);
-
+ qof_close();
return 0;
}
Index: PostgresBackend.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/PostgresBackend.h,v
retrieving revision 1.8.4.3
retrieving revision 1.8.4.4
diff -Lsrc/backend/postgres/PostgresBackend.h -Lsrc/backend/postgres/PostgresBackend.h -u -r1.8.4.3 -r1.8.4.4
--- src/backend/postgres/PostgresBackend.h
+++ src/backend/postgres/PostgresBackend.h
@@ -41,8 +41,10 @@
#include "Transaction.h"
#include "builder.h"
-#include "qofbackend-p.h"
-#include "qofbook.h"
+#include "qof.h"
+/** \todo Remove the private header
+and use API functions instead. */
+#include "qofbook-p.h"
#define GNC_MOD_TXN "gnucash-postgres-transaction"
@@ -133,4 +135,6 @@
void pgendDisable (PGBackend *be);
void pgendEnable (PGBackend *be);
+void pgend_provider_init(void);
+
#endif /* POSTGRES_BACKEND_H */
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/Makefile.am,v
retrieving revision 1.18.4.2
retrieving revision 1.18.4.3
diff -Lsrc/backend/postgres/Makefile.am -Lsrc/backend/postgres/Makefile.am -u -r1.18.4.2 -r1.18.4.3
--- src/backend/postgres/Makefile.am
+++ src/backend/postgres/Makefile.am
@@ -1,14 +1,14 @@
SUBDIRS = . test
-pkglib_LTLIBRARIES = libgncmod-backend-postgres.la
+lib_LTLIBRARIES = libgnc-backend-postgres.la
-libgncmod_backend_postgres_la_LDFLAGS = -module
+libgnc_backend_postgres_la_LDFLAGS = -module
-libgncmod_backend_postgres_la_LIBADD = ${PGSQL_LIBS} -lpq \
+libgnc_backend_postgres_la_LIBADD = ${PGSQL_LIBS} -lpq \
${top_builddir}/src/engine/libgncmod-engine.la \
${GLIB_LIBS}
-libgncmod_backend_postgres_la_SOURCES = \
+libgnc_backend_postgres_la_SOURCES = \
PostgresBackend.c \
account.c \
book.c \
@@ -17,7 +17,6 @@
escape.c \
events.c \
gncquery.c \
- gncmod-backend-postgres.c \
kvp-sql.c \
price.c \
txn.c \
@@ -26,7 +25,7 @@
putil.c
## Distributed autogenerated and #included files
-EXTRA_libgncmod_backend_postgres_la_SOURCES = \
+EXTRA_libgnc_backend_postgres_la_SOURCES = \
base-autogen.c \
check-autogen.c \
kvp-autogen.c \
@@ -96,7 +95,6 @@
-I.. -I${srcdir}/.. \
-I../.. -I${srcdir}/../.. \
-I../../engine -I${srcdir}/../../engine \
- -I../../gnc-module -I${srcdir}/../../gnc-module \
${PGSQL_CFLAGS} \
${GLIB_CFLAGS}
Index: kvp-sql.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/kvp-sql.c,v
retrieving revision 1.13.2.4
retrieving revision 1.13.2.5
diff -Lsrc/backend/postgres/kvp-sql.c -Lsrc/backend/postgres/kvp-sql.c -u -r1.13.2.4 -r1.13.2.5
--- src/backend/postgres/kvp-sql.c
+++ src/backend/postgres/kvp-sql.c
@@ -212,7 +212,7 @@
char *path_save;
path_save = cb_data->path;
- cb_data->path = g_strjoin ("/", path_save, key, 0);
+ cb_data->path = g_strjoin ("/", path_save, key, NULL);
ipath = pgendGetPathCache (be, cb_data->path, cb_data->escape);
cb_data->ipath = ipath;
Index: PostgresBackend.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/PostgresBackend.c,v
retrieving revision 1.43.4.7
retrieving revision 1.43.4.8
diff -Lsrc/backend/postgres/PostgresBackend.c -Lsrc/backend/postgres/PostgresBackend.c -u -r1.43.4.7 -r1.43.4.8
--- src/backend/postgres/PostgresBackend.c
+++ src/backend/postgres/PostgresBackend.c
@@ -44,18 +44,8 @@
#include "GroupP.h"
#include "gnc-commodity.h"
#include "gnc-engine.h"
-#include "gnc-engine-util.h"
-#include "gnc-event.h"
-#include "gnc-event-p.h"
#include "gnc-pricedb.h"
#include "gnc-pricedb-p.h"
-#include "guid.h"
-#include "qofbackend.h"
-#include "qofbackend-p.h"
-#include "qofid.h"
-#include "qofid-p.h"
-#include "qofbook.h"
-#include "qofbook-p.h"
#include "TransactionP.h"
#include "account.h"
@@ -2547,4 +2537,26 @@
return (QofBackend *) be;
}
+static void
+pg_provider_free (QofBackendProvider *prov)
+{
+ prov->provider_name = NULL;
+ prov->access_method = NULL;
+ g_free (prov);
+}
+
+void pgend_provider_init(void)
+{
+ QofBackendProvider *prov;
+
+ prov = g_new0(QofBackendProvider, 1);
+ prov->provider_name = "The Postgres backend for Gnucash";
+ prov->access_method = "sql";
+ prov->partial_book_supported = FALSE;
+ prov->backend_new = pgendNew;
+ prov->provider_free = pg_provider_free;
+ prov->check_data_type = NULL;
+ qof_backend_register_provider (prov);
+}
+
/* ======================== END OF FILE ======================== */
Index: test-db.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/test/test-db.c,v
retrieving revision 1.49.4.3
retrieving revision 1.49.4.4
diff -Lsrc/backend/postgres/test/test-db.c -Lsrc/backend/postgres/test/test-db.c -u -r1.49.4.3 -r1.49.4.4
--- src/backend/postgres/test/test-db.c
+++ src/backend/postgres/test/test-db.c
@@ -1,5 +1,20 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
#include <glib.h>
-#include <libguile.h>
#include <libpq-fe.h>
#include <stdlib.h>
#include <stdio.h>
@@ -7,20 +22,18 @@
#include <unistd.h>
#include "AccountP.h"
-#include "qofbackend.h"
+#include "qof.h"
#include "PostgresBackend.h"
#include "TransactionP.h"
#include "TransLog.h"
-#include "qofbook.h"
#include "gnc-engine.h"
-#include "gnc-engine-util.h"
-#include "gnc-module.h"
-#include "qofsession-p.h"
#include "gncquery.h"
-#include "qofquery.h"
#include "test-stuff.h"
#include "test-engine-stuff.h"
+#define PG_LIB_NAME "libgnc-backend-postgres.la"
+#define PG_LIB_INIT "pgend_provider_init"
+
static QofLogModule log_module = GNC_MOD_TEST;
struct _dbinfo {
@@ -140,6 +153,7 @@
load_db_file(QofSession * session, DbInfo *dbinfo, gboolean end_session)
{
QofBackendError io_err;
+ QofBook *book;
PGBackend *be;
char *filename;
@@ -148,8 +162,8 @@
filename = db_file_url(dbinfo);
qof_session_begin(session, filename, FALSE, FALSE);
-
- be = (PGBackend *)qof_session_get_backend(session);
+ book = qof_session_get_book(session);
+ be = (PGBackend *)qof_book_get_backend(book);
dbinfo->conn = be->connection;
io_err = qof_session_get_error(session);
@@ -485,14 +499,15 @@
{
const char *sql_query_string;
PGresult *result;
+ QofBook *book;
PGBackend *be;
sqlQuery *sq;
gboolean ok;
QofQuery *qn = q;
g_return_val_if_fail(session && q, FALSE);
-
- be = (PGBackend *) qof_session_get_backend(session);
+ book = qof_session_get_book(session);
+ be = (PGBackend *) qof_book_get_backend(book);
if (gnc_should_log(log_module, GNC_LOG_DETAIL))
qof_query_print(qn);
@@ -1074,14 +1089,15 @@
}
#endif
-static void
-guile_main (void *closure, int argc, char **argv)
+int
+main (int argc, char **argv)
{
DbInfo *dbinfo;
- GNCModule *mod;
- gnc_module_system_init();
- mod = gnc_module_load("gnucash/engine", 0);
+ qof_init();
+ do_test(
+ qof_load_backend_library (QOF_LIB_DIR, PG_LIB_NAME, PG_LIB_INIT),
+ " loading gnc-backend-postgres GModule failed");
dbinfo = g_new0(DbInfo, 1);
@@ -1126,12 +1142,6 @@
run_test(dbinfo);
print_test_results();
- exit(get_rv());
-}
-int
-main (int argc, char **argv)
-{
- scm_boot_guile(argc, argv, guile_main, NULL);
return 0;
}
Index: .cvsignore
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/test/.cvsignore,v
retrieving revision 1.12
retrieving revision 1.12.4.1
diff -Lsrc/backend/postgres/test/.cvsignore -Lsrc/backend/postgres/test/.cvsignore -u -r1.12 -r1.12.4.1
--- src/backend/postgres/test/.cvsignore
+++ src/backend/postgres/test/.cvsignore
@@ -6,4 +6,5 @@
test-escape
test_file_*
test-period
+test-load-backend
.libs
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/test/Makefile.am,v
retrieving revision 1.27.4.1
retrieving revision 1.27.4.2
diff -Lsrc/backend/postgres/test/Makefile.am -Lsrc/backend/postgres/test/Makefile.am -u -r1.27.4.1 -r1.27.4.2
--- src/backend/postgres/test/Makefile.am
+++ src/backend/postgres/test/Makefile.am
@@ -1,5 +1,5 @@
TESTS = \
- test-load-module \
+ test-load-backend \
test-escape \
run-tests.sh
@@ -17,6 +17,7 @@
$(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})
noinst_PROGRAMS = \
+ test-load-backend \
test-db \
test-escape \
test-period
@@ -28,13 +29,11 @@
${top_builddir}/src/engine/libgw-engine.la \
${top_builddir}/src/engine/libgw-kvp.la \
${top_builddir}/src/engine/test-core/libgncmod-test-engine.la \
- ${top_builddir}/src/backend/postgres/libgncmod-backend-postgres.la \
- ${top_builddir}/src/backend/file/libgncmod-backend-file.la \
+ ${top_builddir}/src/backend/postgres/libgnc-backend-postgres.la \
-lltdl
AM_CFLAGS = \
-I${top_srcdir}/src \
- -I${top_srcdir}/src/gnc-module \
-I${top_srcdir}/src/test-core \
-I${top_srcdir}/src/engine \
-I${top_srcdir}/src/engine/test-core \
@@ -45,6 +44,5 @@
${GUILE_INCS}
EXTRA_DIST = \
- test-load-module \
db-control.sh \
run-tests.sh
Index: test-period.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/test/test-period.c,v
retrieving revision 1.2.4.1
retrieving revision 1.2.4.2
diff -Lsrc/backend/postgres/test/test-period.c -Lsrc/backend/postgres/test/test-period.c -u -r1.2.4.1 -r1.2.4.2
--- src/backend/postgres/test/test-period.c
+++ src/backend/postgres/test/test-period.c
@@ -1,29 +1,40 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
/*
* Test file created by Linas Vepstas <linas at linas.org>
* Minimal test to see if a book can be split into two periods
* without crashing. Book is written to the database.
* December 2001
- * License: GPL
*/
#include <ctype.h>
#include <glib.h>
-#include <libguile.h>
#include <time.h>
#include "Account.h"
#include "Group.h"
#include "Period.h"
-#include "qofbook.h"
-#include "qofbook-p.h"
-#include "gnc-engine-util.h"
-#include "gnc-module.h"
+#include "qof.h"
#include "test-stuff.h"
#include "test-engine-stuff.h"
#include "Transaction.h"
-
+#define PG_LIB_NAME "libgnc-backend-postgres.la"
+#define PG_LIB_INIT "pgend_provider_init"
static void
run_test (void)
@@ -40,13 +51,9 @@
Timespec tsfirst, tslast, tsmiddle;
char * test_url;
-
-
- if(!gnc_module_load("gnucash/engine", 0))
- {
- failure("couldn't load gnucash/engine");
- exit(get_rv());
- }
+ do_test( qof_load_backend_library (QOF_LIB_DIR,
+ PG_LIB_NAME, PG_LIB_INIT),
+ " loading gnc-backend-postgres GModule failed");
session = get_random_session ();
@@ -123,9 +130,8 @@
io_err = qof_session_get_error (session);
g_return_if_fail (io_err == ERR_BACKEND_NO_ERR);
- // stdout is broken with guile for some reason
- // gnc_set_logfile (stdout);
- // gnc_set_log_level_global (GNC_LOG_INFO);
+ gnc_set_logfile (stdout);
+ gnc_set_log_level_global (GNC_LOG_INFO);
closedbook = gnc_book_close_period (openbook, tsmiddle,
NULL, "this is opening balance dude");
@@ -146,18 +152,13 @@
success ("periods lightly tested and seem to work");
}
-static void
-main_helper (void *closure, int argc, char **argv)
+int
+main (int argc, char **argv)
{
+ qof_init();
run_test ();
print_test_results();
- exit(get_rv());
-}
-
-int
-main (int argc, char **argv)
-{
- scm_boot_guile(argc, argv, main_helper, NULL);
+ qof_close();
return 0;
}
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/qsf/Attic/Makefile.am,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -Lsrc/backend/qsf/Makefile.am -Lsrc/backend/qsf/Makefile.am -u -r1.1.2.3 -r1.1.2.4
--- src/backend/qsf/Makefile.am
+++ src/backend/qsf/Makefile.am
@@ -1,6 +1,6 @@
SUBDIRS = .
-pkglib_LTLIBRARIES = libqof-backend-qsf.la
+lib_LTLIBRARIES = libqof-backend-qsf.la
AM_CFLAGS = \
-I.. -I../.. \
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-core/test/Makefile.am,v
retrieving revision 1.4.4.2
retrieving revision 1.4.4.3
diff -Lsrc/business/business-core/test/Makefile.am -Lsrc/business/business-core/test/Makefile.am -u -r1.4.4.2 -r1.4.4.3
--- src/business/business-core/test/Makefile.am
+++ src/business/business-core/test/Makefile.am
@@ -13,7 +13,6 @@
${top_builddir}/src/test-core/libgncmod-test.la \
${top_builddir}/src/engine/libgncmod-engine.la \
${top_builddir}/src/engine/libgw-engine.la \
- ${top_builddir}/src/backend/file/libgncmod-backend-file.la \
../libgncmod-business-core.la \
../libgw-business-core.la \
${GLIB_LIBS} \
Index: qofsession.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/qofsession.c,v
retrieving revision 1.2.4.24
retrieving revision 1.2.4.25
diff -Lsrc/engine/qofsession.c -Lsrc/engine/qofsession.c -u -r1.2.4.24 -r1.2.4.25
--- src/engine/qofsession.c
+++ src/engine/qofsession.c
@@ -53,11 +53,6 @@
#include "qofobject.h"
#include "qofsession-p.h"
-/* Some gnucash-specific code */
-#ifdef GNUCASH_MAJOR_VERSION
-#include "gnc-module.h"
-#endif /* GNUCASH */
-
/** \deprecated should not be static */
static QofSession * current_session = NULL;
static GHookList * session_closed_hooks = NULL;
@@ -233,6 +228,8 @@
return current_session;
}
+/** \deprecated Each application should keep
+their \b own session context. */
void
qof_session_set_current_session (QofSession *session)
{
@@ -814,86 +811,6 @@
{ NULL, NULL, NULL }
};
-#ifdef GNUCASH_MAJOR_VERSION
-
-static void
-qof_session_int_backend_load_error(QofSession *session,
- char *message, char *dll_err)
-{
- PWARN ("%s %s", message, dll_err ? dll_err : "");
-
- g_free(session->book_id);
- session->book_id = NULL;
-
- qof_session_push_error (session, ERR_BACKEND_NO_BACKEND, NULL);
-}
-
-/* Gnucash uses its module system to load a backend; other users
- * use traditional dlopen calls. This will change with CashUtil.
- */
-static void
-qof_session_load_backend(QofSession * session, char * backend_name)
-{
- GList *node;
- QofBook *book;
- GNCModule mod;
- GSList *p;
- char *mod_name, *access_method, *msg;
- QofBackend *(* be_new_func)(void);
- QofBackendProvider *prov;
-
- mod = 0;
- mod_name = g_strdup_printf("gnucash/backend/%s", backend_name);
- msg = g_strdup_printf(" ");
- mod = gnc_module_load(mod_name, 0);
- if (mod)
- {
- be_new_func = gnc_module_lookup(mod, "gnc_backend_new");
- if(be_new_func)
- {
- session->backend = be_new_func();
- for (node=session->books; node; node=node->next)
- {
- book = node->data;
- qof_book_set_backend (book, session->backend);
- }
- }
- else { qof_session_int_backend_load_error(session, " can't find backend_new ",""); }
- }
- else
- {
- /* QSF is built for the QOF version, use that if no module is found.
- This allows the GnuCash version to be called with an access method,
- as it would be in QOF, instead of a resolved module name.
- */
- access_method = g_strdup(backend_name);
- for (p = provider_list; p; p=p->next)
- {
- prov = p->data;
- /* Does this provider handle the desired access method? */
- if (0 == strcasecmp (access_method, prov->access_method))
- {
- if (NULL == prov->backend_new) continue;
- /* Use the providers creation callback */
- session->backend = (*(prov->backend_new))();
- session->backend->provider = prov;
- /* Tell the books about the backend that they'll be using. */
- for (node=session->books; node; node=node->next)
- {
- book = node->data;
- qof_book_set_backend (book, session->backend);
- }
- return;
- }
- }
- msg = g_strdup_printf("failed to load '%s' backend", backend_name);
- qof_session_push_error (session, ERR_BACKEND_NO_HANDLER, msg);
- }
- g_free(mod_name);
-}
-
-#else /* GNUCASH */
-
static void
qof_session_load_backend(QofSession * session, char * access_method)
{
@@ -961,7 +878,6 @@
qof_session_push_error (session, ERR_BACKEND_NO_HANDLER, msg);
LEAVE (" ");
}
-#endif /* GNUCASH */
/* ====================================================================== */
@@ -1261,11 +1177,13 @@
session->backend->provider = prov;
if (session->backend->session_begin)
{
- /* Call begin - what values to use for booleans? */
+ /* Call begin - backend has been changed,
+ so make sure a file can be written,
+ use ignore_lock and create_if_nonexistent */
g_free(session->book_id);
session->book_id = NULL;
(session->backend->session_begin)(session->backend, session,
- book_id, TRUE, FALSE);
+ book_id, TRUE, TRUE);
PINFO("Done running session_begin on changed backend");
err = qof_backend_get_error(session->backend);
msg = qof_backend_get_message(session->backend);
Index: gnc-engine.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/gnc-engine.c,v
retrieving revision 1.17.4.5
retrieving revision 1.17.4.6
diff -Lsrc/engine/gnc-engine.c -Lsrc/engine/gnc-engine.c -u -r1.17.4.5 -r1.17.4.6
--- src/engine/gnc-engine.c
+++ src/engine/gnc-engine.c
@@ -26,7 +26,7 @@
#include <glib.h>
#include "gnc-engine.h"
-#include "gnc-engine-util.h"
+#include "qof.h"
#include "AccountP.h"
#include "GroupP.h"
@@ -38,7 +38,11 @@
#include "SchedXactionP.h"
#include "FreqSpecP.h"
#include "gnc-pricedb-p.h"
-#include "qof.h"
+
+/** gnc file backend library name */
+#define GNC_LIB_NAME "libgnc-backend-file.la"
+/** init_fcn for gnc file backend library. */
+#define GNC_LIB_INIT "gnc_provider_init"
static GList * engine_init_hooks = NULL;
static int engine_is_initialized = 0;
@@ -105,6 +109,11 @@
gnc_commodity_table_register();
gnc_lot_register ();
+ g_return_if_fail((qof_load_backend_library
+ (QOF_LIB_DIR, "libqof-backend-qsf.la", "qsf_provider_init")));
+ g_return_if_fail((qof_load_backend_library
+ (QOF_LIB_DIR, GNC_LIB_NAME, GNC_LIB_INIT)));
+
/* call any engine hooks */
for (cur = engine_init_hooks; cur; cur = cur->next)
{
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/Makefile.am,v
retrieving revision 1.48.2.39
retrieving revision 1.48.2.40
diff -Lsrc/gnome-utils/Makefile.am -Lsrc/gnome-utils/Makefile.am -u -r1.48.2.39 -r1.48.2.40
--- src/gnome-utils/Makefile.am
+++ src/gnome-utils/Makefile.am
@@ -3,7 +3,33 @@
pkglib_LTLIBRARIES = libgncmod-gnome-utils.la libgw-gnome-utils.la
+# Fix the goffice links to be conditional
+
# Note that src/gnome-utils CANNOT depend on src/gnome!
+if USE_LIBGOFFICE
+AM_CFLAGS = \
+ -DPREFIX=\"${prefix}\" \
+ -DSYSCONFDIR=\"${GNC_CONFIGDIR}\" \
+ -DDATADIR=\"${GNC_SHAREDIR}\" \
+ -DLIBDIR=\"${GNC_LIBDIR}\" \
+ -I${top_srcdir}/src/core-utils \
+ -I${top_srcdir}/src/gnc-module \
+ -I${top_srcdir}/src/engine \
+ -I${top_srcdir}/src/backend/file \
+ -I${top_srcdir}/src/network-utils \
+ -I${top_srcdir}/src/app-utils \
+ -I${top_srcdir}/src \
+ ${LIBGUPPI_CFLAGS} \
+ ${GLIB_CFLAGS} \
+ ${GLADE_CFLAGS} \
+ ${GNOME_PRINT_CFLAGS} \
+ ${GNOME_CFLAGS} \
+ ${GTKHTML_CFLAGS} \
+ ${GUILE_INCS} \
+ ${G_WRAP_COMPILE_ARGS} \
+ ${GSF_CFLAGS} \
+ ${LIBGOFFICE_CFLAGS}
+else
AM_CFLAGS = \
-DPREFIX=\"${prefix}\" \
-DSYSCONFDIR=\"${GNC_CONFIGDIR}\" \
@@ -28,7 +54,7 @@
${GUILE_INCS} \
${G_WRAP_COMPILE_ARGS} \
${GSF_CFLAGS}
-
+endif
libgncmod_gnome_utils_la_SOURCES = \
QuickFill.c \
@@ -171,6 +197,28 @@
libgncmod_gnome_utils_la_LDFLAGS = -module
+if USE_LIBGOFFICE
+libgncmod_gnome_utils_la_LIBADD = \
+ ${top_builddir}/src/core-utils/libcore-utils.la \
+ ${top_builddir}/src/gnc-module/libgncmodule.la \
+ ${top_builddir}/src/engine/libgncmod-engine.la \
+ ${top_builddir}/src/calculation/libgncmod-calculation.la \
+ ${top_builddir}/src/network-utils/libgncmod-network-utils.la \
+ ${top_builddir}/src/app-utils/libgncmod-app-utils.la \
+ ${LIBGUPPI_LIBS} \
+ ${GNOME_LIBS} \
+ ${GNOME_PRINT_LIBS} \
+ ${GTKHTML_LIBS} \
+ ${GUILE_LIBS} \
+ ${GDK_PIXBUF_LIBS} \
+ ${GLADE_LIBS} \
+ ${GUILE_LIBS} \
+ ${GLIB_LIBS} \
+ ${DB_LIBS} \
+ ${GSF_LIBS} \
+ ${LIBGOFFICE_LIBS} \
+ ${XML_LIBS}
+else
libgncmod_gnome_utils_la_LIBADD = \
${top_builddir}/src/core-utils/libcore-utils.la \
${top_builddir}/src/gnc-module/libgncmodule.la \
@@ -191,6 +239,7 @@
${DB_LIBS} \
${GSF_LIBS} \
${XML_LIBS}
+endif
libgw_gnome_utils_la_SOURCES = gw-gnome-utils.c
libgw_gnome_utils_la_LDFLAGS = -module
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/Makefile.am,v
retrieving revision 1.107.4.26
retrieving revision 1.107.4.27
diff -Lsrc/gnome/Makefile.am -Lsrc/gnome/Makefile.am -u -r1.107.4.26 -r1.107.4.27
--- src/gnome/Makefile.am
+++ src/gnome/Makefile.am
@@ -9,7 +9,6 @@
libgncgnome_la_LDFLAGS = -module
libgncgnome_la_LIBADD = \
${top_builddir}/src/engine/libgncmod-engine.la \
- ${top_builddir}/src/backend/file/libgncmod-backend-file.la \
${top_builddir}/src/report/report-system/libgncmod-report-system.la \
${top_builddir}/src/report/report-gnome/libgncmod-report-gnome.la \
${top_builddir}/src/register/ledger-core/libgncmod-ledger-core.la \
@@ -56,7 +55,26 @@
reconcile-list.c \
top-level.c \
window-main-summarybar.c \
- window-reconcile.c
+ window-reconcile.c \
+ ${top_srcdir}/src/backend/file/sixtp-dom-parsers.c \
+ ${top_srcdir}/src/backend/file/sixtp-dom-generators.c \
+ ${top_srcdir}/src/backend/file/sixtp-utils.c \
+ ${top_srcdir}/src/backend/file/sixtp.c \
+ ${top_srcdir}/src/backend/file/sixtp-stack.c \
+ ${top_srcdir}/src/backend/file/sixtp-to-dom-parser.c \
+ ${top_srcdir}/src/backend/file/io-example-account.c \
+ ${top_srcdir}/src/backend/file/gnc-account-xml-v2.c \
+ ${top_srcdir}/src/backend/file/io-gncxml-gen.c \
+ ${top_srcdir}/src/backend/file/io-gncxml-v2.c \
+ ${top_srcdir}/src/backend/file/io-utils.c \
+ ${top_srcdir}/src/backend/file/gnc-lot-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-schedxaction-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-freqspec-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-transaction-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-commodity-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-book-xml-v2.c \
+ ${top_srcdir}/src/backend/file/gnc-pricedb-xml-v2.c
+
gnomeappdir = ${datadir}/gnome/apps/Applications
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/qif-import/test/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -Lsrc/import-export/qif-import/test/Makefile.am -Lsrc/import-export/qif-import/test/Makefile.am -u -r1.2 -r1.2.4.1
--- src/import-export/qif-import/test/Makefile.am
+++ src/import-export/qif-import/test/Makefile.am
@@ -2,6 +2,11 @@
noinst_PROGRAMS=test-link
-test_link_SOURCES=test-link.c
+test_link_SOURCES = \
+ test-link.c
+
test_link_LDADD=../libgncmod-qif-import.la \
- ${top_builddir}/src/gnome/libgncgnome.la
+ ${top_builddir}/src/gnome/libgncgnome.la \
+ ${top_builddir}/src/app-utils/libgncmod-app-utils.la \
+ ${LIBXML2_LIBS}
+
More information about the gnucash-changes
mailing list