summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog25
-rw-r--r--configure.in75
-rw-r--r--gtk/Makefile.am33
-rw-r--r--gtk/gtkimmodule.c149
-rw-r--r--modules/input/Makefile.am126
-rw-r--r--modules/input/imam-et.c16
-rw-r--r--modules/input/imcedilla.c16
-rw-r--r--modules/input/imcyrillic-translit.c16
-rw-r--r--modules/input/imime.c14
-rw-r--r--modules/input/iminuktitut.c16
-rw-r--r--modules/input/imipa.c16
-rw-r--r--modules/input/immultipress.c16
-rw-r--r--modules/input/imthai.c16
-rw-r--r--modules/input/imti-er.c16
-rw-r--r--modules/input/imti-et.c16
-rw-r--r--modules/input/imviqr.c16
-rw-r--r--modules/input/imxim.c16
17 files changed, 487 insertions, 111 deletions
diff --git a/ChangeLog b/ChangeLog
index 121bad9c74..a125e4b89a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,30 @@
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.
+
+2008-03-18 Tor Lillqvist <tml@novell.com>
+
* tests/Makefile.am: Build testmountoperation only on Unix for now.
2008-03-17 Christian Kellner <gicmo@gnome.org>
diff --git a/configure.in b/configure.in
index 009fd78000..106fe15cf2 100644
--- a/configure.in
+++ b/configure.in
@@ -974,6 +974,81 @@ AM_CONDITIONAL(INCLUDE_PCX, [test x"$INCLUDE_pcx" = xyes])
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
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 3d911ddebf..ee48eae742 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -44,7 +44,8 @@ INCLUDES = \
-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 @@ if OS_LINUX
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 @@ gtktypebuiltins.c: @REBUILD@ $(gtk_public_h_sources) gtktypebuiltins.c.template
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_directfb_2_0_la_LDFLAGS = $(libtool_opts)
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
diff --git a/gtk/gtkimmodule.c b/gtk/gtkimmodule.c
index 9229504ca9..9f68f62466 100644
--- a/gtk/gtkimmodule.c
+++ b/gtk/gtkimmodule.c
@@ -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 @@ struct _GtkIMModule
{
GTypeModule parent_instance;
+ gboolean builtin;
+
GModule *library;
void (*list) (const GtkIMContextInfo ***contexts,
@@ -97,30 +97,33 @@ gtk_im_module_load (GTypeModule *module)
{
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 @@ gtk_im_module_unload (GTypeModule *module)
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 @@ correct_localedir_prefix (gchar **path)
#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 @@ gtk_im_module_initialize (void)
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)
{
diff --git a/modules/input/Makefile.am b/modules/input/Makefile.am
index 472ed75c20..d098c78e6e 100644
--- a/modules/input/Makefile.am
+++ b/modules/input/Makefile.am
@@ -14,7 +14,8 @@ INCLUDES = \
-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 @@ im_xim_la_SOURCES = \
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 @@ im_thai_la_SOURCES = \
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 @@ im_ime_la_SOURCES = \
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 @@ install-data-hook:
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
diff --git a/modules/input/imam-et.c b/modules/input/imam-et.c
index cabf03a638..8701d550be 100644
--- a/modules/input/imam-et.c
+++ b/modules/input/imam-et.c
@@ -461,27 +461,33 @@ static const GtkIMContextInfo *info_list[] = {
&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);
diff --git a/modules/input/imcedilla.c b/modules/input/imcedilla.c
index 5914a6686a..f3b0c9ff61 100644
--- a/modules/input/imcedilla.c
+++ b/modules/input/imcedilla.c
@@ -98,27 +98,33 @@ static const GtkIMContextInfo *info_list[] = {
&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);
diff --git a/modules/input/imcyrillic-translit.c b/modules/input/imcyrillic-translit.c
index b9c6c562bb..c7c9a0370b 100644
--- a/modules/input/imcyrillic-translit.c
+++ b/modules/input/imcyrillic-translit.c
@@ -224,27 +224,33 @@ static const GtkIMContextInfo *info_list[] = {
&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);
diff --git a/modules/input/imime.c b/modules/input/imime.c
index 72bc6afef7..843917cdab 100644
--- a/modules/input/imime.c
+++ b/modules/input/imime.c
@@ -39,26 +39,32 @@ static const GtkIMContextInfo *info_list[] = {
&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);
diff --git a/modules/input/iminuktitut.c b/modules/input/iminuktitut.c
index b5ee5456da..86e97abbe1 100644
--- a/modules/input/iminuktitut.c
+++ b/modules/input/iminuktitut.c
@@ -134,27 +134,33 @@ static const GtkIMContextInfo *info_list[] = {
&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);
diff --git a/modules/input/imipa.c b/modules/input/imipa.c
index c4a64023ee..853b3663c6 100644
--- a/modules/input/imipa.c
+++ b/modules/input/imipa.c
@@ -152,27 +152,33 @@ static const GtkIMContextInfo *info_list[] = {
&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);
diff --git a/modules/input/immultipress.c b/modules/input/immultipress.c
index e53ccdd067..6430eaabf9 100644
--- a/modules/input/immultipress.c
+++ b/modules/input/immultipress.c
@@ -38,27 +38,33 @@ static const GtkIMContextInfo *info_list[] = {
&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)
{
diff --git a/modules/input/imthai.c b/modules/input/imthai.c
index 45bceb7063..96b9f38b7b 100644
--- a/modules/input/imthai.c
+++ b/modules/input/imthai.c
@@ -42,27 +42,33 @@ static const GtkIMContextInfo *info_list[] = {
&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 ();
diff --git a/modules/input/imti-er.c b/modules/input/imti-er.c
index 8c4b7c1043..63d2cbb5d4 100644
--- a/modules/input/imti-er.c
+++ b/modules/input/imti-er.c
@@ -460,27 +460,33 @@ static const GtkIMContextInfo *info_list[] = {
&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);
diff --git a/modules/input/imti-et.c b/modules/input/imti-et.c
index fdcb763cc7..d438c1f13f 100644
--- a/modules/input/imti-et.c
+++ b/modules/input/imti-et.c
@@ -460,27 +460,33 @@ static const GtkIMContextInfo *info_list[] = {
&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);
diff --git a/modules/input/imviqr.c b/modules/input/imviqr.c
index 6d269ea1c7..ef072e51b6 100644
--- a/modules/input/imviqr.c
+++ b/modules/input/imviqr.c
@@ -251,27 +251,33 @@ static const GtkIMContextInfo *info_list[] = {
&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);
diff --git a/modules/input/imxim.c b/modules/input/imxim.c
index 42a3d409ec..d412576097 100644
--- a/modules/input/imxim.c
+++ b/modules/input/imxim.c
@@ -35,28 +35,34 @@ static const GtkIMContextInfo *info_list[] = {
&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 ();