mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Use another way to fix backend loading on OS X
This commit is contained in:
@@ -74,9 +74,9 @@ gnc_engine_init_part2()
|
||||
} libs[] =
|
||||
{
|
||||
#if defined( HAVE_DBI_DBI_H )
|
||||
{ "gnucash", "gncmod-backend-dbi", TRUE },
|
||||
{ "dbi", "gncmod-backend-dbi", TRUE },
|
||||
#endif
|
||||
{ "gnucash", "gncmod-backend-xml", TRUE },
|
||||
{ "xml", "gncmod-backend-xml", TRUE },
|
||||
{ NULL, FALSE }
|
||||
}, *lib;
|
||||
|
||||
|
||||
@@ -137,16 +137,16 @@ QofBackend::register_backend(const char* directory, const char* module_name)
|
||||
if (!absdir || !g_path_is_absolute(absdir))
|
||||
absdir = get_default_module_dir(directory);
|
||||
auto fullpath = g_module_build_path (absdir, module_name);
|
||||
g_free (absdir);
|
||||
/* Darwin modules can have either .so or .dylib for a suffix */
|
||||
if (!g_file_test (fullpath, G_FILE_TEST_EXISTS) &&
|
||||
g_strcmp0 (G_MODULE_SUFFIX, "so") == 0)
|
||||
{
|
||||
auto modname = g_strdup_printf ("lib%s.dylib", module_name);
|
||||
g_free (fullpath);
|
||||
fullpath = g_build_filename (directory, modname, NULL);
|
||||
fullpath = g_build_filename (absdir, modname, NULL);
|
||||
g_free (modname);
|
||||
}
|
||||
g_free (absdir);
|
||||
auto backend = g_module_open (fullpath, G_MODULE_BIND_LAZY);
|
||||
g_free (fullpath);
|
||||
if (!backend)
|
||||
|
||||
Reference in New Issue
Block a user