Building and loading of modules/plugins in XFCE
Maarten Boekhold
boekhold at emirates.net.ae
Thu Sep 16 12:11:50 CEST 2004
Hi all,
While porting XFCE to cygwin, I learned about the many wonderful
peculiarities of building loadable modules on cygwin/windows.
There's a mysterious interplay between the name of the library in the
Makefile.am, the LDFLAGS, the resulting library name and the install
location of the library:
(1) plugin_LTLIBRARIES = libxfce4_combo.la
==> the loadable module will be named 'cygxfce4_combo.dll'
(2) plugin_LTLIBRARIES = keyboard_plugin.la
==> the loadable module will be named 'keyboard_plugin.dll'
(3) '-module' used in LDFLAGS
==> the loadable module will be installed in the specified install directory
(4) *no* '-module' used in LDFLAGS
==> the loadable module will be installed in ../bin (relative to the
specified install directory)
As many of the XFCE components assume that a loadable module is (1)
named 'libXXXX.<SOEXT>', and (2) located in a specific directory, some
of the modules fail to load, because the generated filenames (for
g_module_open) don't match the actual library names (btw. xfce4-panel
isn't affected by this, as it 'walks' the directory to get the actual
filenames of the plugins, same probably for mcs-manager).
So, we'll need to make sure that (1) all modules are built/installed
with the '-module' flag (for one, libxfcegui4 needs to be fixed), and
(2) the correct filenames are constructed for passing to g_module_open.
In order to accomplish (2), it is sufficient to consistently use
g_module_build_path(<directory>, <module name>), where <module name> is
*without* a 'lib' prefix *and without* a <SOEXT> suffix. The platform
specific implementation of g_module_build_path will make sure that a
correct library name is created.
At the least, xfce-utils/xfrun (libxfce4_combo) and xffm
(libxfce4_combo, libxfce4_mime) need fixing in this respect. Likely
there is more then these apps, and I would like to ask all authors if
they can spent a few minutes thinking which other pieces of XFCE might
be affected by this.
If you know of other places where library names are generated, please
drop me a mail, and I'll generate patches to make this portable to cygwin.
Kind regards,
Maarten
More information about the Xfce4-dev
mailing list