gtk+ r19896 - in trunk: . gtk modules/input



Author: tml
Date: Mon Mar 17 23:53:18 2008
New Revision: 19896
URL: http://svn.gnome.org/viewvc/gtk+?rev=19896&view=rev

Log:
2008-03-18  Tor Lillqvist  <tml novell com>

	Bug 99192 - Add --with-include-input-modules

	* configure.in: Add --with-included-immodules switch. Handled in a
	similar way as the --with-included-loaders switch. For each input
	method module foo: Collect the list of input modules to be built
	into libgtk into INCLUDED_IMMODULE_OBJ. Collect a list of
	-DINCLUDE_IM_foo definitions into INCLUDED_IMMODULE_DEFINE.
	Define Automake conditionals INCLUDE_IM_FOO.

	* modules/input/Makefile.am: For modules to be included in libgtk,
	build a static library.
	
	* modules/input/im*.c: Use MODULE_ENTRY macros much like in
	gdk-pixbuf to get unique names for the functions called by libgtk
	in the included case. Use G_MODULE_EXPORT in the non-included case
	so that we don't unnecessarily export unneeded random global
	symbols on Windows.

	* gtk/Makefile.am: Build the included modules and link them into libgtk.

	* gtk/gtkimmodule.c: Handle the built-in modules. Remove
	copy/paste leftover mentions of "themes" in comments.



Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/gtk/Makefile.am
   trunk/gtk/gtkimmodule.c
   trunk/modules/input/Makefile.am
   trunk/modules/input/imam-et.c
   trunk/modules/input/imcedilla.c
   trunk/modules/input/imcyrillic-translit.c
   trunk/modules/input/imime.c
   trunk/modules/input/iminuktitut.c
   trunk/modules/input/imipa.c
   trunk/modules/input/immultipress.c
   trunk/modules/input/imthai.c
   trunk/modules/input/imti-er.c
   trunk/modules/input/imti-et.c
   trunk/modules/input/imviqr.c
   trunk/modules/input/imxim.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Mon Mar 17 23:53:18 2008
@@ -974,6 +974,81 @@
 AM_CONDITIONAL(INCLUDE_ICNS, [test x"$INCLUDE_icns" = xyes])
 AM_CONDITIONAL(INCLUDE_JASPER, [test x"$INCLUDE_jasper" = xyes])
 
+#
+# Allow building some or all immodules included
+#
+AC_MSG_CHECKING(immodules to build)
+
+dnl due to an autoconf bug, commas in the first arg to
+dnl AC_HELP_STRING cause problems.
+dnl AC_HELP_STRING([--with-included-immodules=MODULE1 MODULE2 ...],
+dnl                [build the specified input method modules into gtk])
+AC_ARG_WITH(included_immodules,
+[  --with-included-immodules=MODULE1,MODULE2,...
+                          build the specified input methods into gtk])
+
+if $dynworks; then 
+   :
+else
+   ## if the option was specified, leave it; otherwise disable included immodules
+   if test x$with_included_immodules = xno; then
+           with_included_immodules=yes
+   fi
+fi
+
+all_immodules="am-et,cedilla,cyrillic-translit"
+if test "$gdktarget" = "win32"; then
+   all_immodules="${all_immodules},ime"
+fi
+all_immodules="${all_immodules},inuktitut,ipa,multipress,thai,ti-er,ti-et,viqr"
+if test "$gdktarget" = "x11"; then
+   all_immodules="${all_immodules},xim"
+fi
+
+included_immodules=""
+# If the switch specified without listing any specific ones, include all
+if test "x$with_included_immodules" = xyes ; then
+  included_immodules="$all_immodules"
+else
+  included_immodules="$with_included_immodules"
+fi
+
+AC_MSG_RESULT($included_immodules)
+AM_CONDITIONAL(HAVE_INCLUDED_IMMMODULES, test "x$included_immodules" != x)
+
+INCLUDED_IMMODULE_OBJ=
+INCLUDED_IMMODULE_DEFINE=
+
+IFS="${IFS= 	}"; gtk_save_ifs="$IFS"; IFS=","
+for immodule in $included_immodules; do
+ immodule_underscores=`echo $immodule | sed -e 's/-/_/g'`
+ if echo "$all_immodules" | egrep "(^|,)$immodule(\$|,)" > /dev/null; then
+   :
+ else
+   AC_MSG_ERROR([the specified input method $immodule does not exist])
+ fi
+
+ INCLUDED_IMMODULE_OBJ="$INCLUDED_IMMODULE_OBJ ../modules/input/libstatic-im-$immodule.la"
+ INCLUDED_IMMODULE_DEFINE="$INCLUDED_IMMODULE_DEFINE -DINCLUDE_IM_$immodule_underscores"
+ eval INCLUDE_$immodule_underscores=yes
+done
+IFS="$gtk_save_ifs"
+AC_SUBST(INCLUDED_IMMODULE_OBJ)
+AC_SUBST(INCLUDED_IMMODULE_DEFINE)
+
+AM_CONDITIONAL(INCLUDE_IM_AM_ET, [test x"$INCLUDE_am_et" = xyes])
+AM_CONDITIONAL(INCLUDE_IM_CEDILLA, [test x"$INCLUDE_cedilla" = xyes])
+AM_CONDITIONAL(INCLUDE_IM_CYRILLIC_TRANSLIT, [test x"$INCLUDE_cyrillic_translit" = xyes])
+AM_CONDITIONAL(INCLUDE_IM_IME, [test x"$INCLUDE_ime" = xyes])
+AM_CONDITIONAL(INCLUDE_IM_INUKTITUT, [test x"$INCLUDE_inuktitut" = xyes])
+AM_CONDITIONAL(INCLUDE_IM_IPA, [test x"$INCLUDE_ipa" = xyes])
+AM_CONDITIONAL(INCLUDE_IM_MULTIPRESS, [test x"$INCLUDE_multipress" = xyes])
+AM_CONDITIONAL(INCLUDE_IM_THAI, [test x"$INCLUDE_thai" = xyes])
+AM_CONDITIONAL(INCLUDE_IM_TI_ER, [test x"$INCLUDE_ti_er" = xyes])
+AM_CONDITIONAL(INCLUDE_IM_TI_ET, [test x"$INCLUDE_ti_et" = xyes])
+AM_CONDITIONAL(INCLUDE_IM_VIQR, [test x"$INCLUDE_viqr" = xyes])
+AM_CONDITIONAL(INCLUDE_IM_XIM, [test x"$INCLUDE_xim" = xyes])
+
 AC_HEADER_SYS_WAIT
 
 AC_TYPE_SIGNAL

Modified: trunk/gtk/Makefile.am
==============================================================================
--- trunk/gtk/Makefile.am	(original)
+++ trunk/gtk/Makefile.am	Mon Mar 17 23:53:18 2008
@@ -44,7 +44,8 @@
 	-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED		\
 	$(GTK_DEBUG_FLAGS)				\
 	$(GTK_DEP_CFLAGS)				\
-	$(gtk_clipboard_dnd_c_sources_CFLAGS)
+	$(gtk_clipboard_dnd_c_sources_CFLAGS)		\
+	$(INCLUDED_IMMODULE_DEFINE)
 
 gtarget=$(gdktarget)
 
@@ -106,26 +107,39 @@
 TESTS += abicheck.sh pltcheck.sh
 endif
 
-# libtool stuff: set version and export symbols for resolving
-# since automake doesn't support conditionalized libsomething_la_LDFLAGS
-# we use the general approach here
 libgtkincludedir = $(includedir)/gtk-2.0/gtk
 libadd =								\
 	$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la	\
 	$(top_builddir)/gdk/$(gdktargetlib)				\
 	$(GTK_DEP_LIBS)
+deps =
 
 if OS_UNIX
 libadd += xdgmime/libxdgmime.la
 endif
 
-# common options for the various packages.
+# libtool stuff: set version and export symbols for resolving
+# since automake doesn't support conditionalized libsomething_la_LDFLAGS
+# we use the general approach here
 libtool_opts =							\
   -version-info $(LT_VERSION_INFO)				\
   -export-dynamic $(no_undefined) $(LIBTOOL_EXPORT_OPTIONS)	\
   -rpath $(libdir) $(libgtk_target_ldflags)
 
 
+included-modules:
+if HAVE_INCLUDED_IMMMODULES
+	@cd $(top_builddir)/modules/input && $(MAKE) $(AM_MAKEFLAGS) included-modules
+
+libadd += $(INCLUDED_IMMODULE_OBJ)
+deps += $(INCLUDED_IMMODULE_OBJ)
+
+$(INCLUDED_IMMODULE_OBJ): included-modules
+	@true
+endif
+
+.PHONY: included-modules
+
 #
 # setup source file variables
 #
@@ -833,7 +847,8 @@
 gtktypefuncs.c: @REBUILD@ $(top_srcdir)/gtk/*.h $(top_srcdir)/gdk/*.h Makefile
 	echo '#include <gtk/gtk.h>' > xgen-gtfsrc.c && \
 	  ${CPP} $(DEFS) $(INCLUDES) -DGTK_ENABLE_BROKEN $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) xgen-gtfsrc.c | \
-	  grep -o '\bg[td]k_[a-zA-Z0-9_]*_get_type\b' | \
+	  egrep '\<g[td]k_[a-zA-Z0-9_]+_get_type\>' | \
+	  sed -e 's/.*\(\<g[td]k_[a-zA-Z0-9_]\+_get_type\>\).*/\1/' | \
 	  sort | uniq | \
 	  sed '{ s/^/*tp++ = /; s/$$/();/; }' > xgen-gtf \
 	&& cp xgen-gtf $@ && rm -f xgen-gtf
@@ -860,10 +875,14 @@
 
 libgtk_x11_2_0_la_LIBADD = $(libadd)
 libgtk_win32_2_0_la_LIBADD = $(libadd) -lole32 -lgdi32 -lcomdlg32 -lwinspool -lcomctl32
-libgtk_win32_2_0_la_DEPENDENCIES = $(gtk_def) $(gtk_win32_res)
 libgtk_quartz_2_0_la_LIBADD = $(libadd)
 libgtk_directfb_2_0_la_LIBADD = $(libadd)
 
+libgtk_x11_2_0_la_DEPENDENCIES = $(deps)
+libgtk_win32_2_0_la_DEPENDENCIES = $(gtk_def) $(gtk_win32_res) $(deps)
+libgtk_quartz_2_0_la_DEPENDENCIES = $(deps)
+libgtk_directfb_2_0_la_DEPENDENCIES = $(deps)
+
 if USE_WIN32
 libgtk_target_ldflags = $(gtk_win32_res_ldflag) $(gtk_win32_symbols)
 endif

Modified: trunk/gtk/gtkimmodule.c
==============================================================================
--- trunk/gtk/gtkimmodule.c	(original)
+++ trunk/gtk/gtkimmodule.c	Mon Mar 17 23:53:18 2008
@@ -1,8 +1,6 @@
 /* GTK - The GIMP Toolkit
  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  *
- * Themes added by The Rasterman <raster redhat com>
- * 
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
@@ -65,6 +63,8 @@
 {
   GTypeModule parent_instance;
   
+  gboolean builtin;
+
   GModule *library;
 
   void          (*list)   (const GtkIMContextInfo ***contexts,
@@ -97,30 +97,33 @@
 {
   GtkIMModule *im_module = GTK_IM_MODULE (module);
   
-  im_module->library = g_module_open (im_module->path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
-  if (!im_module->library)
+  if (!im_module->builtin)
     {
-      g_warning (g_module_error());
-      return FALSE;
-    }
+      im_module->library = g_module_open (im_module->path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
+      if (!im_module->library)
+	{
+	  g_warning (g_module_error());
+	  return FALSE;
+	}
   
-  /* extract symbols from the lib */
-  if (!g_module_symbol (im_module->library, "im_module_init",
-			(gpointer *)&im_module->init) ||
-      !g_module_symbol (im_module->library, "im_module_exit", 
-			(gpointer *)&im_module->exit) ||
-      !g_module_symbol (im_module->library, "im_module_list", 
-			(gpointer *)&im_module->list) ||
-      !g_module_symbol (im_module->library, "im_module_create", 
-			(gpointer *)&im_module->create))
-    {
-      g_warning (g_module_error());
-      g_module_close (im_module->library);
-      
-      return FALSE;
+      /* extract symbols from the lib */
+      if (!g_module_symbol (im_module->library, "im_module_init",
+			    (gpointer *)&im_module->init) ||
+	  !g_module_symbol (im_module->library, "im_module_exit", 
+			    (gpointer *)&im_module->exit) ||
+	  !g_module_symbol (im_module->library, "im_module_list", 
+			    (gpointer *)&im_module->list) ||
+	  !g_module_symbol (im_module->library, "im_module_create", 
+			    (gpointer *)&im_module->create))
+	{
+	  g_warning (g_module_error());
+	  g_module_close (im_module->library);
+	  
+	  return FALSE;
+	}
     }
 	    
-  /* call the theme's init (theme_init) function to let it */
+  /* call the module's init function to let it */
   /* setup anything it needs to set up. */
   im_module->init (module);
 
@@ -134,13 +137,16 @@
   
   im_module->exit();
 
-  g_module_close (im_module->library);
-  im_module->library = NULL;
+  if (!im_module->builtin)
+    {
+      g_module_close (im_module->library);
+      im_module->library = NULL;
 
-  im_module->init = NULL;
-  im_module->exit = NULL;
-  im_module->list = NULL;
-  im_module->create = NULL;
+      im_module->init = NULL;
+      im_module->exit = NULL;
+      im_module->list = NULL;
+      im_module->create = NULL;
+    }
 }
 
 /* This only will ever be called if an error occurs during
@@ -262,6 +268,36 @@
 #endif
 
 
+static GtkIMModule *
+add_builtin_module (const gchar             *module_name,
+		    const GtkIMContextInfo **contexts,
+		    int                      n_contexts)
+{
+  GtkIMModule *module = g_object_new (GTK_TYPE_IM_MODULE, NULL);
+  GSList *infos = NULL;
+  int i;
+
+  for (i = 0; i < n_contexts; i++)
+    {
+      GtkIMContextInfo *info = g_new (GtkIMContextInfo, 1);
+      info->context_id = g_strdup (contexts[i]->context_id);
+      info->context_name = g_strdup (contexts[i]->context_name);
+      info->domain = g_strdup (contexts[i]->domain);
+      info->domain_dirname = g_strdup (contexts[i]->domain_dirname);
+#ifdef G_OS_WIN32
+      correct_localedir_prefix ((char **) &info->domain_dirname);
+#endif
+      info->default_locales = g_strdup (contexts[i]->default_locales);
+      infos = g_slist_prepend (infos, info);
+    }
+
+  module->builtin = TRUE;
+  g_type_module_set_name (G_TYPE_MODULE (module), module_name);
+  add_module (module, infos);
+
+  return module;
+}
+
 static void
 gtk_im_module_initialize (void)
 {
@@ -276,6 +312,63 @@
 
   contexts_hash = g_hash_table_new (g_str_hash, g_str_equal);
 
+#define do_builtin(m)							\
+  {									\
+    const GtkIMContextInfo **contexts;					\
+    int n_contexts;							\
+    extern void _gtk_immodule_ ## m ## _list (const GtkIMContextInfo ***contexts, \
+					      guint                    *n_contexts); \
+    extern void _gtk_immodule_ ## m ## _init (GTypeModule *module);	\
+    extern void _gtk_immodule_ ## m ## _exit (void);			\
+    extern GtkIMContext *_gtk_immodule_ ## m ## _create (const gchar *context_id); \
+									\
+    _gtk_immodule_ ## m ## _list (&contexts, &n_contexts);		\
+    module = add_builtin_module (#m, contexts, n_contexts);		\
+    module->init = _gtk_immodule_ ## m ## _init;			\
+    module->exit = _gtk_immodule_ ## m ## _exit;			\
+    module->create = _gtk_immodule_ ## m ## _create;			\
+    module = NULL;							\
+  }
+
+#ifdef INCLUDE_IM_am_et
+  do_builtin (am_et);
+#endif
+#ifdef INCLUDE_IM_cedilla
+  do_builtin (cedilla);
+#endif
+#ifdef INCLUDE_IM_cyrillic_translit
+  do_builtin (cyrillic_translit);
+#endif
+#ifdef INCLUDE_IM_ime
+  do_builtin (ime);
+#endif
+#ifdef INCLUDE_IM_inuktitut
+  do_builtin (inuktitut);
+#endif
+#ifdef INCLUDE_IM_ipa
+  do_builtin (ipa);
+#endif
+#ifdef INCLUDE_IM_multipress
+  do_builtin (multipress);
+#endif
+#ifdef INCLUDE_IM_thai
+  do_builtin (thai);
+#endif
+#ifdef INCLUDE_IM_ti_er
+  do_builtin (ti_er);
+#endif
+#ifdef INCLUDE_IM_ti_et
+  do_builtin (ti_et);
+#endif
+#ifdef INCLUDE_IM_viqr
+  do_builtin (viqr);
+#endif
+#ifdef INCLUDE_IM_xim
+  do_builtin (xim);
+#endif
+
+#undef do_builtin
+
   file = g_fopen (filename, "r");
   if (!file)
     {

Modified: trunk/modules/input/Makefile.am
==============================================================================
--- trunk/modules/input/Makefile.am	(original)
+++ trunk/modules/input/Makefile.am	Mon Mar 17 23:53:18 2008
@@ -14,7 +14,8 @@
 	-DGTK_DISABLE_DEPRECATED 			\
 	$(GTK_DEBUG_FLAGS)				\
 	$(GTK_XIM_FLAGS)				\
-	$(GTK_DEP_CFLAGS)
+	$(GTK_DEP_CFLAGS)				\
+	$(INCLUDED_IMMODULE_DEFINE)
 
 DEPS = \
 	$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la	\
@@ -34,30 +35,65 @@
 	gtkimcontextxim.c 	\
 	gtkimcontextxim.h	\
 	imxim.c
+libstatic_im_xim_la_SOURCES = $(im_xim_la_SOURCES)
 im_xim_la_LIBADD = $(LDADDS)
 if HAVE_X11R6
-IM_XIM_MODULE=im-xim.la 
+if INCLUDE_IM_XIM
+STATIC_XIM_MODULE = libstatic-im-xim.la
+else
+XIM_MODULE=im-xim.la 
+endif
 endif
 
 im_am_et_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
 im_am_et_la_SOURCES = imam-et.c
+libstatic_im_am_et_la_SOURCES = $(im_am_et_la_SOURCES)
 im_am_et_la_LIBADD = $(LDADDS)
+if INCLUDE_IM_AM_ET
+STATIC_AM_ET_MODULE = libstatic-im-am-et.la
+else
+AM_ET_MODULE = im-am-et.la
+endif
 
 im_cedilla_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
 im_cedilla_la_SOURCES = imcedilla.c
+libstatic_im_cedilla_la_SOURCES = $(im_cedilla_la_SOURCES)
 im_cedilla_la_LIBADD = $(LDADDS)
+if INCLUDE_IM_CEDILLA
+STATIC_CEDILLA_MODULE = libstatic-im-cedilla.la
+else
+CEDILLA_MODULE = im-cedilla.la
+endif
 
 im_cyrillic_translit_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
 im_cyrillic_translit_la_SOURCES = imcyrillic-translit.c
+libstatic_im_cyrillic_translit_la_SOURCES = $(im_cyrillic_translit_la_SOURCES)
 im_cyrillic_translit_la_LIBADD = $(LDADDS)
+if INCLUDE_IM_CYRILLIC_TRANSLIT
+STATIC_CYRILLIC_TRANSLIT_MODULE = libstatic-im-cyrillic-translit.la
+else
+CYRILLIC_TRANSLIT_MODULE = im-cyrillic-translit.la
+endif
 
 im_ti_er_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
 im_ti_er_la_SOURCES = imti-er.c
+libstatic_im_ti_er_la_SOURCES = $(im_ti_er_la_SOURCES)
 im_ti_er_la_LIBADD = $(LDADDS)
+if INCLUDE_IM_TI_ER
+STATIC_TI_ER_MODULE = libstatic-im-ti-er.la
+else
+TI_ER_MODULE = im-ti-er.la
+endif
 
 im_ti_et_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
 im_ti_et_la_SOURCES = imti-et.c
+libstatic_im_ti_et_la_SOURCES = $(im_ti_et_la_SOURCES)
 im_ti_et_la_LIBADD = $(LDADDS)
+if INCLUDE_IM_TI_ET
+STATIC_TI_ET_MODULE = libstatic-im-ti-et.la
+else
+TI_ET_MODULE = im-ti-et.la
+endif
 
 im_thai_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
 im_thai_la_SOURCES = 		\
@@ -66,20 +102,43 @@
 	gtkimcontextthai.c 	\
 	gtkimcontextthai.h	\
 	imthai.c
+libstatic_im_thai_la_SOURCES = $(im_thai_la_SOURCES)
 im_thai_la_LIBADD = $(LDADDS)
+if INCLUDE_IM_THAI
+STATIC_THAI_MODULE = libstatic-im-thai.la
+else
+THAI_MODULE = im-thai.la
+endif
 
 im_viqr_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
 im_viqr_la_SOURCES = imviqr.c
+libstatic_im_viqr_la_SOURCES = $(im_viqr_la_SOURCES)
 im_viqr_la_LIBADD = $(LDADDS)
+if INCLUDE_IM_VIQR
+STATIC_VIQR_MODULE = libstatic-im-viqr.la
+else
+VIQR_MODULE = im-viqr.la
+endif
 
 im_inuktitut_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
 im_inuktitut_la_SOURCES = iminuktitut.c
+libstatic_im_inuktitut_la_SOURCES = $(im_inuktitut_la_SOURCES)
 im_inuktitut_la_LIBADD = $(LDADDS)
+if INCLUDE_IM_INUKTITUT
+STATIC_INUKTITUT_MODULE = libstatic-im-inuktitut.la
+else
+INUKTITUT_MODULE = im-inuktitut.la
+endif
 
 im_ipa_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
 im_ipa_la_SOURCES = imipa.c
+libstatic_im_ipa_la_SOURCES = $(im_ipa_la_SOURCES)
 im_ipa_la_LIBADD = $(LDADDS)
-
+if INCLUDE_IM_IPA
+STATIC_IPA_MODULE = libstatic-im-ipa.la
+else
+IPA_MODULE = im-ipa.la
+endif
 
 im_ime_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
 im_ime_la_SOURCES = \
@@ -87,19 +146,32 @@
 	gtkimcontextime.h \
 	imime.c 	  \
 	imm-extra.h
+libstatic_im_ime_la_SOURCES = $(im_ime_la_SOURCES)
 im_ime_la_LIBADD = -limm32 $(LDADDS)
+libstatic_im_ime_la_LIBADD = -limm32
 if USE_WIN32
-IM_IME_MODULE=im-ime.la 
+if INCLUDE_IM_IME
+STATIC_IME_MODULE = libstatic-im-ime.la
+else
+IME_MODULE=im-ime.la 
+endif
 endif
 
 multipress_defs = -DMULTIPRESS_LOCALEDIR=\""$(mplocaledir)"\" -DMULTIPRESS_CONFDIR=\""$(sysconfdir)/gtk-2.0"\"
 im_multipress_la_CPPFLAGS = $(multipress_defs)
+libstatic_im_multipress_la_CPPFLAGS = $(im_multipress_la_CPPFLAGS)
 im_multipress_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
 im_multipress_la_SOURCES =	\
 	gtkimcontextmultipress.c	\
 	gtkimcontextmultipress.h	\
 	immultipress.c
+libstatic_im_multipress_la_SOURCES = $(im_multipress_la_SOURCES)
 im_multipress_la_LIBADD = $(LDADDS)
+if INCLUDE_IM_MULTIPRESS
+STATIC_MULTIPRESS_MODULE = libstatic-im-multipress.la
+else
+MULTIPRESS_MODULE = im-multipress.la
+endif
 
 imconffiledir = $(sysconfdir)/gtk-2.0
 dist_imconffile_DATA = im-multipress.conf
@@ -134,19 +206,39 @@
 uninstall-local:
 	rm -f $(DESTDIR)$(sysconfdir)/gtk-2.0/gtk.immodules
 
-module_LTLIBRARIES =				\
-	$(IM_XIM_MODULE)			\
-	im-am-et.la				\
-	im-cedilla.la				\
-	im-cyrillic-translit.la			\
-	im-inuktitut.la				\
-	im-ipa.la				\
-	im-thai.la				\
-	im-ti-er.la				\
-	im-ti-et.la				\
-	im-viqr.la				\
-	im-multipress.la			\
-	$(IM_IME_MODULE)
+if BUILD_DYNAMIC_MODULES
+
+module_LTLIBRARIES =			\
+	$(AM_ET_MODULE)			\
+	$(CEDILLA_MODULE)		\
+	$(CYRILLIC_TRANSLIT_MODULE)	\
+	$(IME_MODULE)			\
+	$(INUKTITUT_MODULE)		\
+	$(IPA_MODULE)			\
+	$(MULTIPRESS_MODULE)		\
+	$(THAI_MODULE)			\
+	$(TI_ER_MODULE)			\
+	$(TI_ET_MODULE)			\
+	$(VIQR_MODULE)			\
+	$(XIM_MODULE)
+
+endif
+
+noinst_LTLIBRARIES =				\
+	$(STATIC_AM_ET_MODULE)			\
+	$(STATIC_CEDILLA_MODULE)		\
+	$(STATIC_CYRILLIC_TRANSLIT_MODULE)	\
+	$(STATIC_IME_MODULE)			\
+	$(STATIC_INUKTITUT_MODULE)		\
+	$(STATIC_IPA_MODULE)			\
+	$(STATIC_MULTIPRESS_MODULE)		\
+	$(STATIC_THAI_MODULE)			\
+	$(STATIC_TI_ER_MODULE)			\
+	$(STATIC_TI_ET_MODULE)			\
+	$(STATIC_VIQR_MODULE)			\
+	$(STATIC_XIM_MODULE)
+
+included-modules: $(noinst_LTLIBRARIES)
 
 gtk.immodules: Makefile.am $(module_LTLIBRARIES)
 	$(top_builddir)/gtk/gtk-query-immodules-2.0 $(module_LTLIBRARIES) > gtk.immodules

Modified: trunk/modules/input/imam-et.c
==============================================================================
--- trunk/modules/input/imam-et.c	(original)
+++ trunk/modules/input/imam-et.c	Mon Mar 17 23:53:18 2008
@@ -461,27 +461,33 @@
   &am_et_info
 };
 
+#ifndef INCLUDE_IM_am_et
+#define MODULE_ENTRY(function) G_MODULE_EXPORT im_module_ ## function
+#else
+#define MODULE_ENTRY(function) _gtk_immodule_am_et_ ## function
+#endif
+
 void
-im_module_init (GTypeModule *module)
+MODULE_ENTRY (init) (GTypeModule *module)
 {
   am_et_register_type (module);
 }
 
 void 
-im_module_exit (void)
+MODULE_ENTRY (exit) (void)
 {
 }
 
 void 
-im_module_list (const GtkIMContextInfo ***contexts,
-		int                      *n_contexts)
+MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
+		     int                      *n_contexts)
 {
   *contexts = info_list;
   *n_contexts = G_N_ELEMENTS (info_list);
 }
 
 GtkIMContext *
-im_module_create (const gchar *context_id)
+MODULE_ENTRY (create) (const gchar *context_id)
 {
   if (strcmp (context_id, "am_et") == 0)
     return g_object_new (type_am_et_translit, NULL);

Modified: trunk/modules/input/imcedilla.c
==============================================================================
--- trunk/modules/input/imcedilla.c	(original)
+++ trunk/modules/input/imcedilla.c	Mon Mar 17 23:53:18 2008
@@ -98,27 +98,33 @@
   &cedilla_info
 };
 
+#ifndef INCLUDE_IM_cedilla
+#define MODULE_ENTRY(function) G_MODULE_EXPORT im_module_ ## function
+#else
+#define MODULE_ENTRY(function) _gtk_immodule_cedilla_ ## function
+#endif
+
 void
-im_module_init (GTypeModule *module)
+MODULE_ENTRY (init) (GTypeModule *module)
 {
   cedilla_register_type (module);
 }
 
 void 
-im_module_exit (void)
+MODULE_ENTRY (exit) (void)
 {
 }
 
 void 
-im_module_list (const GtkIMContextInfo ***contexts,
-		int                      *n_contexts)
+MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
+		     int                      *n_contexts)
 {
   *contexts = info_list;
   *n_contexts = G_N_ELEMENTS (info_list);
 }
 
 GtkIMContext *
-im_module_create (const gchar *context_id)
+MODULE_ENTRY (create) (const gchar *context_id)
 {
   if (strcmp (context_id, "cedilla") == 0)
     return g_object_new (type_cedilla, NULL);

Modified: trunk/modules/input/imcyrillic-translit.c
==============================================================================
--- trunk/modules/input/imcyrillic-translit.c	(original)
+++ trunk/modules/input/imcyrillic-translit.c	Mon Mar 17 23:53:18 2008
@@ -224,27 +224,33 @@
   &cyrillic_translit_info
 };
 
+#ifndef INCLUDE_IM_cyrillic_translit
+#define MODULE_ENTRY(function) G_MODULE_EXPORT im_module_ ## function
+#else
+#define MODULE_ENTRY(function) _gtk_immodule_cyrillic_translit_ ## function
+#endif
+
 void
-im_module_init (GTypeModule *module)
+MODULE_ENTRY (init) (GTypeModule *module)
 {
   cyrillic_translit_register_type (module);
 }
 
 void 
-im_module_exit (void)
+MODULE_ENTRY (exit) (void)
 {
 }
 
 void 
-im_module_list (const GtkIMContextInfo ***contexts,
-		int                      *n_contexts)
+MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
+		     int                      *n_contexts)
 {
   *contexts = info_list;
   *n_contexts = G_N_ELEMENTS (info_list);
 }
 
 GtkIMContext *
-im_module_create (const gchar *context_id)
+MODULE_ENTRY (create) (const gchar *context_id)
 {
   if (strcmp (context_id, "cyrillic_translit") == 0)
     return g_object_new (type_cyrillic_translit, NULL);

Modified: trunk/modules/input/imime.c
==============================================================================
--- trunk/modules/input/imime.c	(original)
+++ trunk/modules/input/imime.c	Mon Mar 17 23:53:18 2008
@@ -39,26 +39,32 @@
   &ime_info,
 };
 
+#ifndef INCLUDE_IM_ime
+#define MODULE_ENTRY(function) G_MODULE_EXPORT im_module_ ## function
+#else
+#define MODULE_ENTRY(function) _gtk_immodule_ime_ ## function
+#endif
+
 void
-im_module_init (GTypeModule * module)
+MODULE_ENTRY (init) (GTypeModule * module)
 {
   gtk_im_context_ime_register_type (module);
 }
 
 void
-im_module_exit (void)
+MODULE_ENTRY (exit) (void)
 {
 }
 
 void
-im_module_list (const GtkIMContextInfo *** contexts, int *n_contexts)
+MODULE_ENTRY (list) (const GtkIMContextInfo *** contexts, int *n_contexts)
 {
   *contexts = info_list;
   *n_contexts = G_N_ELEMENTS (info_list);
 }
 
 GtkIMContext *
-im_module_create (const gchar * context_id)
+MODULE_ENTRY (create) (const gchar * context_id)
 {
   g_return_val_if_fail (context_id, NULL);
 

Modified: trunk/modules/input/iminuktitut.c
==============================================================================
--- trunk/modules/input/iminuktitut.c	(original)
+++ trunk/modules/input/iminuktitut.c	Mon Mar 17 23:53:18 2008
@@ -134,27 +134,33 @@
   &inuktitut_info
 };
 
+#ifndef INCLUDE_IM_inuktitut
+#define MODULE_ENTRY(function) G_MODULE_EXPORT im_module_ ## function
+#else
+#define MODULE_ENTRY(function) _gtk_immodule_inuktitut_ ## function
+#endif
+
 void
-im_module_init (GTypeModule *module)
+MODULE_ENTRY (init) (GTypeModule *module)
 {
   inuktitut_register_type (module);
 }
 
 void 
-im_module_exit (void)
+MODULE_ENTRY (exit) (void)
 {
 }
 
 void 
-im_module_list (const GtkIMContextInfo ***contexts,
-		int                      *n_contexts)
+MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
+		     int                      *n_contexts)
 {
   *contexts = info_list;
   *n_contexts = G_N_ELEMENTS (info_list);
 }
 
 GtkIMContext *
-im_module_create (const gchar *context_id)
+MODULE_ENTRY (create) (const gchar *context_id)
 {
   if (strcmp (context_id, "inuktitut") == 0)
     return g_object_new (type_inuktitut_translit, NULL);

Modified: trunk/modules/input/imipa.c
==============================================================================
--- trunk/modules/input/imipa.c	(original)
+++ trunk/modules/input/imipa.c	Mon Mar 17 23:53:18 2008
@@ -152,27 +152,33 @@
   &ipa_info
 };
 
+#ifndef INCLUDE_IM_ipa
+#define MODULE_ENTRY(function) G_MODULE_EXPORT im_module_ ## function
+#else
+#define MODULE_ENTRY(function) _gtk_immodule_ipa_ ## function
+#endif
+
 void
-im_module_init (GTypeModule *module)
+MODULE_ENTRY (init) (GTypeModule *module)
 {
   ipa_register_type (module);
 }
 
 void 
-im_module_exit (void)
+MODULE_ENTRY (exit) (void)
 {
 }
 
 void 
-im_module_list (const GtkIMContextInfo ***contexts,
-		int                      *n_contexts)
+MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
+		     int                      *n_contexts)
 {
   *contexts = info_list;
   *n_contexts = G_N_ELEMENTS (info_list);
 }
 
 GtkIMContext *
-im_module_create (const gchar *context_id)
+MODULE_ENTRY (create) (const gchar *context_id)
 {
   if (strcmp (context_id, "ipa") == 0)
     return g_object_new (type_ipa, NULL);

Modified: trunk/modules/input/immultipress.c
==============================================================================
--- trunk/modules/input/immultipress.c	(original)
+++ trunk/modules/input/immultipress.c	Mon Mar 17 23:53:18 2008
@@ -38,27 +38,33 @@
   &info
 };
 
+#ifndef INCLUDE_IM_multipress
+#define MODULE_ENTRY(function) G_MODULE_EXPORT im_module_ ## function
+#else
+#define MODULE_ENTRY(function) _gtk_immodule_multipress_ ## function
+#endif
+
 void
-im_module_init (GTypeModule *module)
+MODULE_ENTRY (init) (GTypeModule *module)
 {
   gtk_im_context_multipress_register_type(module);
 }
 
 void 
-im_module_exit (void)
+MODULE_ENTRY (exit) (void)
 {
 }
 
 void 
-im_module_list (const GtkIMContextInfo ***contexts,
-		int                      *n_contexts)
+MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
+		     int                      *n_contexts)
 {
   *contexts = info_list;
   *n_contexts = G_N_ELEMENTS (info_list);
 }
 
 GtkIMContext *
-im_module_create (const gchar *context_id)
+MODULE_ENTRY (create) (const gchar *context_id)
 {
   if (strcmp (context_id, CONTEXT_ID) == 0)
   {

Modified: trunk/modules/input/imthai.c
==============================================================================
--- trunk/modules/input/imthai.c	(original)
+++ trunk/modules/input/imthai.c	Mon Mar 17 23:53:18 2008
@@ -42,27 +42,33 @@
   &thai_info
 };
 
+#ifndef INCLUDE_IM_thai
+#define MODULE_ENTRY(function) G_MODULE_EXPORT im_module_ ## function
+#else
+#define MODULE_ENTRY(function) _gtk_immodule_thai_ ## function
+#endif
+
 void
-im_module_init (GTypeModule *module)
+MODULE_ENTRY (init) (GTypeModule *module)
 {
   gtk_im_context_thai_register_type (module);
 }
 
 void 
-im_module_exit (void)
+MODULE_ENTRY (exit) (void)
 {
 }
 
 void 
-im_module_list (const GtkIMContextInfo ***contexts,
-		int                      *n_contexts)
+MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
+		     int                      *n_contexts)
 {
   *contexts = info_list;
   *n_contexts = G_N_ELEMENTS (info_list);
 }
 
 GtkIMContext *
-im_module_create (const gchar *context_id)
+MODULE_ENTRY (create) (const gchar *context_id)
 {
   if (strcmp (context_id, "thai") == 0)
     return gtk_im_context_thai_new ();

Modified: trunk/modules/input/imti-er.c
==============================================================================
--- trunk/modules/input/imti-er.c	(original)
+++ trunk/modules/input/imti-er.c	Mon Mar 17 23:53:18 2008
@@ -460,27 +460,33 @@
   &ti_er_info
 };
 
+#ifndef INCLUDE_IM_ti_er
+#define MODULE_ENTRY(function) G_MODULE_EXPORT im_module_ ## function
+#else
+#define MODULE_ENTRY(function) _gtk_immodule_ti_er_ ## function
+#endif
+
 void
-im_module_init (GTypeModule *module)
+MODULE_ENTRY (init) (GTypeModule *module)
 {
   ti_er_register_type (module);
 }
 
 void 
-im_module_exit (void)
+MODULE_ENTRY (exit) (void)
 {
 }
 
 void 
-im_module_list (const GtkIMContextInfo ***contexts,
-		int                      *n_contexts)
+MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
+		     int                      *n_contexts)
 {
   *contexts = info_list;
   *n_contexts = G_N_ELEMENTS (info_list);
 }
 
 GtkIMContext *
-im_module_create (const gchar *context_id)
+MODULE_ENTRY (create) (const gchar *context_id)
 {
   if (strcmp (context_id, "ti_er") == 0)
     return g_object_new (type_ti_er_translit, NULL);

Modified: trunk/modules/input/imti-et.c
==============================================================================
--- trunk/modules/input/imti-et.c	(original)
+++ trunk/modules/input/imti-et.c	Mon Mar 17 23:53:18 2008
@@ -460,27 +460,33 @@
   &ti_et_info
 };
 
+#ifndef INCLUDE_IM_ti_et
+#define MODULE_ENTRY(function) G_MODULE_EXPORT im_module_ ## function
+#else
+#define MODULE_ENTRY(function) _gtk_immodule_ti_et_ ## function
+#endif
+
 void
-im_module_init (GTypeModule *module)
+MODULE_ENTRY (init) (GTypeModule *module)
 {
   ti_et_register_type (module);
 }
 
 void 
-im_module_exit (void)
+MODULE_ENTRY (exit) (void)
 {
 }
 
 void 
-im_module_list (const GtkIMContextInfo ***contexts,
-		int                      *n_contexts)
+MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
+		     int                      *n_contexts)
 {
   *contexts = info_list;
   *n_contexts = G_N_ELEMENTS (info_list);
 }
 
 GtkIMContext *
-im_module_create (const gchar *context_id)
+MODULE_ENTRY (create) (const gchar *context_id)
 {
   if (strcmp (context_id, "ti_et") == 0)
     return g_object_new (type_ti_et_translit, NULL);

Modified: trunk/modules/input/imviqr.c
==============================================================================
--- trunk/modules/input/imviqr.c	(original)
+++ trunk/modules/input/imviqr.c	Mon Mar 17 23:53:18 2008
@@ -251,27 +251,33 @@
   &viqr_info
 };
 
+#ifndef INCLUDE_IM_viqr
+#define MODULE_ENTRY(function) G_MODULE_EXPORT im_module_ ## function
+#else
+#define MODULE_ENTRY(function) _gtk_immodule_viqr_ ## function
+#endif
+
 void
-im_module_init (GTypeModule *module)
+MODULE_ENTRY (init) (GTypeModule *module)
 {
   viqr_register_type (module);
 }
 
 void 
-im_module_exit (void)
+MODULE_ENTRY (exit) (void)
 {
 }
 
 void 
-im_module_list (const GtkIMContextInfo ***contexts,
-		int                      *n_contexts)
+MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
+		     int                      *n_contexts)
 {
   *contexts = info_list;
   *n_contexts = G_N_ELEMENTS (info_list);
 }
 
 GtkIMContext *
-im_module_create (const gchar *context_id)
+MODULE_ENTRY (create) (const gchar *context_id)
 {
   if (strcmp (context_id, "viqr") == 0)
     return g_object_new (type_viqr_translit, NULL);

Modified: trunk/modules/input/imxim.c
==============================================================================
--- trunk/modules/input/imxim.c	(original)
+++ trunk/modules/input/imxim.c	Mon Mar 17 23:53:18 2008
@@ -35,28 +35,34 @@
   &xim_ja_info
 };
 
+#ifndef INCLUDE_IM_xim
+#define MODULE_ENTRY(function) G_MODULE_EXPORT im_module_ ## function
+#else
+#define MODULE_ENTRY(function) _gtk_immodule_xim_ ## function
+#endif
+
 void
-im_module_init (GTypeModule *type_module)
+MODULE_ENTRY (init) (GTypeModule *type_module)
 {
   gtk_im_context_xim_register_type (type_module);
 }
 
 void 
-im_module_exit (void)
+MODULE_ENTRY (exit) (void)
 {
   gtk_im_context_xim_shutdown ();
 }
 
 void 
-im_module_list (const GtkIMContextInfo ***contexts,
-		int                      *n_contexts)
+MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
+		     int                      *n_contexts)
 {
   *contexts = info_list;
   *n_contexts = G_N_ELEMENTS (info_list);
 }
 
 GtkIMContext *
-im_module_create (const gchar *context_id)
+MODULE_ENTRY (create) (const gchar *context_id)
 {
   if (strcmp (context_id, "xim") == 0)
     return gtk_im_context_xim_new ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]