mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
app-utils - remove gnc-module boilerplate
app-utils now is an ordinery shared library A few bits worth mentioning: 1. it's not guile-free just yet, so instead of a gnc_module_load your code may have to call scm_c_use_module("gnucash app-utils"); to expose the scm side of the app-utils api. This call has been added to gnucash-bin.c for example 2. while lots of noise in this commit is to rename from gncmodule-app-utils to gnc-app-utils, I'll point out the library has also been moved from <libdir>/gnucash to <libdir>. This required changes in app-util's CMakeLists.txt file for the install side and in the top level CMakeLists.txt file for the build directory structure. 3. The C side link module test has been removed as linking an ordinary shared library should be considered well tested by the compiler devs. The scheme side module load test has been slightly tweaked to no longer try to use gnc:module-load, but instead now checks whether the app-utils api is properly exposed to scheme after loading it via use-modules. 4. Dropped a completely obsolete README file.
This commit is contained in:
parent
90aa539908
commit
d52aa0a0dd
@ -868,7 +868,7 @@ configure_file(
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
|
||||
set(_MODULES gnc-core-utils gnc-engine gnc-module gnc-backend-xml-utils gnucash-guile)
|
||||
set(_MODULES gnc-core-utils gnc-engine gnc-app-utils gnc-module gnc-backend-xml-utils gnucash-guile)
|
||||
|
||||
if (WITH_SQL)
|
||||
list(APPEND _MODULES gnc-backend-sql)
|
||||
|
@ -76,7 +76,7 @@ if(WITH_PYTHON)
|
||||
add_library(gnucash_core_c MODULE ${SWIG_GNUCASH_CORE_C})
|
||||
target_include_directories(gnucash_core_c PRIVATE ${gnucash_core_c_INCLUDE_DIRS})
|
||||
|
||||
target_link_libraries(gnucash_core_c gncmod-app-utils gnc-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
|
||||
target_link_libraries(gnucash_core_c gnc-app-utils gnc-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
|
||||
set_target_properties(gnucash_core_c PROPERTIES PREFIX "_")
|
||||
target_compile_options(gnucash_core_c PRIVATE -Wno-implicit -Wno-missing-prototypes -Wno-declaration-after-statement -Wno-missing-declarations)
|
||||
if (HAVE_STRINGOP_TRUNCATION)
|
||||
@ -84,7 +84,7 @@ if(WITH_PYTHON)
|
||||
endif()
|
||||
|
||||
add_executable(sqlite3test EXCLUDE_FROM_ALL sqlite3test.c ${SWIG_GNUCASH_CORE_C})
|
||||
target_link_libraries(sqlite3test gncmod-app-utils gnc-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
|
||||
target_link_libraries(sqlite3test gnc-app-utils gnc-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
|
||||
target_include_directories(sqlite3test PRIVATE ${gnucash_core_c_INCLUDE_DIRS})
|
||||
target_compile_options(sqlite3test PRIVATE -Wno-implicit -Wno-missing-prototypes -Wno-declaration-after-statement -Wno-missing-declarations)
|
||||
if (HAVE_STRINGOP_TRUNCATION)
|
||||
|
@ -51,7 +51,7 @@ if (BUILDING_FROM_VCS)
|
||||
endif (BUILDING_FROM_VCS)
|
||||
|
||||
target_link_libraries (gnucash
|
||||
gncmod-ledger-core gnc-gnome gncmod-gnome-utils gncmod-app-utils
|
||||
gncmod-ledger-core gnc-gnome gncmod-gnome-utils gnc-app-utils
|
||||
gnc-engine gnc-module gnc-core-utils gncmod-report gnucash-guile
|
||||
PkgConfig::GTK3 ${GUILE_LDFLAGS} ${GLIB2_LDFLAGS} ${GTK_MAC_LDFLAGS}
|
||||
)
|
||||
|
@ -207,7 +207,7 @@ add_library (gncmod-gnome-utils
|
||||
)
|
||||
|
||||
target_link_libraries(gncmod-gnome-utils
|
||||
gncmod-app-utils
|
||||
gnc-app-utils
|
||||
gnc-engine
|
||||
gnc-backend-xml-utils
|
||||
gnucash-guile
|
||||
|
@ -26,17 +26,12 @@
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <gmodule.h>
|
||||
#include <libguile.h>
|
||||
|
||||
#include "gnc-module.h"
|
||||
#include "gnc-module-api.h"
|
||||
|
||||
#include "gnc-component-manager.h"
|
||||
#include "dialog-options.h"
|
||||
#include "qof.h"
|
||||
#include "gnc-gui-query.h"
|
||||
|
||||
GNC_MODULE_API_DECL(libgncmod_gnome_utils)
|
||||
|
||||
@ -74,11 +69,6 @@ extern SCM scm_init_sw_gnome_utils_module(void);
|
||||
int
|
||||
libgncmod_gnome_utils_gnc_module_init(int refcount)
|
||||
{
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
scm_init_sw_gnome_utils_module();
|
||||
lmod("(sw_gnome_utils)");
|
||||
lmod("(gnucash gnome-utils)");
|
||||
|
@ -31,7 +31,7 @@ set(GUILE_DEPENDS
|
||||
scm-gnome-utils
|
||||
test-core
|
||||
gncmod-test-engine
|
||||
gncmod-app-utils
|
||||
gnc-app-utils
|
||||
gnc-core-utils
|
||||
gnc-engine
|
||||
)
|
||||
|
@ -487,7 +487,6 @@ load_gnucash_modules()
|
||||
gboolean optional;
|
||||
} modules[] =
|
||||
{
|
||||
{ "gnucash/app-utils", 0, FALSE },
|
||||
{ "gnucash/gnome-utils", 0, FALSE },
|
||||
{ "gnucash/gnome-search", 0, FALSE },
|
||||
{ "gnucash/register/ledger-core", 0, FALSE },
|
||||
@ -602,10 +601,12 @@ inner_main (void *closure, int argc, char **argv)
|
||||
SCM main_mod;
|
||||
char* fn = NULL;
|
||||
|
||||
|
||||
scm_c_eval_string("(debug-set! stack 200000)");
|
||||
|
||||
main_mod = scm_c_resolve_module("gnucash utilities");
|
||||
scm_set_current_module(main_mod);
|
||||
scm_c_use_module("gnucash app-utils");
|
||||
|
||||
/* Check whether the settings need a version update */
|
||||
gnc_gsettings_version_upgrade ();
|
||||
|
@ -73,11 +73,6 @@ extern SCM scm_init_sw_gnc_html_module( void );
|
||||
int
|
||||
libgncmod_html_gnc_module_init( int refcount )
|
||||
{
|
||||
if ( !gnc_module_load( "gnucash/app-utils", 0 ) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
scm_init_sw_gnc_html_module();
|
||||
gnc_html_initialize();
|
||||
lmod( "(sw_gnc_html)" );
|
||||
|
@ -62,8 +62,7 @@ gint
|
||||
libgncmod_aqbanking_gnc_module_init(gint refcount)
|
||||
{
|
||||
/* Load modules we depend on */
|
||||
if (!gnc_module_load("gnucash/app-utils", 0)
|
||||
|| !gnc_module_load("gnucash/gnome-utils", 0)
|
||||
if (!gnc_module_load("gnucash/gnome-utils", 0)
|
||||
|| !gnc_module_load("gnucash/import-export", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -21,7 +21,7 @@ set(test_aqb_INCLUDE_DIRS
|
||||
|
||||
set(test_aqb_LIBS
|
||||
gncmod-aqbanking gncmod-generic-import gnc-gnome gncmod-gnome-utils
|
||||
gncmod-ledger-core gncmod-app-utils
|
||||
gncmod-ledger-core gnc-app-utils
|
||||
gncmod-backend-xml-utils gnc-engine gnc-core-utils gnc-module
|
||||
${GLIB2_LDFLAGS}
|
||||
)
|
||||
|
@ -21,7 +21,7 @@ add_library(gncmod-bi-import ${bi_import_noinst_HEADERS} ${bi_import_SOURCES})
|
||||
target_link_libraries(gncmod-bi-import
|
||||
gncmod-gnome-utils
|
||||
gncmod-gnome-search
|
||||
gncmod-app-utils
|
||||
gnc-app-utils
|
||||
gnc-engine
|
||||
gnc-core-utils
|
||||
gnc-module
|
||||
|
@ -65,10 +65,6 @@ libgncmod_bi_import_gnc_module_description (void)
|
||||
int
|
||||
libgncmod_bi_import_gnc_module_init (int refcount)
|
||||
{
|
||||
if (!gnc_module_load ("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (!gnc_module_load ("gnucash/gnome-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -19,7 +19,7 @@ set(csv_export_noinst_HEADERS
|
||||
add_library(gncmod-csv-export ${csv_export_noinst_HEADERS} ${csv_export_SOURCES})
|
||||
|
||||
target_link_libraries(gncmod-csv-export gncmod-register-gnome gncmod-register-core gncmod-ledger-core gnc-engine
|
||||
gnc-module gncmod-gnome-utils gnc-gnome gncmod-app-utils gnc-core-utils)
|
||||
gnc-module gncmod-gnome-utils gnc-gnome gnc-app-utils gnc-core-utils)
|
||||
|
||||
target_compile_definitions(gncmod-csv-export PRIVATE -DG_LOG_DOMAIN=\"gnc.export.csv\")
|
||||
|
||||
|
@ -59,10 +59,6 @@ libgncmod_csv_export_gnc_module_description(void)
|
||||
int
|
||||
libgncmod_csv_export_gnc_module_init(int refcount)
|
||||
{
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (!gnc_module_load("gnucash/gnome-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -68,7 +68,7 @@ target_link_libraries(
|
||||
${ICU4C_I18N_LDFLAGS}
|
||||
gncmod-generic-import
|
||||
gncmod-gnome-utils
|
||||
gncmod-app-utils
|
||||
gnc-app-utils
|
||||
gnc-engine
|
||||
gnc-core-utils
|
||||
gnc-module)
|
||||
|
@ -59,10 +59,6 @@ libgncmod_csv_import_gnc_module_description(void)
|
||||
int
|
||||
libgncmod_csv_import_gnc_module_init(int refcount)
|
||||
{
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (!gnc_module_load("gnucash/gnome-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -17,7 +17,7 @@ set(customer_import_noinst_HEADERS
|
||||
|
||||
add_library(gncmod-customer-import ${customer_import_SOURCES} ${customer_import_noinst_HEADERS})
|
||||
|
||||
target_link_libraries(gncmod-customer-import gnc-gnome gncmod-gnome-utils gncmod-app-utils
|
||||
target_link_libraries(gncmod-customer-import gnc-gnome gncmod-gnome-utils gnc-app-utils
|
||||
gnc-engine gnc-core-utils gnc-module ${GLIB2_LDFLAGS})
|
||||
|
||||
target_include_directories(gncmod-customer-import
|
||||
|
@ -65,10 +65,6 @@ libgncmod_customer_import_gnc_module_description (void)
|
||||
int
|
||||
libgncmod_customer_import_gnc_module_init (int refcount)
|
||||
{
|
||||
if (!gnc_module_load ("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (!gnc_module_load ("gnucash/gnome-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -58,10 +58,6 @@ libgncmod_generic_import_gnc_module_description(void)
|
||||
int
|
||||
libgncmod_generic_import_gnc_module_init(int refcount)
|
||||
{
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (!gnc_module_load("gnucash/gnome-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -15,7 +15,7 @@ set(log_replay_noinst_HEADERS
|
||||
|
||||
add_library(gncmod-log-replay ${log_replay_SOURCES} ${log_replay_noinst_HEADERS})
|
||||
|
||||
target_link_libraries(gncmod-log-replay gncmod-gnome-utils gncmod-app-utils gnc-engine
|
||||
target_link_libraries(gncmod-log-replay gncmod-gnome-utils gnc-app-utils gnc-engine
|
||||
gnc-core-utils gnc-module PkgConfig::GTK3)
|
||||
|
||||
target_compile_definitions(gncmod-log-replay PRIVATE -DG_LOG_DOMAIN=\"gnc.import.log-replay\")
|
||||
|
@ -61,10 +61,6 @@ libgncmod_log_replay_gnc_module_description(void)
|
||||
int
|
||||
libgncmod_log_replay_gnc_module_init(int refcount)
|
||||
{
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (!gnc_module_load("gnucash/gnome-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -20,7 +20,7 @@ set(ofx_UI gnc-plugin-ofx-ui.xml)
|
||||
if (WITH_OFX)
|
||||
add_library(gncmod-ofx ${ofx_SOURCES} ${ofx_noinst_HEADERS})
|
||||
|
||||
target_link_libraries(gncmod-ofx gncmod-generic-import gnc-engine gncmod-app-utils gnc-core-utils
|
||||
target_link_libraries(gncmod-ofx gncmod-generic-import gnc-engine gnc-app-utils gnc-core-utils
|
||||
gncmod-gnome-utils ${LIBOFX_LDFLAGS})
|
||||
|
||||
target_compile_definitions(gncmod-ofx PRIVATE -DG_LOG_DOMAIN=\"gnc.import.ofx\")
|
||||
|
@ -61,10 +61,6 @@ libgncmod_ofx_gnc_module_description(void)
|
||||
int
|
||||
libgncmod_ofx_gnc_module_init(int refcount)
|
||||
{
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (!gnc_module_load("gnucash/gnome-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -21,7 +21,7 @@ set (qif_import_noinst_HEADERS
|
||||
add_library (gncmod-qif-import ${qif_import_SOURCES} ${qif_import_noinst_HEADERS})
|
||||
|
||||
target_link_libraries(gncmod-qif-import
|
||||
gncmod-app-utils
|
||||
gnc-app-utils
|
||||
gncmod-gnome-utils
|
||||
gnc-gnome
|
||||
gnucash-guile)
|
||||
|
@ -62,11 +62,6 @@ libgncmod_qif_import_gnc_module_description(void)
|
||||
int
|
||||
libgncmod_qif_import_gnc_module_init(int refcount)
|
||||
{
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!gnc_module_load("gnucash/gnome-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -13,7 +13,7 @@ set(pycons_DATA
|
||||
if (WITH_PYTHON)
|
||||
|
||||
add_library(gncmod-python ${gncmod_python_SOURCES})
|
||||
# target_link_libraries(gncmod-python gnc-module gnc-core-utils-python gncmod-app-utils-python
|
||||
# target_link_libraries(gncmod-python gnc-module gnc-core-utils-python gnc-app-utils-python
|
||||
target_link_libraries(gncmod-python gnc-module gnc-core-utils
|
||||
${PYTHON_LIBRARIES} ${GLIB_LIBS}) # ${PYTHON_EXTRA_LIBS}
|
||||
target_include_directories(gncmod-python
|
||||
|
@ -61,10 +61,5 @@ libgncmod_ledger_core_gnc_module_init(int refcount)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ set_source_files_properties (${register_core_SOURCES} PROPERTIES OBJECT_DEPENDS
|
||||
|
||||
add_library (gncmod-register-core ${register_core_SOURCES} ${register_core_HEADERS})
|
||||
|
||||
target_link_libraries(gncmod-register-core gncmod-gnome-utils gncmod-app-utils ${GMODULE_LDFLAGS})
|
||||
target_link_libraries(gncmod-register-core gncmod-gnome-utils gnc-app-utils ${GMODULE_LDFLAGS})
|
||||
|
||||
target_compile_definitions (gncmod-register-core PRIVATE -DG_LOG_DOMAIN=\"gnc.register.core\")
|
||||
|
||||
|
@ -29,7 +29,7 @@ target_compile_definitions(gncmod-report PRIVATE -DG_LOG_DOMAIN=\"gnc.report.cor
|
||||
|
||||
target_link_libraries(gncmod-report
|
||||
gnc-module
|
||||
gncmod-app-utils
|
||||
gnc-app-utils
|
||||
gnucash-guile
|
||||
PkgConfig::GTK3
|
||||
${GUILE_LDFLAGS})
|
||||
|
@ -60,10 +60,6 @@ extern SCM scm_init_sw_report_module(void);
|
||||
int
|
||||
libgncmod_report_gnc_module_init(int refcount)
|
||||
{
|
||||
if (!gnc_module_load("gnucash/app-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
scm_init_sw_report_module();
|
||||
|
||||
scm_c_eval_string("(use-modules (gnucash report))");
|
||||
|
@ -65,7 +65,6 @@ set (app_utils_SOURCES
|
||||
gnc-state.c
|
||||
gnc-ui-util.c
|
||||
gnc-ui-balances.c
|
||||
gncmod-app-utils.c
|
||||
option-util.c
|
||||
)
|
||||
|
||||
@ -94,22 +93,22 @@ if (WIN32)
|
||||
endif()
|
||||
|
||||
|
||||
add_library (gncmod-app-utils ${app_utils_ALL_SOURCES} ${SWIG_APP_UTILS_GUILE_C})
|
||||
target_link_libraries(gncmod-app-utils ${app_utils_ALL_LIBRARIES})
|
||||
add_library (gnc-app-utils ${app_utils_ALL_SOURCES} ${SWIG_APP_UTILS_GUILE_C})
|
||||
target_link_libraries(gnc-app-utils ${app_utils_ALL_LIBRARIES})
|
||||
|
||||
target_include_directories (gncmod-app-utils
|
||||
target_include_directories (gnc-app-utils
|
||||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PRIVATE ${app_utils_ALL_INCLUDES}
|
||||
)
|
||||
target_compile_definitions (gncmod-app-utils PRIVATE -DG_LOG_DOMAIN=\"gnc.app-utils\")
|
||||
target_compile_definitions (gnc-app-utils PRIVATE -DG_LOG_DOMAIN=\"gnc.app-utils\")
|
||||
|
||||
if (APPLE)
|
||||
set_target_properties (gncmod-app-utils PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
|
||||
set_target_properties (gnc-app-utils PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
|
||||
endif()
|
||||
|
||||
install(TARGETS gncmod-app-utils
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
|
||||
install(TARGETS gnc-app-utils
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
|
||||
@ -117,7 +116,7 @@ if (WITH_PYTHON)
|
||||
set(PYEXEC_FILES sw_app_utils.py)
|
||||
add_library (sw_app_utils MODULE ${SWIG_APP_UTILS_PYTHON_C})
|
||||
|
||||
target_link_libraries(sw_app_utils gncmod-app-utils ${app_utils_ALL_LIBRARIES} ${PYTHON_LIBRARIES})
|
||||
target_link_libraries(sw_app_utils gnc-app-utils ${app_utils_ALL_LIBRARIES} ${PYTHON_LIBRARIES})
|
||||
set_target_properties(sw_app_utils PROPERTIES PREFIX "_")
|
||||
if (HAVE_STRINGOP_TRUNCATION)
|
||||
target_compile_options(sw_app_utils PRIVATE -Wno-error=stringop-truncation)
|
||||
@ -130,7 +129,7 @@ if (WITH_PYTHON)
|
||||
target_compile_definitions (sw_app_utils PRIVATE -DG_LOG_DOMAIN=\"gnc.app-utils\")
|
||||
|
||||
if (APPLE)
|
||||
set_target_properties (sw_app_utils PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
|
||||
set_target_properties (sw_app_utils PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}")
|
||||
endif()
|
||||
|
||||
install(TARGETS sw_app_utils
|
||||
@ -168,7 +167,7 @@ set (app_utils_SCHEME_2
|
||||
)
|
||||
|
||||
set(GUILE_DEPENDS
|
||||
gncmod-app-utils
|
||||
gnc-app-utils
|
||||
scm-core-utils
|
||||
scm-engine
|
||||
scm-gnc-module
|
||||
@ -197,5 +196,5 @@ add_custom_target(scm-app-utils ALL DEPENDS scm-app-utils-2 scm-app-utils-1)
|
||||
|
||||
set_local_dist(app_utils_DIST_local
|
||||
${app_utils_ALL_SOURCES} ${app_utils_SCHEME_1} ${app_utils_SCHEME_2} ${app_utils_SCHEME_3}
|
||||
app-utils.i CMakeLists.txt gnc-help-utils.c README)
|
||||
app-utils.i CMakeLists.txt gnc-help-utils.c)
|
||||
set(app_utils_DIST ${app_utils_DIST_local} ${test_app_utils_DIST} PARENT_SCOPE)
|
||||
|
@ -1,10 +0,0 @@
|
||||
|
||||
After loading this module, you must also call
|
||||
|
||||
(gnc:setup-gettext)
|
||||
(setlocale LC_ALL "")
|
||||
|
||||
at some point to finish initializing the app. This is not done
|
||||
automatically from gncmod-app-utils.c via app-utils.scm because you
|
||||
may need to handle setlocale yourself (or you may already have other
|
||||
code that does).
|
@ -18,7 +18,7 @@
|
||||
(define-module (gnucash app-utils))
|
||||
(eval-when
|
||||
(compile load eval expand)
|
||||
(load-extension "libgncmod-app-utils" "scm_init_sw_app_utils_module"))
|
||||
(load-extension "libgnc-app-utils" "scm_init_sw_app_utils_module"))
|
||||
(use-modules (sw_app_utils))
|
||||
|
||||
; Export the swig-wrapped symbols in the public interface of this module
|
||||
|
@ -1,88 +0,0 @@
|
||||
/*********************************************************************
|
||||
* gncmod-app-utils.c
|
||||
* module definition/initialization for the report infrastructure
|
||||
*
|
||||
* 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 <gmodule.h>
|
||||
#include <libguile.h>
|
||||
|
||||
#include "gnc-module.h"
|
||||
#include "gnc-module-api.h"
|
||||
|
||||
#include "gnc-hooks.h"
|
||||
#include "gnc-exp-parser.h"
|
||||
|
||||
GNC_MODULE_API_DECL(libgncmod_app_utils)
|
||||
|
||||
/* version of the gnc module system interface we require */
|
||||
int libgncmod_app_utils_gnc_module_system_interface = 0;
|
||||
|
||||
/* module versioning uses libtool semantics. */
|
||||
int libgncmod_app_utils_gnc_module_current = 0;
|
||||
int libgncmod_app_utils_gnc_module_revision = 0;
|
||||
int libgncmod_app_utils_gnc_module_age = 0;
|
||||
|
||||
|
||||
char *
|
||||
libgncmod_app_utils_gnc_module_path(void)
|
||||
{
|
||||
return g_strdup("gnucash/app-utils");
|
||||
}
|
||||
|
||||
char *
|
||||
libgncmod_app_utils_gnc_module_description(void)
|
||||
{
|
||||
return g_strdup("Utilities for building gnc applications");
|
||||
}
|
||||
|
||||
static void
|
||||
lmod(char * mn)
|
||||
{
|
||||
char * form = g_strdup_printf("(use-modules %s)\n", mn);
|
||||
scm_c_eval_string(form);
|
||||
g_free(form);
|
||||
}
|
||||
|
||||
|
||||
extern SCM scm_init_sw_app_utils_module(void);
|
||||
|
||||
int
|
||||
libgncmod_app_utils_gnc_module_init(int refcount)
|
||||
{
|
||||
scm_init_sw_app_utils_module();
|
||||
/* publish swig bindings */
|
||||
/* load the scheme code */
|
||||
lmod("(sw_app_utils)");
|
||||
lmod("(gnucash app-utils)");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
libgncmod_app_utils_gnc_module_end(int refcount)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
@ -9,7 +9,7 @@ set(APP_UTILS_TEST_INCLUDE_DIRS
|
||||
${GUILE_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(APP_UTILS_TEST_LIBS gncmod-app-utils gncmod-test-engine test-core ${GIO_LDFLAGS} ${GUILE_LDFLAGS})
|
||||
set(APP_UTILS_TEST_LIBS gnc-app-utils gncmod-test-engine test-core ${GIO_LDFLAGS} ${GUILE_LDFLAGS})
|
||||
|
||||
set(test_app_utils_SOURCES test-app-utils.c test-option-util.cpp test-gnc-ui-util.c)
|
||||
|
||||
@ -20,7 +20,6 @@ endmacro()
|
||||
gnc_add_test_with_guile(test-exp-parser test-exp-parser.c
|
||||
APP_UTILS_TEST_INCLUDE_DIRS APP_UTILS_TEST_LIBS
|
||||
)
|
||||
gnc_add_test_with_guile(test-link-module-app-utils test-link-module APP_UTILS_TEST_INCLUDE_DIRS APP_UTILS_TEST_LIBS)
|
||||
add_app_utils_test(test-print-parse-amount test-print-parse-amount.cpp)
|
||||
# FIXME Why is this test not run ?
|
||||
#gnc_add_test_with_guile(test-print-queries test-print-queries.cpp APP_UTILS_TEST_INCLUDE_DIRS APP_UTILS_TEST_LIBS)
|
||||
@ -33,7 +32,6 @@ set(GUILE_DEPENDS
|
||||
scm-test-engine
|
||||
scm-app-utils
|
||||
scm-core-utils
|
||||
scm-gnc-module
|
||||
scm-engine
|
||||
scm-core-utils
|
||||
gncmod-backend-xml
|
||||
@ -83,7 +81,6 @@ set_dist_list(test_app_utils_DIST
|
||||
CMakeLists.txt
|
||||
|
||||
test-exp-parser.c
|
||||
test-link-module.c
|
||||
test-print-parse-amount.cpp
|
||||
test-print-queries.cpp
|
||||
test-scm-query-string.cpp
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include <glib.h>
|
||||
#include <qof.h>
|
||||
#include <libguile.h>
|
||||
#include <gnc-module.h>
|
||||
|
||||
extern void test_suite_option_util (void);
|
||||
extern void test_suite_gnc_ui_util (void);
|
||||
@ -32,10 +31,8 @@ extern void test_suite_gnc_ui_util (void);
|
||||
static void
|
||||
guile_main (void *closure, int argc, char **argv)
|
||||
{
|
||||
GNCModule mod;
|
||||
int retval;
|
||||
gnc_module_system_init ();
|
||||
mod = gnc_module_load ("gnucash/app-utils", 0);
|
||||
scm_c_use_module("gnucash app-utils");
|
||||
|
||||
test_suite_option_util ();
|
||||
test_suite_gnc_ui_util ();
|
||||
|
@ -1,41 +0,0 @@
|
||||
/********************************************************************\
|
||||
* 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 <stdlib.h>
|
||||
#include <libguile.h>
|
||||
#include <gnc-module.h>
|
||||
|
||||
static void
|
||||
guile_main(void *closure, int argc, char ** argv)
|
||||
{
|
||||
GNCModule mod;
|
||||
gnc_module_system_init();
|
||||
mod = gnc_module_load("gnucash/app-utils", 0);
|
||||
|
||||
exit(mod == NULL);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char ** argv)
|
||||
{
|
||||
g_setenv ("GNC_UNINSTALLED", "1", TRUE);
|
||||
scm_boot_guile(argc, argv, guile_main, NULL);
|
||||
return 0;
|
||||
}
|
@ -1,25 +1,20 @@
|
||||
(define exit-code 0)
|
||||
(setenv "GNC_UNINSTALLED" "1")
|
||||
(use-modules (gnucash gnc-module))
|
||||
(gnc:module-system-init)
|
||||
|
||||
(gnc:module-begin-syntax (define loaded-module (gnc:module-load "gnucash/app-utils" 0)))
|
||||
(if loaded-module
|
||||
(display "Module gnucash/app-utils loaded successfully\n")
|
||||
(begin
|
||||
(display "Failed - module gnucash/app-utils not loaded successfully\n")
|
||||
(set! exit-code -1)))
|
||||
(use-modules (gnucash app-utils))
|
||||
|
||||
(if (procedure? gnc:apply-with-error-handling)
|
||||
(display "Procedure gnc:apply-with-error-handling found\n")
|
||||
(begin
|
||||
(display "Failed - procedure gnc:apply-with-error-handling not found\n")
|
||||
(set! exit-code -1)))
|
||||
(cond
|
||||
((defined? 'gnc:apply-with-error-handling)
|
||||
(display "Procedure gnc:apply-with-error-handling found\n"))
|
||||
(else
|
||||
(display "Failed - procedure gnc:apply-with-error-handling not found\n")
|
||||
(set! exit-code -1)))
|
||||
|
||||
(if (procedure? gnc-default-currency)
|
||||
(display "Procedure gnc-default-currency found\n")
|
||||
(begin
|
||||
(display "Failed - procedure gnc-default-currency not found\n")
|
||||
(set! exit-code -1)))
|
||||
(cond
|
||||
((defined? 'gnc-default-currency)
|
||||
(display "Procedure gnc-default-currency found\n"))
|
||||
(else
|
||||
(display "Failed - procedure gnc-default-currency not found\n")
|
||||
(set! exit-code -1)))
|
||||
|
||||
(exit exit-code)
|
||||
|
@ -27,7 +27,6 @@ extern "C"
|
||||
#include "guile-mappings.h"
|
||||
|
||||
#include "gnc-engine-guile.h"
|
||||
#include "gnc-module.h"
|
||||
#include "test-engine-stuff.h"
|
||||
#include "test-stuff.h"
|
||||
#include "Query.h"
|
||||
@ -77,7 +76,7 @@ main_helper (void *closure, int argc, char **argv)
|
||||
{
|
||||
int count = 50;
|
||||
|
||||
gnc_module_load("gnucash/app-utils", 0);
|
||||
scm_c_use_module("gnucash app-utils");
|
||||
|
||||
if (argc > 1)
|
||||
count = atoi (argv[1]);
|
||||
|
@ -27,7 +27,6 @@ extern "C"
|
||||
#include "guile-mappings.h"
|
||||
|
||||
#include "gnc-engine-guile.h"
|
||||
#include "gnc-module.h"
|
||||
#include "gnc-guile-utils.h"
|
||||
#include "test-engine-stuff.h"
|
||||
#include "test-stuff.h"
|
||||
@ -112,8 +111,7 @@ run_tests (void)
|
||||
static void
|
||||
main_helper (void *closure, int argc, char **argv)
|
||||
{
|
||||
gnc_module_system_init ();
|
||||
gnc_module_load("gnucash/app-utils", 0);
|
||||
scm_c_use_module("gnucash app-utils");
|
||||
|
||||
xaccLogDisable ();
|
||||
|
||||
|
@ -19,11 +19,7 @@
|
||||
|
||||
(define-module (gnucash locale de_DE tax))
|
||||
|
||||
(eval-when
|
||||
(compile load eval expand)
|
||||
(load-extension "libgncmod-app-utils" "scm_init_sw_app_utils_module"))
|
||||
(use-modules (gnucash engine))
|
||||
(use-modules (sw_app_utils))
|
||||
(use-modules (gnucash app-utils))
|
||||
|
||||
(export gnc:txf-get-payer-name-source)
|
||||
|
@ -535,7 +535,6 @@ libgnucash/app-utils/gnc-exp-parser.c
|
||||
libgnucash/app-utils/gnc-gsettings.c
|
||||
libgnucash/app-utils/gnc-helpers.c
|
||||
libgnucash/app-utils/gnc-help-utils.c
|
||||
libgnucash/app-utils/gncmod-app-utils.c
|
||||
libgnucash/app-utils/gnc-prefs-utils.c
|
||||
libgnucash/app-utils/gnc-state.c
|
||||
libgnucash/app-utils/gnc-sx-instance-model.c
|
||||
|
Loading…
Reference in New Issue
Block a user