Portability problems: modules

From: Daniel Macks <dmacks_at_netspace.org>
Date: Tue, 22 Aug 2006 11:46:43 -0400

Modules are loaded with g_module_open, a nice generic interface,
however other parts of genius ( contain things that are
hard-coded to the linux implementation of it.

1. test.plugin.in hardcodes the module extension as .so even though
that's not always true. As distributed, genius builds me
libtestplugin.dylib, I assume win32 folks might get .dll, etc.
Instead, ./configure should query glib to get the appropriate
extension and patch that into the test.plugin.in->test.plugin
setup. Probably best way is with AC_RUN_IFELSE and have the program
print the value of the G_MODULE_SUFFIX macro from glibconfig.h.

2. Technically, g_module_open opens modules, not shared libraries, and
on some platforms, there's a difference in those binary types. When
compiling modules, need to pass -module to the linker. Also, should
pass -avoid-version, since there's no need for library versioning. Add
to src/Makefile.am:

  libtestplugin_la_LDFLAGS = -module -avoid-version


Daniel Macks
Received on Tue Aug 22 2006 - 16:09:04 CDT

This archive was generated by hypermail 2.2.0 : Sun Apr 17 2011 - 21:00:02 CDT