summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-03-03 04:16:30 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-03-03 04:16:30 +0000
commitb47b15f6ba401c735d415e65d1fa7620e3546968 (patch)
treeb75d276379a8b722afc17984453dee763a29ae51 /gtk
parentb3c0813b93a2aa0f39a6b06128e2b7ad9cca9175 (diff)
downloadgtk+-b47b15f6ba401c735d415e65d1fa7620e3546968.tar.gz
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.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkmain.c41
-rw-r--r--gtk/gtkthemes.c10
-rw-r--r--gtk/stock-icons/Makefile.am12
3 files changed, 45 insertions, 18 deletions
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 666f21254c..ad5021bd75 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -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);
diff --git a/gtk/gtkthemes.c b/gtk/gtkthemes.c
index 6bb3e7e636..b17668eb8a 100644
--- a/gtk/gtkthemes.c
+++ b/gtk/gtkthemes.c
@@ -60,23 +60,17 @@ gtk_theme_engine_load (GTypeModule *module)
{
GtkThemeEngine *engine = GTK_THEME_ENGINE (module);
- gchar *fullname;
gchar *engine_path;
- fullname = g_module_build_path (NULL, engine->name);
- engine_path = gtk_rc_find_module_in_path (fullname);
+ engine_path = gtk_rc_find_module_in_path (engine->name);
if (!engine_path)
{
g_warning (_("Unable to locate theme engine in module_path: \"%s\","),
- fullname);
-
- g_free (fullname);
+ engine->name);
return FALSE;
}
- g_free (fullname);
-
/* load the lib */
GTK_NOTE (MISC, g_message ("Loading Theme %s\n", engine_path));
diff --git a/gtk/stock-icons/Makefile.am b/gtk/stock-icons/Makefile.am
index 8ed1b3ba14..abc3c32133 100644
--- a/gtk/stock-icons/Makefile.am
+++ b/gtk/stock-icons/Makefile.am
@@ -254,17 +254,17 @@ CLEANFILES = $(noinst_DATA)
pixbuf_dir = $(top_builddir)/gdk-pixbuf
gtkstockpixbufs.h: $(pixbuf_dir)/gdk-pixbuf-csource $(IMAGES)
- GDK_PIXBUF_MODULEDIR=$(pixbuf_dir)/.libs \
+ GDK_PIXBUF_MODULEDIR=$(pixbuf_dir) \
$(pixbuf_dir)/gdk-pixbuf-csource --raw --build-list $(VARIABLES1) >$(srcdir)/gtkstockpixbufs.h
- GDK_PIXBUF_MODULEDIR=$(pixbuf_dir)/.libs \
+ GDK_PIXBUF_MODULEDIR=$(pixbuf_dir) \
$(pixbuf_dir)/gdk-pixbuf-csource --raw --build-list $(VARIABLES2) >>$(srcdir)/gtkstockpixbufs.h
- GDK_PIXBUF_MODULEDIR=$(pixbuf_dir)/.libs \
+ GDK_PIXBUF_MODULEDIR=$(pixbuf_dir) \
$(pixbuf_dir)/gdk-pixbuf-csource --raw --build-list $(VARIABLES3) >>$(srcdir)/gtkstockpixbufs.h
- GDK_PIXBUF_MODULEDIR=$(pixbuf_dir)/.libs \
+ GDK_PIXBUF_MODULEDIR=$(pixbuf_dir) \
$(pixbuf_dir)/gdk-pixbuf-csource --raw --build-list $(VARIABLES4) >>$(srcdir)/gtkstockpixbufs.h
- GDK_PIXBUF_MODULEDIR=$(pixbuf_dir)/.libs \
+ GDK_PIXBUF_MODULEDIR=$(pixbuf_dir) \
$(pixbuf_dir)/gdk-pixbuf-csource --raw --build-list $(VARIABLES5) >>$(srcdir)/gtkstockpixbufs.h
- GDK_PIXBUF_MODULEDIR=$(pixbuf_dir)/.libs \
+ GDK_PIXBUF_MODULEDIR=$(pixbuf_dir) \
$(pixbuf_dir)/gdk-pixbuf-csource --raw --build-list $(VARIABLES6) >>$(srcdir)/gtkstockpixbufs.h
EXTRA_DIST = $(IMAGES) gtkstockpixbufs.h