GNOME Bugzilla – Bug 95280
GTK should be more flexible about how GTK_MODULES must be named.
Last modified: 2013-02-11 05:10:37 UTC
Right now _gtk_find_module in gtkmain.c always adds "lib" to the beginning of the library name and adds ".so" to the end of the library name. This is because it only uses g_module_build_path() to build the path. Therefore, it will only find the module if it follows this naming convention. If you want to name a GTK_MODULE without following this convention, the only workaround is to provide the full path to the GTK_MODULE, but this is not desirable since it is obviously preferable to find the module in the GTK_MODULE_PATH. The reasons it would be better if this were more flexible follow: * On Sun systems, it is a requirement that if a library will never be linked against that the "lib" prefix not be included. GTK_MODULES will normally never be directly linked against (instead they are only opened via dlopen calls), so it would be preferable to not prefix them with "lib" on Solaris. * For versioning purposes it is preferable to suffex libraries with a version number such as "modulename.so.1" or "modulename.so.2". Therefore it would be nice to check the literal GTK_MODULE value as provided so if the module is specified, that it will check path/<provided_module_name> before checking path/lib<provided_module_name>.so. This way if I wanted to name my GTK_MODULE "mymodule.so.1" I could just provide that string, and it would work. There might be other suggestions of how to allow GTK_MODULES to have names which do not include the "lib" or to allow them to include a ".<version#> at the end.
How would that interact with names on Win32? Requesting "my_module.so.1" will then lead to clumsy names like "my_module.so.1.dll" probably. How is that solved when linking to normal libs that always have implicit "lib" and ".so" added, yet can have version suffix? GTK+ should probably copy that behavior, maybe with exception that literal name will be searched first and only then with prefixes and suffixes attached.
closing old bugs