From 342627d5271e4b85f739f1a6675f92052bae0511 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Fri, 4 Aug 2017 19:17:07 +0200 Subject: [PATCH] Remove the gncmod boilerplate from standard-reports and utility-reports This adds unnecessary overhead and also serves as an initial experiment to greatly reduce the gnc-module based modularization. Oh, and it fixes the autotools make check failure in standard-reports which I introduced in the previous commit. The fix was to either fully gnc-modularize business reports or to go to de-gnc-modularize standard-reports. I chose the latter as I don't want to add any new gnc-modules any more at this point. --- configure.ac | 5 -- po/POTFILES.in | 4 - src/README.modules | 33 +++---- src/bin/gnucash-bin.c | 2 - src/bin/overrides/gnucash-build-env.in | 3 - src/cmake_modules/MakeDistFiles.cmake | 2 - src/engine/gnc-engine.c | 2 +- src/report/business-reports/CMakeLists.txt | 2 +- src/report/business-reports/Makefile.am | 5 +- .../business-reports/business-reports.scm | 2 +- src/report/report-gnome/CMakeLists.txt | 2 +- src/report/report-gnome/Makefile.am | 4 + src/report/report-gnome/gncmod-report-gnome.c | 5 ++ src/report/report-gnome/report-gnome.scm | 2 +- src/report/report-gnome/test/Makefile.am | 3 +- src/report/standard-reports/CMakeLists.txt | 26 +----- src/report/standard-reports/Makefile.am | 27 +----- .../gncmod-standard-reports.c | 85 ------------------- .../standard-reports/test/CMakeLists.txt | 4 +- src/report/standard-reports/test/Makefile.am | 8 +- .../standard-reports/test/test-load-module.in | 20 ----- src/report/utility-reports/CMakeLists.txt | 29 +------ src/report/utility-reports/Makefile.am | 24 +----- .../utility-reports/gncmod-utility-reports.c | 81 ------------------ .../utility-reports/test/CMakeLists.txt | 6 -- src/report/utility-reports/test/Makefile.am | 35 -------- .../utility-reports/test/test-load-module.in | 20 ----- 27 files changed, 39 insertions(+), 402 deletions(-) delete mode 100644 src/report/standard-reports/gncmod-standard-reports.c delete mode 100755 src/report/standard-reports/test/test-load-module.in delete mode 100644 src/report/utility-reports/gncmod-utility-reports.c delete mode 100644 src/report/utility-reports/test/CMakeLists.txt delete mode 100644 src/report/utility-reports/test/Makefile.am delete mode 100755 src/report/utility-reports/test/test-load-module.in diff --git a/configure.ac b/configure.ac index 05970ed656..f1e5c023d9 100644 --- a/configure.ac +++ b/configure.ac @@ -1773,7 +1773,6 @@ AC_CONFIG_FILES( src/report/stylesheets/Makefile src/report/stylesheets/test/Makefile src/report/utility-reports/Makefile - src/report/utility-reports/test/Makefile src/report/jqplot/Makefile src/scm/Makefile src/scm/gnumeric/Makefile @@ -1850,12 +1849,8 @@ AC_CONFIG_FILES([src/report/report-gnome/test/test-load-module], [chmod +x src/report/report-gnome/test/test-load-module]) AC_CONFIG_FILES([src/report/report-system/test/test-load-module], [chmod +x src/report/report-system/test/test-load-module]) -AC_CONFIG_FILES([src/report/standard-reports/test/test-load-module], - [chmod +x src/report/standard-reports/test/test-load-module]) AC_CONFIG_FILES([src/report/stylesheets/test/test-load-module], [chmod +x src/report/stylesheets/test/test-load-module]) -AC_CONFIG_FILES([src/report/utility-reports/test/test-load-module], - [chmod +x src/report/utility-reports/test/test-load-module]) AC_CONFIG_FILES([src/tax/us/test/test-load-module], [chmod +x src/tax/us/test/test-load-module]) diff --git a/po/POTFILES.in b/po/POTFILES.in index 2e1917d49b..0ec2b3fcc1 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -275,8 +275,6 @@ src/gnome/top-level.c src/gnome/window-autoclear.c src/gnome/window-reconcile2.c src/gnome/window-reconcile.c -src/gnome-business/business-gnome.scm -src/gnome-business/gncmod-business-gnome.c src/gnome-search/dialog-search.c src/gnome-search/dialog-search.glade src/gnome-search/gnc-general-search.c @@ -640,7 +638,6 @@ src/report/standard-reports/daily-reports.scm src/report/standard-reports/equity-statement.scm src/report/standard-reports/general-journal.scm src/report/standard-reports/general-ledger.scm -src/report/standard-reports/gncmod-standard-reports.c src/report/standard-reports/income-statement.scm src/report/standard-reports/net-barchart.scm src/report/standard-reports/net-linechart.scm @@ -659,7 +656,6 @@ src/report/stylesheets/stylesheet-footer.scm src/report/stylesheets/stylesheet-head-or-tail.scm src/report/stylesheets/stylesheet-plain.scm src/report/stylesheets/stylesheets.scm -src/report/utility-reports/gncmod-utility-reports.c src/report/utility-reports/hello-world.scm src/report/utility-reports/utility-reports.scm src/report/utility-reports/view-column.scm diff --git a/src/README.modules b/src/README.modules index 22178590ac..3bc005b664 100644 --- a/src/README.modules +++ b/src/README.modules @@ -1,25 +1,22 @@ -*-text-*- 'Modules' in Gnucash are relatively self-contained segments of code that -can be dynamically loaded at runtime. Eventually we want the whole gnucash -source tree to be a set of modules and the app itself to be a short Scheme -program that loads them all. +can be dynamically loaded at runtime. While this may have been a great +design when gnucash was pure guile, it turns out this needlessly complicates +the current mix of C, C++ and guile. So expect this gnc-module based +modularization to be greatly reduced in the future. All the core parts should +be loadable straight away as dynamic libraries. This is currently not feasible +so the gnc-module functionality will still be around for some time and perhaps +forever as a way to extend gnucash with external code. We're not there yet :) -core-utils The lowest level. Very basic code. - Should not depend on any other modules. - This module is not a gnc-module (and - perhaps shouldn't be). - -Here are the bits that have been converted to use the module system so -far. +Here are the bits that are still using the module system so far (this list is probably +outdated already, but can serve as a starting point to figure out which modules +can already be de-modularized):. gnc-module The module system (actually not a module itself) -calculation Low-level expression parsing & financial - equation solving. - engine The engine module, without any backends backend/xml Binary and XML (v1 and v2) backends @@ -34,14 +31,10 @@ register/register-core Toolkit independent register code, formerly in register/register-gnome Gnome-specific register code, formerly in src/register/gnome -import-export/binary-import utils for importing old GnuCash binary files - import-export/qif-import the old qif importer with Gnome druid import-export/qif-io-core new qif import/export module. unfinished. report/report-system the report infrastructure and HTML handling -report/standard-reports most of the reports that are in gnucash -report/utility-reports the multicolumn view, the iframe report, etc. report/locale-specific-reports reports that should only be loaded in certain locales. subdir per locale. report/stylesheets predefined style sheet templates @@ -50,14 +43,8 @@ report/report-gnome Gnome gui for displaying reports. app-utils utils for the gnucash app framework (component mgr, cmd line processing, gettext stuff, etc) -app-file application-level file handling - gnome-utils Extensions and utilities for using Gnome/Gtk with GnuCash, including new widgets. -network-utils Utils for network communication. - tax/us US tax information -(RPC was removed in v.1.9.0, subversion release: 12018) - diff --git a/src/bin/gnucash-bin.c b/src/bin/gnucash-bin.c index 9d2ad76cbc..fe4ceecea4 100644 --- a/src/bin/gnucash-bin.c +++ b/src/bin/gnucash-bin.c @@ -505,8 +505,6 @@ load_gnucash_modules() { "gnucash/import-export/aqbanking", 0, TRUE }, { "gnucash/report/report-system", 0, FALSE }, { "gnucash/report/stylesheets", 0, FALSE }, - { "gnucash/report/standard-reports", 0, FALSE }, - { "gnucash/report/utility-reports", 0, FALSE }, { "gnucash/report/locale-specific/us", 0, FALSE }, { "gnucash/report/report-gnome", 0, FALSE }, { "gnucash/gtkmm", 0, TRUE }, diff --git a/src/bin/overrides/gnucash-build-env.in b/src/bin/overrides/gnucash-build-env.in index 8e3aaeb3ad..58f6112636 100644 --- a/src/bin/overrides/gnucash-build-env.in +++ b/src/bin/overrides/gnucash-build-env.in @@ -39,9 +39,6 @@ eval `${top_srcdir}/src/gnc-test-env.pl \ --gnc-module-dir ${top_builddir}/src/app-utils \ --gnc-module-dir ${top_builddir}/src/gnome-utils \ --gnc-module-dir ${top_builddir}/src/gnome-search \ - --gnc-module-dir ${top_builddir}/src/report/report-system \ - --gnc-module-dir ${top_builddir}/src/report/standard-reports \ - --gnc-module-dir ${top_builddir}/src/report/utility-reports \ --gnc-module-dir ${top_builddir}/src/report/locale-specific/us \ --gnc-module-dir ${top_builddir}/src/report/report-gnome \ --gnc-module-dir ${top_builddir}/src/report/stylesheets \ diff --git a/src/cmake_modules/MakeDistFiles.cmake b/src/cmake_modules/MakeDistFiles.cmake index 3e91e291b1..fbddb2ad7d 100644 --- a/src/cmake_modules/MakeDistFiles.cmake +++ b/src/cmake_modules/MakeDistFiles.cmake @@ -78,9 +78,7 @@ SET(COPY_FROM_BUILD src/report/report-gnome/test/test-load-module src/report/report-system/swig-report-system.c src/report/report-system/test/test-load-module - src/report/standard-reports/test/test-load-module src/report/stylesheets/test/test-load-module - src/report/utility-reports/test/test-load-module src/scm/build-config.scm src/swig-runtime.h src/test-core/swig-unittest-support-guile.c diff --git a/src/engine/gnc-engine.c b/src/engine/gnc-engine.c index f732750a00..fd6bf11939 100644 --- a/src/engine/gnc-engine.c +++ b/src/engine/gnc-engine.c @@ -91,7 +91,7 @@ gnc_engine_init_part2() #ifdef WIN32 #define LIBDIR "bin" #else -#define LIBDIR "lib" +#define LIBDIR "lib/gnucash" #endif #else pkglibdir = g_build_path (G_DIR_SEPARATOR_S, builddir, diff --git a/src/report/business-reports/CMakeLists.txt b/src/report/business-reports/CMakeLists.txt index 83bc14dcec..9e67d08016 100644 --- a/src/report/business-reports/CMakeLists.txt +++ b/src/report/business-reports/CMakeLists.txt @@ -31,7 +31,7 @@ SET(GUILE_LOAD_DIRS src/app-utils src/core-utils src/engine src/gnc-module sr src/report/business_reports src/report/report-system src/report/standard-reports) SET(GUILE_LIBRARY_DIRS src/app-utils src/core-utils src/engine src/gnc-module src/gnome-utils src/report/report-system src/report/standard-reports) -SET(GUILE_DEPENDS scm-business-reports-links gncmod-standard-reports scm-standard-reports) +SET(GUILE_DEPENDS scm-business-reports-links scm-standard-reports) GNC_ADD_SCHEME_TARGETS(scm-business-reports "${business_reports_SCHEME}" diff --git a/src/report/business-reports/Makefile.am b/src/report/business-reports/Makefile.am index babf228bed..a15a37a1ce 100644 --- a/src/report/business-reports/Makefile.am +++ b/src/report/business-reports/Makefile.am @@ -53,8 +53,6 @@ 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 \ - --gnc-module-dir ${top_builddir}/src/report/business-reports \ --guile-load-dir ${top_builddir}/src/app-utils \ --guile-load-dir ${top_builddir}/src/core-utils \ --guile-load-dir ${top_builddir}/src/engine \ @@ -73,8 +71,7 @@ GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/backend/sql \ --library-dir ${top_builddir}/src/html \ --library-dir ${top_builddir}/src/gnc-module \ - --library-dir ${top_builddir}/src/report/report-system \ - --library-dir ${top_builddir}/src/report/business-reports + --library-dir ${top_builddir}/src/report/report-system %.go : %.scm .scm-links $(pkglib_LTLIBRARIES) diff --git a/src/report/business-reports/business-reports.scm b/src/report/business-reports/business-reports.scm index 48e8d02f47..03d7cd32ce 100644 --- a/src/report/business-reports/business-reports.scm +++ b/src/report/business-reports/business-reports.scm @@ -27,7 +27,7 @@ (use-modules (gnucash gnc-module)) (use-modules (gnucash app-utils)) (use-modules (gnucash report report-system)) -(gnc:module-load "gnucash/report/standard-reports" 0) +(use-modules (gnucash report standard-reports)) ;; to define gnc-build-url (gnc:module-load "gnucash/html" 0) diff --git a/src/report/report-gnome/CMakeLists.txt b/src/report/report-gnome/CMakeLists.txt index 263b2940d6..f6223e8d95 100644 --- a/src/report/report-gnome/CMakeLists.txt +++ b/src/report/report-gnome/CMakeLists.txt @@ -53,7 +53,7 @@ SET(GUILE_OUTPUT_DIR gnucash/report) SET(GUILE_MODULES src/app-utils src/scm src/engine src/gnc-module src/gnome-utils src/reports/report-system src/report/utility-reports) SET(GUILE_LOAD_DIRS src/app-utils src/gnc-module src/engine src/scm src/core-utils src/gnome-utils) SET(GUILE_LIBRARY_DIRS src/app-utils src/core-utils src/engine src/gnc-module src/gnome-utils src/report-gnome) -SET(GUILE_DEPENDS gncmod-report-gnome gncmod-engine scm-app-utils scm-gnome-utils scm-core-utils scm-gnc-module scm-scm) +SET(GUILE_DEPENDS gncmod-report-gnome gncmod-engine scm-app-utils scm-gnome-utils scm-core-utils scm-gnc-module scm-scm scm-standard-reports scm-business-reports scm-utility-reports) GNC_ADD_SCHEME_TARGETS(scm-report-gnome "${report_gnome_SCHEME}" diff --git a/src/report/report-gnome/Makefile.am b/src/report/report-gnome/Makefile.am index 9c2a163706..39a7bf33c4 100644 --- a/src/report/report-gnome/Makefile.am +++ b/src/report/report-gnome/Makefile.am @@ -109,11 +109,15 @@ 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/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/report/utility-reports \ --guile-load-dir ${top_builddir}/src/scm \ --library-dir ${top_builddir}/src/engine \ --library-dir ${top_builddir}/src/libqof/qof \ diff --git a/src/report/report-gnome/gncmod-report-gnome.c b/src/report/report-gnome/gncmod-report-gnome.c index ea04c2cfc0..70da204d46 100644 --- a/src/report/report-gnome/gncmod-report-gnome.c +++ b/src/report/report-gnome/gncmod-report-gnome.c @@ -87,6 +87,11 @@ libgncmod_report_gnome_gnc_module_init(int refcount) { return FALSE; } + + lmod ("(gnucash report standard-reports)"); + lmod ("(gnucash report business-reports)"); + lmod ("(gnucash report utility-reports)"); + scm_init_sw_report_gnome_module(); lmod ("(sw_report_gnome)"); diff --git a/src/report/report-gnome/report-gnome.scm b/src/report/report-gnome/report-gnome.scm index 460d5583ed..5f07220707 100644 --- a/src/report/report-gnome/report-gnome.scm +++ b/src/report/report-gnome/report-gnome.scm @@ -29,6 +29,7 @@ (use-modules (gnucash gnc-module)) (use-modules (gnucash gnome-utils)) (use-modules (gnucash gettext)) +(use-modules (gnucash report utility-reports)) (use-modules (gnucash printf)) @@ -43,7 +44,6 @@ (gnc:module-load "gnucash/gnome-utils" 0) (gnc:module-load "gnucash/report/report-system" 0) -(gnc:module-load "gnucash/report/utility-reports" 0) (export gnc:report-menu-setup) (export gnc:add-report-template-menu-items) diff --git a/src/report/report-gnome/test/Makefile.am b/src/report/report-gnome/test/Makefile.am index 103a4fb797..1c0897929f 100644 --- a/src/report/report-gnome/test/Makefile.am +++ b/src/report/report-gnome/test/Makefile.am @@ -25,7 +25,6 @@ GNC_TEST_DEPS = --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 \ - --gnc-module-dir ${top_builddir}/src/report/utility-reports \ --gnc-module-dir ${top_builddir}/src/report/report-gnome \ \ --guile-load-dir ${top_builddir}/src/gnc-module \ @@ -35,6 +34,8 @@ GNC_TEST_DEPS = --gnc-module-dir ${top_builddir}/src/engine \ --guile-load-dir ${top_builddir}/src/app-utils \ --guile-load-dir ${top_builddir}/src/gnome-utils \ --guile-load-dir ${top_builddir}/src/report/report-system \ + --guile-load-dir ${top_builddir}/src/report/standard-reports \ + --guile-load-dir ${top_builddir}/src/report/business-reports \ --guile-load-dir ${top_builddir}/src/report/utility-reports \ --guile-load-dir ${top_builddir}/src/report/report-gnome \ \ diff --git a/src/report/standard-reports/CMakeLists.txt b/src/report/standard-reports/CMakeLists.txt index ce8bd3648b..159e67c553 100644 --- a/src/report/standard-reports/CMakeLists.txt +++ b/src/report/standard-reports/CMakeLists.txt @@ -1,26 +1,6 @@ ADD_SUBDIRECTORY(test) -SET(standard_reports_SOURCES gncmod-standard-reports.c) - -ADD_LIBRARY (gncmod-standard-reports ${standard_reports_SOURCES}) - -TARGET_LINK_LIBRARIES(gncmod-standard-reports gnc-module ${GTK3_LDFLAGS}) - -TARGET_COMPILE_DEFINITIONS(gncmod-standard-reports PRIVATE -DG_LOG_DOMAIN=\"gnc.report.standard\") - -TARGET_INCLUDE_DIRECTORIES(gncmod-standard-reports PRIVATE ${GUILE_INCLUDE_DIRS}) - -INSTALL(TARGETS gncmod-standard-reports - LIBRARY DESTINATION lib/gnucash - ARCHIVE DESTINATION lib/gnucash - RUNTIME DESTINATION bin) - -# No headers to install - - -# Scheme - SET (standard_reports_SCHEME standard-reports.scm) SET (standard_reports_SCHEME_2 @@ -56,7 +36,7 @@ SET(GUILE_LOAD_DIRS src/app-utils src/engine src/core-utils src/gnc-module sr SET(GUILE_LIBRARY_DIRS src/app-utils src/engine src/core-utils src/gnc-module src/gnome-utils src/report/report-system) SET(GUILE_DEPENDS gncmod-html scm-app-utils scm-gnome-utils scm-report-system scm-report-system-3) -GNC_ADD_SCHEME_TARGETS(scm-standard-reports +GNC_ADD_SCHEME_TARGETS(scm-standard-reports-1 "${standard_reports_SCHEME}" "gnucash/report" "${GUILE_MODULES}" @@ -76,6 +56,8 @@ GNC_ADD_SCHEME_TARGETS(scm-standard-reports-2 TRUE ) +ADD_CUSTOM_TARGET(scm-standard-reports ALL DEPENDS scm-standard-reports-2 scm-standard-reports) + # FIXME: This is a hack since core-utils assumes an autotools build environment. SET(STD_RPT_DIR ${CMAKE_CURRENT_BINARY_DIR}/gnucash/report) @@ -85,5 +67,5 @@ FILE(COPY standard-reports.scm DESTINATION ${STD_RPT_DIR}) FILE(MAKE_DIRECTORY ${STD_RPT_DIR}/standard-reports) FILE(COPY ${standard_reports_SCHEME_2} DESTINATION ${STD_RPT_DIR}/standard-reports) -SET_LOCAL_DIST(standard_reports_DIST_local CMakeLists.txt Makefile.am ${standard_reports_SOURCES} ${standard_reports_SCHEME} ${standard_reports_SCHEME_2}) +SET_LOCAL_DIST(standard_reports_DIST_local CMakeLists.txt Makefile.am ${standard_reports_SCHEME} ${standard_reports_SCHEME_2}) SET(standard_reports_DIST ${standard_reports_DIST_local} ${test_standard_reports_DIST} PARENT_SCOPE) diff --git a/src/report/standard-reports/Makefile.am b/src/report/standard-reports/Makefile.am index e9678cebed..42f215cfcf 100644 --- a/src/report/standard-reports/Makefile.am +++ b/src/report/standard-reports/Makefile.am @@ -1,23 +1,5 @@ SUBDIRS = . test -pkglib_LTLIBRARIES = libgncmod-standard-reports.la - -libgncmod_standard_reports_la_SOURCES = \ - gncmod-standard-reports.c - -libgncmod_standard_reports_la_LDFLAGS = -avoid-version - -libgncmod_standard_reports_la_LIBADD = \ - ${top_builddir}/src/gnc-module/libgnc-module.la \ - ${GUILE_LIBS} \ - ${GLIB_LIBS} - -AM_CPPFLAGS = \ - -I${top_srcdir}/src \ - -I${top_srcdir}/src/gnc-module \ - ${GUILE_CFLAGS} \ - ${GLIB_CFLAGS} - gncscmmoddir = ${GNC_SCM_INSTALL_DIR}/gnucash/report/ gncscmmod_DATA = \ standard-reports.scm @@ -81,7 +63,6 @@ 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 \ @@ -99,8 +80,7 @@ GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/backend/xml \ --library-dir ${top_builddir}/src/backend/sql \ --library-dir ${top_builddir}/src/html \ - --library-dir ${top_builddir}/src/report/report-system \ - --library-dir ${top_builddir}/src/report/standard-reports + --library-dir ${top_builddir}/src/report/report-system %.go : %.scm .scm-links $(pkglib_LTLIBRARIES) GNC_UNINSTALLED=yes \ @@ -127,10 +107,9 @@ EXTRA_DIST = \ CLEANFILES = \ .scm-links \ - ${SCM_FILE_LINK} \ ${gncscmmodcache_DATA} \ ${gncscmrptcache_DATA} -DISTCLEANFILES = +DISTCLEANFILES = ${SCM_FILE_LINKS} -AM_CPPFLAGS += -DG_LOG_DOMAIN=\"gnc.report.standard\" +AM_CPPFLAGS = -DG_LOG_DOMAIN=\"gnc.report.standard\" diff --git a/src/report/standard-reports/gncmod-standard-reports.c b/src/report/standard-reports/gncmod-standard-reports.c deleted file mode 100644 index 43bdf67c65..0000000000 --- a/src/report/standard-reports/gncmod-standard-reports.c +++ /dev/null @@ -1,85 +0,0 @@ -/********************************************************************* - * gncmod-standard-reports.c - * module definition/initialization for the standard reports - * - * 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@gnu.org * - * * -\********************************************************************/ - - -#include "config.h" -#include -#include - -#include "gnc-module.h" -#include "gnc-module-api.h" - -GNC_MODULE_API_DECL(libgncmod_standard_reports) - -/* version of the gnc module system interface we require */ -int libgncmod_standard_reports_gnc_module_system_interface = 0; - -/* module versioning uses libtool semantics. */ -int libgncmod_standard_reports_gnc_module_current = 0; -int libgncmod_standard_reports_gnc_module_revision = 0; -int libgncmod_standard_reports_gnc_module_age = 0; - - -char * -libgncmod_standard_reports_gnc_module_path(void) -{ - return g_strdup("gnucash/report/standard-reports"); -} - -char * -libgncmod_standard_reports_gnc_module_description(void) -{ - return g_strdup("Standard income, asset, balance sheet, etc. reports"); -} - -int -libgncmod_standard_reports_gnc_module_init(int refcount) -{ - /* load the report system */ - if (!gnc_module_load("gnucash/report/report-system", 0)) - { - return FALSE; - } - - /* load the report generation scheme code */ - if (scm_c_eval_string("(use-modules (gnucash report standard-reports))") == - SCM_BOOL_F) - { - return FALSE; - } - if (scm_c_eval_string("(use-modules (gnucash report business-reports))") == - SCM_BOOL_F) - { - return FALSE; - } - return TRUE; -} - -int -libgncmod_standard_reports_gnc_module_end(int refcount) -{ - return TRUE; -} diff --git a/src/report/standard-reports/test/CMakeLists.txt b/src/report/standard-reports/test/CMakeLists.txt index a54d495b1b..a77118683c 100644 --- a/src/report/standard-reports/test/CMakeLists.txt +++ b/src/report/standard-reports/test/CMakeLists.txt @@ -1,9 +1,7 @@ -CONFIGURE_FILE(test-load-module.in test-load-module @ONLY) GNC_ADD_SCHEME_TEST(test-cash-flow test-cash-flow.scm) GNC_ADD_SCHEME_TEST(test-standard-category-report test-standard-category-report.scm) GNC_ADD_SCHEME_TEST(test-standard-net-barchart test-standard-net-barchart.scm) GNC_ADD_SCHEME_TEST(test-standard-net-linechart test-standard-net-linechart.scm) -GNC_ADD_SCHEME_TEST(test-load-module-report-standard-reports test-load-module.in) SET(scm_test_standard_reports_SOURCES test-generic-category-report.scm @@ -22,5 +20,5 @@ GNC_ADD_SCHEME_TARGETS(scm-test-standard-reports ) SET_DIST_LIST(test_standard_reports_DIST CMakeLists.txt Makefile.am ${scm_test_standard_reports_SOURCES} - test-load-module.in test-cash-flow.scm test-standard-category-report.scm test-standard-net-barchart.scm + test-cash-flow.scm test-standard-category-report.scm test-standard-net-barchart.scm test-standard-net-linechart.scm) diff --git a/src/report/standard-reports/test/Makefile.am b/src/report/standard-reports/test/Makefile.am index 547738aaab..e98cb85a34 100644 --- a/src/report/standard-reports/test/Makefile.am +++ b/src/report/standard-reports/test/Makefile.am @@ -1,6 +1,4 @@ -MODULE_TESTS=test-load-module - -TESTS = $(SCM_TESTS) $(MODULE_TESTS) +TESTS = $(SCM_TESTS) SCM_TESTS = \ test-cash-flow \ @@ -19,8 +17,6 @@ GNC_TEST_DEPS = \ --gnc-module-dir ${top_builddir}/src/report/app-utils \ --gnc-module-dir ${top_builddir}/src/report/report-system \ --gnc-module-dir ${top_builddir}/src/report/report-system/test \ - --gnc-module-dir ${top_builddir}/src/report/standard-reports \ - --gnc-module-dir ${top_builddir}/src/report/standard-reports/test \ \ --guile-load-dir ${top_builddir}/src/gnc-module \ --guile-load-dir ${top_builddir}/src/scm \ @@ -35,7 +31,6 @@ GNC_TEST_DEPS = \ --guile-load-dir ${top_builddir}/src/report/standard-reports/test \ \ --library-dir ${top_builddir}/src/report/report-system \ - --library-dir ${top_builddir}/src/report/standard-reports \ --library-dir ${top_builddir}/src/libqof/qof \ --library-dir ${top_builddir}/src/core-utils \ --library-dir ${top_builddir}/src/app-utils \ @@ -64,7 +59,6 @@ SCM_TEST_HELPERS = \ test-generic-net-linechart.scm EXTRA_DIST = \ - test-load-module \ $(SCM_TEST_HELPERS) \ $(SCM_TEST_SRCS) \ CMakeLists.txt diff --git a/src/report/standard-reports/test/test-load-module.in b/src/report/standard-reports/test/test-load-module.in deleted file mode 100755 index 5f325659fd..0000000000 --- a/src/report/standard-reports/test/test-load-module.in +++ /dev/null @@ -1,20 +0,0 @@ -#! @SHELL@ -exec ${GUILE} -s "$0" -!# - -(display " testing standard report module load ... ") -(setenv "GNC_UNINSTALLED" "1") -(use-modules (gnucash gnc-module)) -(gnc:module-system-init) - -(if (gnc:module-load "gnucash/report/standard-reports" 0) - (begin - (display "ok\n") - (exit 0)) - (begin - (display "failed\n") - (exit -1))) - - - - diff --git a/src/report/utility-reports/CMakeLists.txt b/src/report/utility-reports/CMakeLists.txt index 3caa0c3cc6..2c0a4aa2aa 100644 --- a/src/report/utility-reports/CMakeLists.txt +++ b/src/report/utility-reports/CMakeLists.txt @@ -1,30 +1,3 @@ -ADD_SUBDIRECTORY(test) - -SET(utility_reports_SOURCES - gncmod-utility-reports.c -) - -ADD_LIBRARY(gncmod-utility-reports MODULE ${utility_reports_SOURCES}) - -TARGET_LINK_LIBRARIES(gncmod-utility-reports gnc-module ${GUILE_LDFLAGS} ${GLIB2_LDFLAGS}) - -TARGET_COMPILE_DEFINITIONS(gncmod-utility-reports PRIVATE -DG_LOG_DOMAIN=\"gnc.report.util\") - -TARGET_INCLUDE_DIRECTORIES(gncmod-utility-reports - PRIVATE ${GUILE_INCLUDE_DIRS} -) - -SET(LIB_DIR lib/gnucash) -IF (WIN32) - SET(LIB_DIR bin) -ENDIF(WIN32) - - -INSTALL(TARGETS gncmod-utility-reports - LIBRARY DESTINATION ${LIB_DIR} - ARCHIVE DESTINATION ${LIB_DIR} - RUNTIME DESTINATION bin) - # Scheme SET(utility_reports_SCHEME @@ -53,5 +26,5 @@ GNC_ADD_SCHEME_TARGETS(scm-utility-reports ) SET_LOCAL_DIST(utility_reports_DIST_local CMakeLists.txt Makefile.am - ${utility_reports_SOURCES} ${utility_reports_SCHEME}) + ${utility_reports_SCHEME}) SET(utility_reports_DIST ${utility_reports_DIST_local} ${test_utility_reports_DIST} PARENT_SCOPE) diff --git a/src/report/utility-reports/Makefile.am b/src/report/utility-reports/Makefile.am index 5fc4770391..686d6a092b 100644 --- a/src/report/utility-reports/Makefile.am +++ b/src/report/utility-reports/Makefile.am @@ -1,21 +1,3 @@ -SUBDIRS = . test - -pkglib_LTLIBRARIES = libgncmod-utility-reports.la - -libgncmod_utility_reports_la_SOURCES = \ - gncmod-utility-reports.c -libgncmod_utility_reports_la_LIBADD = \ - ${top_builddir}/src/gnc-module/libgnc-module.la \ - ${GUILE_LIBS} \ - ${GLIB_LIBS} - -libgncmod_utility_reports_la_LDFLAGS = -module -avoid-version - -AM_CPPFLAGS = \ - -I${top_srcdir}/src \ - -I${top_srcdir}/src/gnc-module \ - ${GUILE_CFLAGS} ${GLIB_CFLAGS} - gncscmmoddir = ${GNC_SCM_INSTALL_DIR}/gnucash/report/ gncscmmod_DATA = \ hello-world.scm \ @@ -53,7 +35,6 @@ 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/utility-reports \ --guile-load-dir ${top_builddir}/src/app-utils \ --guile-load-dir ${top_builddir}/src/core-utils \ --guile-load-dir ${top_builddir}/src/engine \ @@ -71,8 +52,7 @@ GUILE_COMPILE_ENV = \ --library-dir ${top_builddir}/src/backend/xml \ --library-dir ${top_builddir}/src/backend/sql \ --library-dir ${top_builddir}/src/html \ - --library-dir ${top_builddir}/src/report/report-system \ - --library-dir ${top_builddir}/src/report/utility-reports + --library-dir ${top_builddir}/src/report/report-system %.go : %.scm .scm-links $(pkglib_LTLIBRARIES) GNC_UNINSTALLED=yes \ @@ -94,4 +74,4 @@ EXTRA_DIST = ${gncscmmod_DATA} CMakeLists.txt CLEANFILES = .scm-links ${gncscmmodcache_DATA} DISTCLEANFILES = ${SCM_FILE_LINKS} -AM_CPPFLAGS += -DG_LOG_DOMAIN=\"gnc.report.util\" +AM_CPPFLAGS = -DG_LOG_DOMAIN=\"gnc.report.util\" diff --git a/src/report/utility-reports/gncmod-utility-reports.c b/src/report/utility-reports/gncmod-utility-reports.c deleted file mode 100644 index a1cc3b2cbc..0000000000 --- a/src/report/utility-reports/gncmod-utility-reports.c +++ /dev/null @@ -1,81 +0,0 @@ -/********************************************************************* - * gncmod-utility-reports.c - * module definition/initialization for the utility reports - * - * 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@gnu.org * - * * -\********************************************************************/ - - -#include "config.h" -#include -#include - -#include "gnc-module.h" -#include "gnc-module-api.h" - -GNC_MODULE_API_DECL(libgncmod_utility_reports) - -/* version of the gnc module system interface we require */ -int libgncmod_utility_reports_gnc_module_system_interface = 0; - -/* module versioning uses libtool semantics. */ -int libgncmod_utility_reports_gnc_module_current = 0; -int libgncmod_utility_reports_gnc_module_revision = 0; -int libgncmod_utility_reports_gnc_module_age = 0; - - -char * -libgncmod_utility_reports_gnc_module_path(void) -{ - return g_strdup("gnucash/report/utility-reports"); -} - -char * -libgncmod_utility_reports_gnc_module_description(void) -{ - return g_strdup("Non-financial (utility) reports"); -} - -int -libgncmod_utility_reports_gnc_module_init(int refcount) -{ - /* load the report system */ - if (!gnc_module_load("gnucash/report/report-system", 0)) - { - return FALSE; - } - - /* load the report generation scheme code */ - if (scm_c_eval_string("(use-modules (gnucash report utility-reports))") == - SCM_BOOL_F) - { - return FALSE; - } - - return TRUE; -} - -int -libgncmod_utility_reports_gnc_module_end(int refcount) -{ - return TRUE; -} diff --git a/src/report/utility-reports/test/CMakeLists.txt b/src/report/utility-reports/test/CMakeLists.txt deleted file mode 100644 index 15ff2fd05f..0000000000 --- a/src/report/utility-reports/test/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -CONFIGURE_FILE(test-load-module.in test-load-module @ONLY) -GNC_ADD_SCHEME_TEST(test-load-module-report-utility-reports - test-load-module.in -) - -SET_DIST_LIST(test_utility_reports_DIST CMakeLists.txt Makefile.am test-load-module.in) \ No newline at end of file diff --git a/src/report/utility-reports/test/Makefile.am b/src/report/utility-reports/test/Makefile.am deleted file mode 100644 index fbfc3ffcd5..0000000000 --- a/src/report/utility-reports/test/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -TESTS = test-load-module - -GNC_TEST_DEPS = --gnc-module-dir ${top_builddir}/src/engine \ - --gnc-module-dir ${top_builddir}/src/app-utils \ - --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/utility-reports \ -\ - --guile-load-dir ${top_builddir}/src/gnc-module \ - --guile-load-dir ${top_builddir}/src/scm \ - --guile-load-dir ${top_builddir}/src/engine \ - --guile-load-dir ${top_builddir}/src/core-utils \ - --guile-load-dir ${top_builddir}/src/app-utils \ - --guile-load-dir ${top_builddir}/src/gnome-utils \ - --guile-load-dir ${top_builddir}/src/report/report-system \ - --guile-load-dir ${top_builddir}/src/report/utility-reports \ -\ - --library-dir ${top_builddir}/src/report/report-system \ - --library-dir ${top_builddir}/src/libqof/qof \ - --library-dir ${top_builddir}/src/core-utils \ - --library-dir ${top_builddir}/src/app-utils \ - --library-dir ${top_builddir}/src/gnome-utils \ - --library-dir ${top_builddir}/src/engine \ - --library-dir ${top_builddir}/src/backend/xml \ - --library-dir ${top_builddir}/src/backend/sql \ - --library-dir ${top_builddir}/src/gnc-module - -TESTS_ENVIRONMENT = \ - GUILE_WARN_DEPRECATED=no \ - GUILE="${GUILE}" \ - GNC_BUILDDIR="${abs_top_builddir}" \ - $(shell ${abs_top_srcdir}/src/gnc-test-env.pl --noexports ${GNC_TEST_DEPS}) - -EXTRA_DIST = test-load-module CMakeLists.txt diff --git a/src/report/utility-reports/test/test-load-module.in b/src/report/utility-reports/test/test-load-module.in deleted file mode 100755 index 1140b3bb9d..0000000000 --- a/src/report/utility-reports/test/test-load-module.in +++ /dev/null @@ -1,20 +0,0 @@ -#! @SHELL@ -exec ${GUILE} -s "$0" -!# - -(display " testing utility report module load ... ") -(setenv "GNC_UNINSTALLED" "1") -(use-modules (gnucash gnc-module)) -(gnc:module-system-init) - -(if (gnc:module-load "gnucash/report/utility-reports" 0) - (begin - (display "ok\n") - (exit 0)) - (begin - (display "failed\n") - (exit -1))) - - - -