Skip to content

Commit 0b76b0f

Browse files
committed
MacOS X: Clarify doc string and fix test-dynload.
MacOS X uses .dylib for shared libraries and .so for modules. Add that to gnc-module.c and make test-dynload also check for libgncmodule.dylib. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/branches/reshuffle-modules@15315 57a11ea4-9604-0410-9ed3-97b8803252fd
1 parent c3a31ae commit 0b76b0f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/gnc-module/gnc-module.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,11 @@ gnc_module_system_refresh(void)
207207

208208
while ((dent = readdir(d)) != NULL)
209209
{
210-
/* is the file a .la shared lib? */
211-
/* FIXME: remove/#ifdef hardcoded .dylib suffix */
210+
/* is the file a loadable module? */
211+
212+
/* Gotcha: On MacOS, G_MODULE_SUFFIX is defined as "so", but if we do
213+
* not build clean libtool modules with "-module", we get dynamic
214+
* libraries ending on .dylib */
212215
if (g_str_has_suffix(dent->d_name, "." G_MODULE_SUFFIX) ||
213216
g_str_has_suffix(dent->d_name, ".dylib"))
214217
{

src/gnc-module/test/test-dynload.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ guile_main(void *closure, int argc, char ** argv)
1717

1818
printf(" test-dynload.c: testing dynamic linking of libgncmodule ...");
1919
gmodule = g_module_open("libgncmodule", 0);
20+
21+
/* Maybe MacOS? */
22+
if (!gmodule)
23+
gmodule = g_module_open("libgncmodule.dylib", 0);
24+
2025
if (gmodule) {
2126
gpointer ptr;
2227
if (g_module_symbol(gmodule, "gnc_module_system_init", &ptr)) {

0 commit comments

Comments
 (0)