r15315 - gnucash/branches/reshuffle-modules/src/gnc-module - MacOS X: Clarify doc string and fix test-dynload.
Andreas Köhler
andi5 at cvs.gnucash.org
Fri Jan 5 18:45:29 EST 2007
Author: andi5
Date: 2007-01-05 18:45:26 -0500 (Fri, 05 Jan 2007)
New Revision: 15315
Trac: http://svn.gnucash.org/trac/changeset/15315
Modified:
gnucash/branches/reshuffle-modules/src/gnc-module/gnc-module.c
gnucash/branches/reshuffle-modules/src/gnc-module/test/test-dynload.c
Log:
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.
Modified: gnucash/branches/reshuffle-modules/src/gnc-module/gnc-module.c
===================================================================
--- gnucash/branches/reshuffle-modules/src/gnc-module/gnc-module.c 2007-01-05 23:45:23 UTC (rev 15314)
+++ gnucash/branches/reshuffle-modules/src/gnc-module/gnc-module.c 2007-01-05 23:45:26 UTC (rev 15315)
@@ -207,8 +207,11 @@
while ((dent = readdir(d)) != NULL)
{
- /* is the file a .la shared lib? */
- /* FIXME: remove/#ifdef hardcoded .dylib suffix */
+ /* is the file a loadable module? */
+
+ /* Gotcha: On MacOS, G_MODULE_SUFFIX is defined as "so", but if we do
+ * not build clean libtool modules with "-module", we get dynamic
+ * libraries ending on .dylib */
if (g_str_has_suffix(dent->d_name, "." G_MODULE_SUFFIX) ||
g_str_has_suffix(dent->d_name, ".dylib"))
{
Modified: gnucash/branches/reshuffle-modules/src/gnc-module/test/test-dynload.c
===================================================================
--- gnucash/branches/reshuffle-modules/src/gnc-module/test/test-dynload.c 2007-01-05 23:45:23 UTC (rev 15314)
+++ gnucash/branches/reshuffle-modules/src/gnc-module/test/test-dynload.c 2007-01-05 23:45:26 UTC (rev 15315)
@@ -17,6 +17,11 @@
printf(" test-dynload.c: testing dynamic linking of libgncmodule ...");
gmodule = g_module_open("libgncmodule", 0);
+
+ /* Maybe MacOS? */
+ if (!gmodule)
+ gmodule = g_module_open("libgncmodule.dylib", 0);
+
if (gmodule) {
gpointer ptr;
if (g_module_symbol(gmodule, "gnc_module_system_init", &ptr)) {
More information about the gnucash-changes
mailing list