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

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.


svn path=/trunk/; revision=19896
This commit is contained in:
Tor Lillqvist 2008-03-17 23:53:18 +00:00 committed by Tor Lillqvist
parent 39e8f9e58a
commit 6ce7b71f9c
17 changed files with 487 additions and 111 deletions

View File

@ -1,3 +1,28 @@
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> 2008-03-18 Tor Lillqvist <tml@novell.com>
* tests/Makefile.am: Build testmountoperation only on Unix for now. * tests/Makefile.am: Build testmountoperation only on Unix for now.

View File

@ -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_ICNS, [test x"$INCLUDE_icns" = xyes])
AM_CONDITIONAL(INCLUDE_JASPER, [test x"$INCLUDE_jasper" = 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_HEADER_SYS_WAIT
AC_TYPE_SIGNAL AC_TYPE_SIGNAL

View File

@ -44,7 +44,8 @@ INCLUDES = \
-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED \ -DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED \
$(GTK_DEBUG_FLAGS) \ $(GTK_DEBUG_FLAGS) \
$(GTK_DEP_CFLAGS) \ $(GTK_DEP_CFLAGS) \
$(gtk_clipboard_dnd_c_sources_CFLAGS) $(gtk_clipboard_dnd_c_sources_CFLAGS) \
$(INCLUDED_IMMODULE_DEFINE)
gtarget=$(gdktarget) gtarget=$(gdktarget)
@ -106,26 +107,39 @@ if OS_LINUX
TESTS += abicheck.sh pltcheck.sh TESTS += abicheck.sh pltcheck.sh
endif 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 libgtkincludedir = $(includedir)/gtk-2.0/gtk
libadd = \ libadd = \
$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la \ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la \
$(top_builddir)/gdk/$(gdktargetlib) \ $(top_builddir)/gdk/$(gdktargetlib) \
$(GTK_DEP_LIBS) $(GTK_DEP_LIBS)
deps =
if OS_UNIX if OS_UNIX
libadd += xdgmime/libxdgmime.la libadd += xdgmime/libxdgmime.la
endif 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 = \ libtool_opts = \
-version-info $(LT_VERSION_INFO) \ -version-info $(LT_VERSION_INFO) \
-export-dynamic $(no_undefined) $(LIBTOOL_EXPORT_OPTIONS) \ -export-dynamic $(no_undefined) $(LIBTOOL_EXPORT_OPTIONS) \
-rpath $(libdir) $(libgtk_target_ldflags) -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 # 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 gtktypefuncs.c: @REBUILD@ $(top_srcdir)/gtk/*.h $(top_srcdir)/gdk/*.h Makefile
echo '#include <gtk/gtk.h>' > xgen-gtfsrc.c && \ echo '#include <gtk/gtk.h>' > xgen-gtfsrc.c && \
${CPP} $(DEFS) $(INCLUDES) -DGTK_ENABLE_BROKEN $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 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 | \ sort | uniq | \
sed '{ s/^/*tp++ = /; s/$$/();/; }' > xgen-gtf \ sed '{ s/^/*tp++ = /; s/$$/();/; }' > xgen-gtf \
&& cp xgen-gtf $@ && rm -f 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_x11_2_0_la_LIBADD = $(libadd)
libgtk_win32_2_0_la_LIBADD = $(libadd) -lole32 -lgdi32 -lcomdlg32 -lwinspool -lcomctl32 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_quartz_2_0_la_LIBADD = $(libadd)
libgtk_directfb_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 if USE_WIN32
libgtk_target_ldflags = $(gtk_win32_res_ldflag) $(gtk_win32_symbols) libgtk_target_ldflags = $(gtk_win32_res_ldflag) $(gtk_win32_symbols)
endif endif

View File

@ -1,8 +1,6 @@
/* GTK - The GIMP Toolkit /* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * 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 * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
@ -65,6 +63,8 @@ struct _GtkIMModule
{ {
GTypeModule parent_instance; GTypeModule parent_instance;
gboolean builtin;
GModule *library; GModule *library;
void (*list) (const GtkIMContextInfo ***contexts, void (*list) (const GtkIMContextInfo ***contexts,
@ -97,30 +97,33 @@ gtk_im_module_load (GTypeModule *module)
{ {
GtkIMModule *im_module = GTK_IM_MODULE (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->builtin)
if (!im_module->library)
{ {
g_warning (g_module_error()); im_module->library = g_module_open (im_module->path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
return FALSE; if (!im_module->library)
} {
g_warning (g_module_error());
return FALSE;
}
/* extract symbols from the lib */ /* extract symbols from the lib */
if (!g_module_symbol (im_module->library, "im_module_init", if (!g_module_symbol (im_module->library, "im_module_init",
(gpointer *)&im_module->init) || (gpointer *)&im_module->init) ||
!g_module_symbol (im_module->library, "im_module_exit", !g_module_symbol (im_module->library, "im_module_exit",
(gpointer *)&im_module->exit) || (gpointer *)&im_module->exit) ||
!g_module_symbol (im_module->library, "im_module_list", !g_module_symbol (im_module->library, "im_module_list",
(gpointer *)&im_module->list) || (gpointer *)&im_module->list) ||
!g_module_symbol (im_module->library, "im_module_create", !g_module_symbol (im_module->library, "im_module_create",
(gpointer *)&im_module->create)) (gpointer *)&im_module->create))
{ {
g_warning (g_module_error()); g_warning (g_module_error());
g_module_close (im_module->library); g_module_close (im_module->library);
return FALSE; 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. */ /* setup anything it needs to set up. */
im_module->init (module); im_module->init (module);
@ -134,13 +137,16 @@ gtk_im_module_unload (GTypeModule *module)
im_module->exit(); im_module->exit();
g_module_close (im_module->library); if (!im_module->builtin)
im_module->library = NULL; {
g_module_close (im_module->library);
im_module->library = NULL;
im_module->init = NULL; im_module->init = NULL;
im_module->exit = NULL; im_module->exit = NULL;
im_module->list = NULL; im_module->list = NULL;
im_module->create = NULL; im_module->create = NULL;
}
} }
/* This only will ever be called if an error occurs during /* This only will ever be called if an error occurs during
@ -262,6 +268,36 @@ correct_localedir_prefix (gchar **path)
#endif #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 static void
gtk_im_module_initialize (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); 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"); file = g_fopen (filename, "r");
if (!file) if (!file)
{ {

View File

@ -14,7 +14,8 @@ INCLUDES = \
-DGTK_DISABLE_DEPRECATED \ -DGTK_DISABLE_DEPRECATED \
$(GTK_DEBUG_FLAGS) \ $(GTK_DEBUG_FLAGS) \
$(GTK_XIM_FLAGS) \ $(GTK_XIM_FLAGS) \
$(GTK_DEP_CFLAGS) $(GTK_DEP_CFLAGS) \
$(INCLUDED_IMMODULE_DEFINE)
DEPS = \ DEPS = \
$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la \ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la \
@ -34,30 +35,65 @@ im_xim_la_SOURCES = \
gtkimcontextxim.c \ gtkimcontextxim.c \
gtkimcontextxim.h \ gtkimcontextxim.h \
imxim.c imxim.c
libstatic_im_xim_la_SOURCES = $(im_xim_la_SOURCES)
im_xim_la_LIBADD = $(LDADDS) im_xim_la_LIBADD = $(LDADDS)
if HAVE_X11R6 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 endif
im_am_et_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined) im_am_et_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
im_am_et_la_SOURCES = imam-et.c 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) 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_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
im_cedilla_la_SOURCES = imcedilla.c im_cedilla_la_SOURCES = imcedilla.c
libstatic_im_cedilla_la_SOURCES = $(im_cedilla_la_SOURCES)
im_cedilla_la_LIBADD = $(LDADDS) 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_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
im_cyrillic_translit_la_SOURCES = imcyrillic-translit.c 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) 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_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
im_ti_er_la_SOURCES = imti-er.c 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) 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_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
im_ti_et_la_SOURCES = imti-et.c 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) 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_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
im_thai_la_SOURCES = \ im_thai_la_SOURCES = \
@ -66,20 +102,43 @@ im_thai_la_SOURCES = \
gtkimcontextthai.c \ gtkimcontextthai.c \
gtkimcontextthai.h \ gtkimcontextthai.h \
imthai.c imthai.c
libstatic_im_thai_la_SOURCES = $(im_thai_la_SOURCES)
im_thai_la_LIBADD = $(LDADDS) 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_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
im_viqr_la_SOURCES = imviqr.c im_viqr_la_SOURCES = imviqr.c
libstatic_im_viqr_la_SOURCES = $(im_viqr_la_SOURCES)
im_viqr_la_LIBADD = $(LDADDS) 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_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
im_inuktitut_la_SOURCES = iminuktitut.c im_inuktitut_la_SOURCES = iminuktitut.c
libstatic_im_inuktitut_la_SOURCES = $(im_inuktitut_la_SOURCES)
im_inuktitut_la_LIBADD = $(LDADDS) 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_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
im_ipa_la_SOURCES = imipa.c im_ipa_la_SOURCES = imipa.c
libstatic_im_ipa_la_SOURCES = $(im_ipa_la_SOURCES)
im_ipa_la_LIBADD = $(LDADDS) 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_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
im_ime_la_SOURCES = \ im_ime_la_SOURCES = \
@ -87,19 +146,32 @@ im_ime_la_SOURCES = \
gtkimcontextime.h \ gtkimcontextime.h \
imime.c \ imime.c \
imm-extra.h imm-extra.h
libstatic_im_ime_la_SOURCES = $(im_ime_la_SOURCES)
im_ime_la_LIBADD = -limm32 $(LDADDS) im_ime_la_LIBADD = -limm32 $(LDADDS)
libstatic_im_ime_la_LIBADD = -limm32
if USE_WIN32 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 endif
multipress_defs = -DMULTIPRESS_LOCALEDIR=\""$(mplocaledir)"\" -DMULTIPRESS_CONFDIR=\""$(sysconfdir)/gtk-2.0"\" multipress_defs = -DMULTIPRESS_LOCALEDIR=\""$(mplocaledir)"\" -DMULTIPRESS_CONFDIR=\""$(sysconfdir)/gtk-2.0"\"
im_multipress_la_CPPFLAGS = $(multipress_defs) 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_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined)
im_multipress_la_SOURCES = \ im_multipress_la_SOURCES = \
gtkimcontextmultipress.c \ gtkimcontextmultipress.c \
gtkimcontextmultipress.h \ gtkimcontextmultipress.h \
immultipress.c immultipress.c
libstatic_im_multipress_la_SOURCES = $(im_multipress_la_SOURCES)
im_multipress_la_LIBADD = $(LDADDS) 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 imconffiledir = $(sysconfdir)/gtk-2.0
dist_imconffile_DATA = im-multipress.conf dist_imconffile_DATA = im-multipress.conf
@ -134,19 +206,39 @@ install-data-hook:
uninstall-local: uninstall-local:
rm -f $(DESTDIR)$(sysconfdir)/gtk-2.0/gtk.immodules rm -f $(DESTDIR)$(sysconfdir)/gtk-2.0/gtk.immodules
module_LTLIBRARIES = \ if BUILD_DYNAMIC_MODULES
$(IM_XIM_MODULE) \
im-am-et.la \ module_LTLIBRARIES = \
im-cedilla.la \ $(AM_ET_MODULE) \
im-cyrillic-translit.la \ $(CEDILLA_MODULE) \
im-inuktitut.la \ $(CYRILLIC_TRANSLIT_MODULE) \
im-ipa.la \ $(IME_MODULE) \
im-thai.la \ $(INUKTITUT_MODULE) \
im-ti-er.la \ $(IPA_MODULE) \
im-ti-et.la \ $(MULTIPRESS_MODULE) \
im-viqr.la \ $(THAI_MODULE) \
im-multipress.la \ $(TI_ER_MODULE) \
$(IM_IME_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) gtk.immodules: Makefile.am $(module_LTLIBRARIES)
$(top_builddir)/gtk/gtk-query-immodules-2.0 $(module_LTLIBRARIES) > gtk.immodules $(top_builddir)/gtk/gtk-query-immodules-2.0 $(module_LTLIBRARIES) > gtk.immodules

View File

@ -461,27 +461,33 @@ static const GtkIMContextInfo *info_list[] = {
&am_et_info &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 void
im_module_init (GTypeModule *module) MODULE_ENTRY (init) (GTypeModule *module)
{ {
am_et_register_type (module); am_et_register_type (module);
} }
void void
im_module_exit (void) MODULE_ENTRY (exit) (void)
{ {
} }
void void
im_module_list (const GtkIMContextInfo ***contexts, MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
int *n_contexts) int *n_contexts)
{ {
*contexts = info_list; *contexts = info_list;
*n_contexts = G_N_ELEMENTS (info_list); *n_contexts = G_N_ELEMENTS (info_list);
} }
GtkIMContext * GtkIMContext *
im_module_create (const gchar *context_id) MODULE_ENTRY (create) (const gchar *context_id)
{ {
if (strcmp (context_id, "am_et") == 0) if (strcmp (context_id, "am_et") == 0)
return g_object_new (type_am_et_translit, NULL); return g_object_new (type_am_et_translit, NULL);

View File

@ -98,27 +98,33 @@ static const GtkIMContextInfo *info_list[] = {
&cedilla_info &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 void
im_module_init (GTypeModule *module) MODULE_ENTRY (init) (GTypeModule *module)
{ {
cedilla_register_type (module); cedilla_register_type (module);
} }
void void
im_module_exit (void) MODULE_ENTRY (exit) (void)
{ {
} }
void void
im_module_list (const GtkIMContextInfo ***contexts, MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
int *n_contexts) int *n_contexts)
{ {
*contexts = info_list; *contexts = info_list;
*n_contexts = G_N_ELEMENTS (info_list); *n_contexts = G_N_ELEMENTS (info_list);
} }
GtkIMContext * GtkIMContext *
im_module_create (const gchar *context_id) MODULE_ENTRY (create) (const gchar *context_id)
{ {
if (strcmp (context_id, "cedilla") == 0) if (strcmp (context_id, "cedilla") == 0)
return g_object_new (type_cedilla, NULL); return g_object_new (type_cedilla, NULL);

View File

@ -224,27 +224,33 @@ static const GtkIMContextInfo *info_list[] = {
&cyrillic_translit_info &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 void
im_module_init (GTypeModule *module) MODULE_ENTRY (init) (GTypeModule *module)
{ {
cyrillic_translit_register_type (module); cyrillic_translit_register_type (module);
} }
void void
im_module_exit (void) MODULE_ENTRY (exit) (void)
{ {
} }
void void
im_module_list (const GtkIMContextInfo ***contexts, MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
int *n_contexts) int *n_contexts)
{ {
*contexts = info_list; *contexts = info_list;
*n_contexts = G_N_ELEMENTS (info_list); *n_contexts = G_N_ELEMENTS (info_list);
} }
GtkIMContext * GtkIMContext *
im_module_create (const gchar *context_id) MODULE_ENTRY (create) (const gchar *context_id)
{ {
if (strcmp (context_id, "cyrillic_translit") == 0) if (strcmp (context_id, "cyrillic_translit") == 0)
return g_object_new (type_cyrillic_translit, NULL); return g_object_new (type_cyrillic_translit, NULL);

View File

@ -39,26 +39,32 @@ static const GtkIMContextInfo *info_list[] = {
&ime_info, &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 void
im_module_init (GTypeModule * module) MODULE_ENTRY (init) (GTypeModule * module)
{ {
gtk_im_context_ime_register_type (module); gtk_im_context_ime_register_type (module);
} }
void void
im_module_exit (void) MODULE_ENTRY (exit) (void)
{ {
} }
void void
im_module_list (const GtkIMContextInfo *** contexts, int *n_contexts) MODULE_ENTRY (list) (const GtkIMContextInfo *** contexts, int *n_contexts)
{ {
*contexts = info_list; *contexts = info_list;
*n_contexts = G_N_ELEMENTS (info_list); *n_contexts = G_N_ELEMENTS (info_list);
} }
GtkIMContext * GtkIMContext *
im_module_create (const gchar * context_id) MODULE_ENTRY (create) (const gchar * context_id)
{ {
g_return_val_if_fail (context_id, NULL); g_return_val_if_fail (context_id, NULL);

View File

@ -134,27 +134,33 @@ static const GtkIMContextInfo *info_list[] = {
&inuktitut_info &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 void
im_module_init (GTypeModule *module) MODULE_ENTRY (init) (GTypeModule *module)
{ {
inuktitut_register_type (module); inuktitut_register_type (module);
} }
void void
im_module_exit (void) MODULE_ENTRY (exit) (void)
{ {
} }
void void
im_module_list (const GtkIMContextInfo ***contexts, MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
int *n_contexts) int *n_contexts)
{ {
*contexts = info_list; *contexts = info_list;
*n_contexts = G_N_ELEMENTS (info_list); *n_contexts = G_N_ELEMENTS (info_list);
} }
GtkIMContext * GtkIMContext *
im_module_create (const gchar *context_id) MODULE_ENTRY (create) (const gchar *context_id)
{ {
if (strcmp (context_id, "inuktitut") == 0) if (strcmp (context_id, "inuktitut") == 0)
return g_object_new (type_inuktitut_translit, NULL); return g_object_new (type_inuktitut_translit, NULL);

View File

@ -152,27 +152,33 @@ static const GtkIMContextInfo *info_list[] = {
&ipa_info &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 void
im_module_init (GTypeModule *module) MODULE_ENTRY (init) (GTypeModule *module)
{ {
ipa_register_type (module); ipa_register_type (module);
} }
void void
im_module_exit (void) MODULE_ENTRY (exit) (void)
{ {
} }
void void
im_module_list (const GtkIMContextInfo ***contexts, MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
int *n_contexts) int *n_contexts)
{ {
*contexts = info_list; *contexts = info_list;
*n_contexts = G_N_ELEMENTS (info_list); *n_contexts = G_N_ELEMENTS (info_list);
} }
GtkIMContext * GtkIMContext *
im_module_create (const gchar *context_id) MODULE_ENTRY (create) (const gchar *context_id)
{ {
if (strcmp (context_id, "ipa") == 0) if (strcmp (context_id, "ipa") == 0)
return g_object_new (type_ipa, NULL); return g_object_new (type_ipa, NULL);

View File

@ -38,27 +38,33 @@ static const GtkIMContextInfo *info_list[] = {
&info &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 void
im_module_init (GTypeModule *module) MODULE_ENTRY (init) (GTypeModule *module)
{ {
gtk_im_context_multipress_register_type(module); gtk_im_context_multipress_register_type(module);
} }
void void
im_module_exit (void) MODULE_ENTRY (exit) (void)
{ {
} }
void void
im_module_list (const GtkIMContextInfo ***contexts, MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
int *n_contexts) int *n_contexts)
{ {
*contexts = info_list; *contexts = info_list;
*n_contexts = G_N_ELEMENTS (info_list); *n_contexts = G_N_ELEMENTS (info_list);
} }
GtkIMContext * GtkIMContext *
im_module_create (const gchar *context_id) MODULE_ENTRY (create) (const gchar *context_id)
{ {
if (strcmp (context_id, CONTEXT_ID) == 0) if (strcmp (context_id, CONTEXT_ID) == 0)
{ {

View File

@ -42,27 +42,33 @@ static const GtkIMContextInfo *info_list[] = {
&thai_info &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 void
im_module_init (GTypeModule *module) MODULE_ENTRY (init) (GTypeModule *module)
{ {
gtk_im_context_thai_register_type (module); gtk_im_context_thai_register_type (module);
} }
void void
im_module_exit (void) MODULE_ENTRY (exit) (void)
{ {
} }
void void
im_module_list (const GtkIMContextInfo ***contexts, MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
int *n_contexts) int *n_contexts)
{ {
*contexts = info_list; *contexts = info_list;
*n_contexts = G_N_ELEMENTS (info_list); *n_contexts = G_N_ELEMENTS (info_list);
} }
GtkIMContext * GtkIMContext *
im_module_create (const gchar *context_id) MODULE_ENTRY (create) (const gchar *context_id)
{ {
if (strcmp (context_id, "thai") == 0) if (strcmp (context_id, "thai") == 0)
return gtk_im_context_thai_new (); return gtk_im_context_thai_new ();

View File

@ -460,27 +460,33 @@ static const GtkIMContextInfo *info_list[] = {
&ti_er_info &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 void
im_module_init (GTypeModule *module) MODULE_ENTRY (init) (GTypeModule *module)
{ {
ti_er_register_type (module); ti_er_register_type (module);
} }
void void
im_module_exit (void) MODULE_ENTRY (exit) (void)
{ {
} }
void void
im_module_list (const GtkIMContextInfo ***contexts, MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
int *n_contexts) int *n_contexts)
{ {
*contexts = info_list; *contexts = info_list;
*n_contexts = G_N_ELEMENTS (info_list); *n_contexts = G_N_ELEMENTS (info_list);
} }
GtkIMContext * GtkIMContext *
im_module_create (const gchar *context_id) MODULE_ENTRY (create) (const gchar *context_id)
{ {
if (strcmp (context_id, "ti_er") == 0) if (strcmp (context_id, "ti_er") == 0)
return g_object_new (type_ti_er_translit, NULL); return g_object_new (type_ti_er_translit, NULL);

View File

@ -460,27 +460,33 @@ static const GtkIMContextInfo *info_list[] = {
&ti_et_info &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 void
im_module_init (GTypeModule *module) MODULE_ENTRY (init) (GTypeModule *module)
{ {
ti_et_register_type (module); ti_et_register_type (module);
} }
void void
im_module_exit (void) MODULE_ENTRY (exit) (void)
{ {
} }
void void
im_module_list (const GtkIMContextInfo ***contexts, MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
int *n_contexts) int *n_contexts)
{ {
*contexts = info_list; *contexts = info_list;
*n_contexts = G_N_ELEMENTS (info_list); *n_contexts = G_N_ELEMENTS (info_list);
} }
GtkIMContext * GtkIMContext *
im_module_create (const gchar *context_id) MODULE_ENTRY (create) (const gchar *context_id)
{ {
if (strcmp (context_id, "ti_et") == 0) if (strcmp (context_id, "ti_et") == 0)
return g_object_new (type_ti_et_translit, NULL); return g_object_new (type_ti_et_translit, NULL);

View File

@ -251,27 +251,33 @@ static const GtkIMContextInfo *info_list[] = {
&viqr_info &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 void
im_module_init (GTypeModule *module) MODULE_ENTRY (init) (GTypeModule *module)
{ {
viqr_register_type (module); viqr_register_type (module);
} }
void void
im_module_exit (void) MODULE_ENTRY (exit) (void)
{ {
} }
void void
im_module_list (const GtkIMContextInfo ***contexts, MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
int *n_contexts) int *n_contexts)
{ {
*contexts = info_list; *contexts = info_list;
*n_contexts = G_N_ELEMENTS (info_list); *n_contexts = G_N_ELEMENTS (info_list);
} }
GtkIMContext * GtkIMContext *
im_module_create (const gchar *context_id) MODULE_ENTRY (create) (const gchar *context_id)
{ {
if (strcmp (context_id, "viqr") == 0) if (strcmp (context_id, "viqr") == 0)
return g_object_new (type_viqr_translit, NULL); return g_object_new (type_viqr_translit, NULL);

View File

@ -35,28 +35,34 @@ static const GtkIMContextInfo *info_list[] = {
&xim_ja_info &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 void
im_module_init (GTypeModule *type_module) MODULE_ENTRY (init) (GTypeModule *type_module)
{ {
gtk_im_context_xim_register_type (type_module); gtk_im_context_xim_register_type (type_module);
} }
void void
im_module_exit (void) MODULE_ENTRY (exit) (void)
{ {
gtk_im_context_xim_shutdown (); gtk_im_context_xim_shutdown ();
} }
void void
im_module_list (const GtkIMContextInfo ***contexts, MODULE_ENTRY (list) (const GtkIMContextInfo ***contexts,
int *n_contexts) int *n_contexts)
{ {
*contexts = info_list; *contexts = info_list;
*n_contexts = G_N_ELEMENTS (info_list); *n_contexts = G_N_ELEMENTS (info_list);
} }
GtkIMContext * GtkIMContext *
im_module_create (const gchar *context_id) MODULE_ENTRY (create) (const gchar *context_id)
{ {
if (strcmp (context_id, "xim") == 0) if (strcmp (context_id, "xim") == 0)
return gtk_im_context_xim_new (); return gtk_im_context_xim_new ();