[Gnucash-changes] r14296 - gnucash/trunk - Refactor the file backend into a shared library and a loadable module.

Derek Atkins warlord at cvs.gnucash.org
Thu Jun 1 21:50:03 EDT 2006


Author: warlord
Date: 2006-06-01 21:50:02 -0400 (Thu, 01 Jun 2006)
New Revision: 14296
Trac: http://svn.gnucash.org/trac/changeset/14296

Removed:
   gnucash/trunk/src/backend/gnc-backend-api.h
Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/backend/Makefile.am
   gnucash/trunk/src/backend/file/Makefile.am
   gnucash/trunk/src/backend/file/gnc-backend-file.c
   gnucash/trunk/src/backend/file/gnc-backend-file.h
   gnucash/trunk/src/business/business-core/file/Makefile.am
   gnucash/trunk/src/gnome/Makefile.am
Log:
Refactor the file backend into a shared library and a loadable module.
This should let us build on both Win32 AND MacOS, and means we don't
need to compile the file-backend sources multiple times.



Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-06-02 01:45:45 UTC (rev 14295)
+++ gnucash/trunk/ChangeLog	2006-06-02 01:50:02 UTC (rev 14296)
@@ -7,6 +7,20 @@
 
 	* po/nb.po: updated Norwegian Bokmål translation by Sigve Indregard
 
+	* src/backend/Makefile.am:
+	* src/backend/gnc-backend-api.h:
+	  deleted gnc-backend-api.h, which isn't needed by anything
+	* src/backend/file/gnc-backend-file.[ch]:
+	  make "gnc_new_backend()" into a private function.  It's
+	  never called from anywhere, so it's not needed in the API.
+	* src/backend/file/Makefile.am:
+	  Build a shared library (libgnc-backend-file-utils) and a
+	  loadable module (libgnc-backend-file).  This should let us
+	  build on MacOS AND windows.
+	* src/business/business-core/file/Makefile.am:
+	* src/gnome/Makefile.am:
+	  link against libgnc-backend-file-utils
+
 2006-06-01  Andreas Köhler  <andi5.py at gmx.net>
 
 	* src/gnome-utils/dialog-preferences.c: Do not try to find

Modified: gnucash/trunk/src/backend/Makefile.am
===================================================================
--- gnucash/trunk/src/backend/Makefile.am	2006-06-02 01:45:45 UTC (rev 14295)
+++ gnucash/trunk/src/backend/Makefile.am	2006-06-02 01:50:02 UTC (rev 14296)
@@ -1,5 +1,3 @@
 
 SUBDIRS = file ${SQL_DIR}
 DIST_SUBDIRS = file postgres
-
-noinst_HEADERS = gnc-backend-api.h

Modified: gnucash/trunk/src/backend/file/Makefile.am
===================================================================
--- gnucash/trunk/src/backend/file/Makefile.am	2006-06-02 01:45:45 UTC (rev 14295)
+++ gnucash/trunk/src/backend/file/Makefile.am	2006-06-02 01:50:02 UTC (rev 14296)
@@ -1,7 +1,7 @@
 SUBDIRS = . test
 
-#Now a shared GModule, not a package library.
-lib_LTLIBRARIES = libgnc-backend-file.la
+# Now a shared library AND a GModule
+lib_LTLIBRARIES = libgnc-backend-file-utils.la  libgnc-backend-file.la
 
 AM_CFLAGS = \
   -I.. -I../.. \
@@ -15,9 +15,8 @@
   ${GLIB_CFLAGS} \
   ${GCONF_CFLAGS}
 
-libgnc_backend_file_la_SOURCES = \
+libgnc_backend_file_utils_la_SOURCES = \
   gnc-account-xml-v2.c \
-  gnc-backend-file.c \
   gnc-book-xml-v2.c \
   gnc-budget-xml-v2.c \
   gnc-commodity-xml-v2.c \
@@ -40,6 +39,9 @@
   sixtp-utils.c \
   sixtp.c
 
+libgnc_backend_file_la_SOURCES = \
+  gnc-backend-file.c
+
 noinst_HEADERS = \
   gnc-backend-file.h \
   gnc-xml.h \
@@ -57,9 +59,16 @@
   sixtp-stack.h \
   sixtp-utils.h
 
+libgnc_backend_file_utils_la_LIBADD = \
+   ${GLIB_LIBS} ${GCONF_LIBS} ${LIBXML2_LIBS} \
+   ${top_builddir}/src/engine/libgncmod-engine.la \
+   ${top_builddir}/src/core-utils/libcore-utils.la \
+   ${QOF_LIBS}
+
 libgnc_backend_file_la_LDFLAGS = -module -avoid-version
 libgnc_backend_file_la_LIBADD = \
    ${GLIB_LIBS} ${GCONF_LIBS} ${LIBXML2_LIBS} \
    ${top_builddir}/src/engine/libgncmod-engine.la \
    ${top_builddir}/src/core-utils/libcore-utils.la \
+   libgnc-backend-file-utils.la \
    ${QOF_LIBS}

Modified: gnucash/trunk/src/backend/file/gnc-backend-file.c
===================================================================
--- gnucash/trunk/src/backend/file/gnc-backend-file.c	2006-06-02 01:45:45 UTC (rev 14295)
+++ gnucash/trunk/src/backend/file/gnc-backend-file.c	2006-06-02 01:50:02 UTC (rev 14296)
@@ -45,6 +45,7 @@
 #include <dirent.h>
 #include <time.h>
 
+#include "qof.h"
 #include "TransLog.h"
 #include "gnc-engine.h"
 
@@ -53,7 +54,6 @@
 #include "io-gncxml.h"
 #include "io-gncbin.h"
 #include "io-gncxml-v2.h"
-#include "gnc-backend-api.h"
 #include "gnc-backend-file.h"
 #include "gnc-gconf-utils.h"
 
@@ -945,7 +945,7 @@
         be->file_compression = gnc_gconf_get_bool("general", "file_compression", NULL);
 }
 
-QofBackend*
+static QofBackend*
 gnc_backend_new(void)
 {
 	FileBackend *gnc_be;

Modified: gnucash/trunk/src/backend/file/gnc-backend-file.h
===================================================================
--- gnucash/trunk/src/backend/file/gnc-backend-file.h	2006-06-02 01:45:45 UTC (rev 14295)
+++ gnucash/trunk/src/backend/file/gnc-backend-file.h	2006-06-02 01:50:02 UTC (rev 14296)
@@ -53,7 +53,8 @@
 
 typedef struct FileBackend_struct FileBackend;
 
-QofBackend * libgncmod_backend_file_LTX_gnc_backend_new(void);
+// This is now a static inside the module
+//QofBackend * libgncmod_backend_file_LTX_gnc_backend_new(void);
 
 G_MODULE_EXPORT const gchar *
 g_module_check_init(GModule *module);

Deleted: gnucash/trunk/src/backend/gnc-backend-api.h
===================================================================
--- gnucash/trunk/src/backend/gnc-backend-api.h	2006-06-02 01:45:45 UTC (rev 14295)
+++ gnucash/trunk/src/backend/gnc-backend-api.h	2006-06-02 01:50:02 UTC (rev 14296)
@@ -1,31 +0,0 @@
-/********************************************************************\
- * gnc-backend-api.h -- public functions needed by gnucash backends *
- * Copyright (C) 2001 Linux Developers Group, Inc.                  *
- *                                                                  *
- * 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, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
- * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
- *                                                                  *
-\********************************************************************/
-
-#ifndef GNC_BACKEND_API_H
-#define GNC_BACKEND_API_H
-
-#include "qof.h"
-
-QofBackend * gnc_backend_new (void);
-
-#endif

Modified: gnucash/trunk/src/business/business-core/file/Makefile.am
===================================================================
--- gnucash/trunk/src/business/business-core/file/Makefile.am	2006-06-02 01:45:45 UTC (rev 14295)
+++ gnucash/trunk/src/business/business-core/file/Makefile.am	2006-06-02 01:50:02 UTC (rev 14296)
@@ -43,15 +43,9 @@
 
 libgncmod_business_backend_file_la_LDFLAGS = -module
 
-# When building on windows, the following variable must also contain
-# ${top_builddir}/src/backend/file/libgnc-backend-file.la, which won't
-# build on MacOSX because libgnc-backend-file.so is a module and not a
-# library. This problem has to be solved on an architectural basis by
-# probably moving the relevant portion of libgnc-backend-file.so into
-# a new shared library which will be used by both the gnc-backend-file
-# module and this module here (and libgncgnome.so, too)
 libgncmod_business_backend_file_la_LIBADD = \
   ${top_builddir}/src/business/business-core/libgncmod-business-core.la \
+  ${top_builddir}/src/backend/file/libgnc-backend-file-utils.la \
   ${top_builddir}/src/engine/libgncmod-engine.la \
   ${top_builddir}/src/gnc-module/libgncmodule.la \
   ${LIBXML2_LIBS} \

Modified: gnucash/trunk/src/gnome/Makefile.am
===================================================================
--- gnucash/trunk/src/gnome/Makefile.am	2006-06-02 01:45:45 UTC (rev 14295)
+++ gnucash/trunk/src/gnome/Makefile.am	2006-06-02 01:50:02 UTC (rev 14296)
@@ -14,6 +14,7 @@
   ${top_builddir}/src/report/report-system/libgncmod-report-system.la \
   ${top_builddir}/src/gnome-search/libgncmod-gnome-search.la \
   ${top_builddir}/src/gnome-utils/libgncmod-gnome-utils.la \
+  ${top_builddir}/src/backend/file/libgnc-backend-file-utils.la \
   ${top_builddir}/src/app-utils/libgncmod-app-utils.la \
   ${top_builddir}/src/engine/libgw-engine.la \
   ${top_builddir}/src/engine/libgncmod-engine.la \
@@ -61,31 +62,8 @@
   lot-viewer.c \
   reconcile-list.c \
   top-level.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/io-gncbin-r.c \
-  ${top_srcdir}/src/backend/file/io-gncxml-gen.c \
-  ${top_srcdir}/src/backend/file/io-gncxml-v1.c \
-  ${top_srcdir}/src/backend/file/io-gncxml-v2.c \
-  ${top_srcdir}/src/backend/file/io-utils.c \
-  ${top_srcdir}/src/backend/file/gnc-account-xml-v2.c \
-  ${top_srcdir}/src/backend/file/gnc-budget-xml-v2.c \
-  ${top_srcdir}/src/backend/file/gnc-lot-xml-v2.c \
-  ${top_srcdir}/src/backend/file/gnc-recurrence-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
+  window-reconcile.c
 
-
 gnomeappdir = ${datadir}/applications
 
 gnomeapp_in_files = gnucash.desktop.in



More information about the gnucash-changes mailing list