Fixes for uninstalled operation with module suffixes other than .so and in

Sat Mar  2 23:08:23 2002  Owen Taylor  <otaylor@redhat.com>

        Fixes for uninstalled operation with module suffixes
        other than .so and in general for platforms like AIX where
        the module suffix isn't predictable. (#72185, problems
        reported by Miroslaw Dobrzanski-Neumann)

        * modules/input/Makefile.am (gtk.immodules): Query .la
        files rather than shared objects in .libs when creating the
        uninstalled gtk.immodules file.

        * gtk/gtkmain.c (_gtk_find_module): Look for .la files
        after looking for the normal soname extension to handle
        cases where the soname extension isn't predictable,
        like AIX.

        * gtk/gtkthemes.c (gtk_theme_engine_load): Don't
        call g_module_build_path... leave that to
        gtk_rc_find_module_in_path.

        * demos/gtk-demo/main.c (main) demos/pixbuf-init.c (pixbuf_init):
        tests/testgtk.c (test_init): tests/testtext.c (test_init)
        tests/testdnd.c (test_init): Point gdk-pixbuf to .la
        files rather than poking in .libs for .so files.

        * gtk/stock-icons/Makefile.am (gtkstockpixbufs.h): Remove
        .libs from GDK_PIXBUF_MODULEDIR.
This commit is contained in:
Owen Taylor
2002-03-03 04:16:30 +00:00
committed by Owen Taylor
parent b3c0813b93
commit b47b15f6ba
16 changed files with 272 additions and 31 deletions

View File

@ -377,6 +377,31 @@ _gtk_get_module_path (const gchar *type)
return result;
}
/* Like g_module_path, but use .la as the suffix
*/
static gchar*
module_build_la_path (const gchar *directory,
const gchar *module_name)
{
gchar *filename;
gchar *result;
if (strncmp (module_name, "lib", 3) == 0)
filename = (gchar *)module_name;
else
filename = g_strconcat ("lib", module_name, ".la", NULL);
if (directory && *directory)
result = g_build_filename (directory, filename, NULL);
else
result = g_strdup (filename);
if (filename != module_name)
g_free (filename);
return result;
}
/**
* _gtk_find_module:
* @name: the name of the module
@ -402,15 +427,23 @@ _gtk_find_module (const gchar *name,
paths = _gtk_get_module_path (type);
for (path = paths; *path; path++)
{
gchar *tmp_name = g_module_build_path (*path, name);
gchar *tmp_name;
tmp_name = g_module_build_path (*path, name);
if (g_file_test (tmp_name, G_FILE_TEST_EXISTS))
{
module_name = tmp_name;
goto found;
}
else
g_free(tmp_name);
g_free(tmp_name);
tmp_name = module_build_la_path (*path, name);
if (g_file_test (tmp_name, G_FILE_TEST_EXISTS))
{
module_name = tmp_name;
goto found;
}
g_free(tmp_name);
}
g_strfreev (paths);