mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-09-03 20:53:02 -05:00
Set up the modpath correctly for Win32, OSX, and Unix in test-dynload.c
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22601 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -18,17 +18,26 @@ guile_main(void *closure, int argc, char ** argv)
|
|||||||
GModule *gmodule;
|
GModule *gmodule;
|
||||||
gchar *msg = "Module '../../../src/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n";
|
gchar *msg = "Module '../../../src/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n";
|
||||||
gchar *logdomain = "gnc.module";
|
gchar *logdomain = "gnc.module";
|
||||||
|
gchar *modpath;
|
||||||
guint loglevel = G_LOG_LEVEL_WARNING;
|
guint loglevel = G_LOG_LEVEL_WARNING;
|
||||||
TestErrorStruct check = { loglevel, logdomain, msg };
|
TestErrorStruct check = { loglevel, logdomain, msg };
|
||||||
g_log_set_handler (logdomain, loglevel,
|
g_log_set_handler (logdomain, loglevel,
|
||||||
(GLogFunc)test_checked_handler, &check);
|
(GLogFunc)test_checked_handler, &check);
|
||||||
|
|
||||||
g_test_message(" test-dynload.c: testing dynamic linking of libgnc-module ...");
|
g_test_message(" test-dynload.c: testing dynamic linking of libgnc-module ...");
|
||||||
gmodule = g_module_open("libgnc-module", 0);
|
#ifdef G_OS_WIN32
|
||||||
|
/* MinGW builds libgnc-module-0.dll */
|
||||||
/* Maybe MacOS? */
|
modpath = g_module_build_path ("../.libs", "gnc-module-0");
|
||||||
if (!gmodule)
|
#elif defined GDK_QUARTZ
|
||||||
gmodule = g_module_open("libgnc-module.dylib", 0);
|
/* We build libgnc-module as a shared library for testing, and on OSX
|
||||||
|
* that means that g_module_build_path (), which uses ".so", doesn't
|
||||||
|
* build the right path name.
|
||||||
|
*/
|
||||||
|
modpath = g_build_filename ("..", ".libs", "libgnc-module.dylib", NULL);
|
||||||
|
#else /* Regular Unix */
|
||||||
|
modpath = g_module_build_path ("../.libs", "gnc-module");
|
||||||
|
#endif
|
||||||
|
gmodule = g_module_open(modpath, 0);
|
||||||
|
|
||||||
if (gmodule)
|
if (gmodule)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user