5 # Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com>
6 # Copyright (c) 2007-2010 Red Hat, Inc.
8 # This library is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Lesser General Public
10 # License as published by the Free Software Foundation; either
11 # version 2 of the License, or (at your option) any later version.
13 # This library is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU Lesser General Public License for more details.
18 # You should have received a copy of the GNU Lesser General Public
19 # License along with this program; if not, write to the
20 # Free Software Foundation, Inc., 59 Temple Place, Suite 330,
21 # Boston, MA 02111-1307 USA
24 AC_CONFIG_HEADERS([config.h])
25 AC_CONFIG_MACRO_DIR([m4])
28 # if not 1, append datestamp to the version number.
29 m4_define([ibus_released], [0])
30 m4_define([ibus_major_version], [1])
31 m4_define([ibus_minor_version], [3])
32 m4_define([ibus_micro_version], [99])
33 m4_define(ibus_maybe_datestamp,
34 m4_esyscmd([if test x]ibus_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi]))
35 m4_define([ibus_version],
36 ibus_major_version.ibus_minor_version.ibus_micro_version[]ibus_maybe_datestamp)
37 # This is the X.Y used in -libus-X.Y
38 m4_define([ibus_api_version], [1.0])
41 # Required versions of other packages
42 m4_define([glib_required_version], [2.26.0])
45 AC_INIT([ibus], [ibus_version],
46 [http://code.google.com/p/ibus/issues/entry],
50 AM_INIT_AUTOMAKE([1.10])
51 AM_MAINTAINER_MODE([enable])
54 # Support silent build
55 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
57 # Define sustituted variables:
58 IBUS_MAJOR_VERSION=ibus_major_version
59 IBUS_MINOR_VERSION=ibus_minor_version
60 IBUS_MICRO_VERSION=ibus_micro_version
61 IBUS_API_VERSION=ibus_api_version
62 AC_SUBST(IBUS_MAJOR_VERSION)
63 AC_SUBST(IBUS_MINOR_VERSION)
64 AC_SUBST(IBUS_MICRO_VERSION)
65 AC_SUBST(IBUS_API_VERSION)
74 # define PACKAGE_VERSION_* variables
79 IT_PROG_INTLTOOL([0.35.0])
81 # If only source code changed, lt_revision + 1
82 # If any interface added, lt_age + 1
83 # If any interfaces changed or removed, lt_current + 1, lt_revision = 0, lt_age = 0
84 m4_define([lt_current], [0])
85 m4_define([lt_revision], [0])
86 m4_define([lt_age], [0])
87 LT_VERSION_INFO="lt_current:lt_revision:lt_age"
88 AC_SUBST(LT_VERSION_INFO)
91 AC_CHECK_FUNCS(daemon)
95 PKG_CHECK_MODULES(GLIB2, [
96 glib-2.0 >= glib_required_version
98 PKG_CHECK_MODULES(GOBJECT2, [
99 gobject-2.0 >= glib_required_version
101 PKG_CHECK_MODULES(GIO2, [
102 gio-2.0 >= glib_required_version
104 PKG_CHECK_MODULES(GTHREAD2, [
105 gthread-2.0 >= glib_required_version
109 AS_HELP_STRING([--disable-gtk2],
110 [Do not build gtk2 im module]),
111 [enable_gtk2=$enableval],
114 AM_CONDITIONAL([ENABLE_GTK2], [test x"$enable_gtk2" = x"yes"])
117 AS_HELP_STRING([--enable-gtk3],
118 [Build gtk3 im module]),
119 [enable_gtk3=$enableval],
122 AM_CONDITIONAL([ENABLE_GTK3], [test x"$enable_gtk3" = x"yes"])
125 AS_HELP_STRING([--disable-xim],
126 [Do not build xim server]),
127 [enable_xim=$enableval],
130 AM_CONDITIONAL([ENABLE_XIM], [test x"$enable_xim" = x"yes"])
133 AS_HELP_STRING([--disable-vala],
134 [Do not build ibus vala binding]),
135 [enable_vala=$enableval],
138 AM_CONDITIONAL([ENABLE_VALA], [test x"$enable_vala" = x"yes"])
139 if test x"$enable_vala" != x"yes"; then
140 enable_vala="no (disabled, use --enable-vala to enable)"
143 if test x"$enable_gtk2" = x"yes" -o x"$enable_xim" = x"yes" ; then
145 PKG_CHECK_MODULES(GTK2, [
150 if test x"$enable_gtk2" = x"yes"; then
152 gtk2_binary_version=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
153 GTK2_IM_MODULEDIR="$libdir"/gtk-2.0/$gtk2_binary_version/immodules
155 PKG_CHECK_MODULES(GDK2, [
159 enable_gtk2="no (disabled, use --enable-gtk2 to enable)"
162 if test x"$enable_gtk3" = x"yes"; then
163 # check for gtk3, gdk3
164 PKG_CHECK_MODULES(GTK3, [
168 gtk3_binary_version=`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`
169 GTK3_IM_MODULEDIR="$libdir"/gtk-3.0/$gtk3_binary_version/immodules
171 PKG_CHECK_MODULES(GDK3, [
175 enable_gtk3="no (disabled, use --enable-gtk3 to enable)"
178 if test x"$enable_xim" = x"yes"; then
180 PKG_CHECK_MODULES(X11, [
183 AC_CHECK_HEADERS([X11/XKBlib.h])
185 enable_xim="no (disabled, use --enable-xim to enable)"
188 # GObject introspection
189 GOBJECT_INTROSPECTION_CHECK([0.6.8])
191 IBUS_GIR_SCANNERFLAGS=
192 if test x"$found_introspection" = x"yes" ; then
193 IBUS_GIR_SCANNERFLAGS="--identifier-prefix=IBus --symbol-prefix=ibus"
194 PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 0.9.6],
195 [gir_symbol_prefix=yes],
196 [gir_symbol_prefix=no])
197 if test x"$gir_symbol_prefix" = x"no" ; then
198 IBUS_GIR_SCANNERFLAGS="--strip-prefix=IBus"
201 AC_SUBST(IBUS_GIR_SCANNERFLAGS)
205 if test x"$enable_gtk_doc" = x"no"; then
206 enable_gtk_doc="no (disabled, use --enable-gtk-doc to enable)"
210 PKG_CHECK_MODULES(DBUS, [
215 AS_HELP_STRING([--disable-gconf],
216 [Do not use GConf code]),
217 [enable_gconf=$enableval],
220 AM_CONDITIONAL([ENABLE_GCONF], [test x"$enable_gconf" = x"yes"])
222 if test x"$enable_gconf" = x"yes"; then
224 PKG_CHECK_MODULES(GCONF,
228 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
229 if test x"$GCONFTOOL" = xno; then
230 AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
234 # GCONF_SCHEMAS_INSTALL should be set in macro AM_GCONF_SOURCE_2
236 AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [false])
237 enable_gconf="no (disabled, use --enable-gconf to enable)"
240 AC_ARG_ENABLE(memconf,
241 AS_HELP_STRING([--enable-memconf],
242 [Enable configure base on memory]),
243 [enable_memconf=$enableval],
246 AM_CONDITIONAL([ENABLE_MEMCONF], [test "x$enable_memconf" = "xyes"])
249 AS_HELP_STRING([--enable-dconf],
250 [Enable configure base on dconf]),
251 [enable_dconf=$enableval],
255 if test x"$enable_dconf" = x"yes"; then
257 PKG_CHECK_MODULES(DCONF,
261 # check glib-compile-schemas
264 AM_CONDITIONAL([ENABLE_DCONF], [test x"$enable_dconf" = x"yes"])
267 AC_PATH_PROG(ENV_IBUS_TEST, env)
268 AC_SUBST(ENV_IBUS_TEST)
270 AC_ARG_ENABLE(python,
271 AS_HELP_STRING([--disable-python],
272 [Do not use Python code]),
273 [enable_python=$enableval],
277 AM_CONDITIONAL([ENABLE_PYTHON], [test x"$enable_python" = x"yes"])
278 AM_CONDITIONAL([ENABLE_DAEMON], [true])
280 if test x"$enable_python" = x"yes"; then
282 AM_PATH_PYTHON([2.5])
283 AC_PATH_PROG(PYTHON_CONFIG, python$PYTHON_VERSION-config)
284 if test x"$PYTHON_CONFIG" = x""; then
285 AC_PATH_PROG(PYTHON_CONFIG, python-config)
287 if test x"$PYTHON_CONFIG" != x""; then
288 PYTHON_CFLAGS=`$PYTHON_CONFIG --includes`
289 PYTHON_LIBS=`$PYTHON_CONFIG --libs`
291 PYTHON_CFLAGS=`$PYTHON $srcdir/python-config.py --includes`
292 PYTHON_LIBS=`$PYTHON $srcdir/python-config.py --libs`
294 PYTHON_INCLUDES="$PYTHON_CFLAGS"
295 AC_SUBST(PYTHON_CFLAGS)
296 AC_SUBST(PYTHON_INCLUDES)
297 AC_SUBST(PYTHON_LIBS)
299 enable_python="no (disabled, use --enable-python to enable)"
306 # define GETTEXT_* variables
307 GETTEXT_PACKAGE=ibus10
308 AC_SUBST(GETTEXT_PACKAGE)
309 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
313 # define gtk2 immodule dir
314 AC_ARG_WITH(gtk2-im-module-dir,
315 AS_HELP_STRING([--with-gtk2-im-module-dir[=DIR]],
316 [Select gtk2 immodule dir]),
317 GTK2_IM_MODULEDIR=$with_gtk2_im_module_dir
319 AC_SUBST(GTK2_IM_MODULEDIR)
321 # define gtk3 immodule dir
322 AC_ARG_WITH(gtk3-im-module-dir,
323 AS_HELP_STRING([--with-gtk3-im-module-dir[=DIR]],
324 [Select gtk3 immodule dir]),
325 GTK3_IM_MODULEDIR=$with_gtk3_im_module_dir
327 AC_SUBST(GTK3_IM_MODULEDIR)
329 if test x"$enable_python" = x"yes"; then
330 # check for dbus-python
331 AC_ARG_ENABLE(dbus-python-check,
332 AS_HELP_STRING([--disable-dbus-python-check],
333 [Do not check dbus-python]),
334 [enable_dbus_python_check=$enableval],
335 [enable_dbus_python_check=yes]
337 PKG_CHECK_MODULES(DBUS_PYTHON,
338 [dbus-python >= 0.83.0],
339 [IBUS_HAS_DBUS_PYTHON=yes],
340 [IBUS_HAS_DBUS_PYTHON=no]
342 if test x"$IBUS_HAS_DBUS_PYTHON" != x"yes"; then
343 if test x"$enable_dbus_python_check" != x"no"; then
344 AC_MSG_ERROR([can not find dbus-python >= 0.83.0. Please install or update dbus-python.])
346 AC_MSG_WARN([can not find dbus-python >= 0.83.0. It is required.])
351 # option for always disable snooper applications
352 AC_ARG_ENABLE(key-snooper,
353 AS_HELP_STRING([--disable-key-snooper],
354 [Always disable key snooper in gtk im module]),
355 [enable_key_snooper=$enableval],
356 [enable_key_snooper=yes]
358 if test x"$enable_key_snooper" = x"yes"; then
359 AC_DEFINE(ENABLE_SNOOPER, TRUE, [Enable key snooper])
361 AC_DEFINE(ENABLE_SNOOPER, FALSE, [Enable key snooper])
362 enable_key_snooper="no (disabled, use --enable-key-snooper to enable)"
365 # option for no snooper applications
366 AC_ARG_WITH(no-snooper-apps,
367 AS_HELP_STRING([--with-no-snooper-apps[=regex1,regex2]],
368 [Does not enable keyboard snooper in those applications (like: .*chrome.*,firefox.*)]),
369 NO_SNOOPER_APPS=$with_no_snooper_apps,
370 NO_SNOOPER_APPS=[.*chrome.*,.*chromium.*,firefox.*,Do.*]
372 AC_DEFINE_UNQUOTED(NO_SNOOPER_APPS, "$NO_SNOOPER_APPS",
373 [Does not enbale keyboard snooper in those applications])
375 # GNOME 3 uses the theme's icon
376 AC_ARG_WITH(panel-icon-keyboard,
377 AS_HELP_STRING([--with-panel-icon-keyboard[=icon_name]],
378 [Set the default panel icon (default: "input-keyboard-symbolic")]),
379 [if test x"$with_panel_icon_keyboard" = x"yes" -o \
380 x"$with_panel_icon_keyboard" = x; then
381 with_panel_icon_keyboard="input-keyboard-symbolic"
383 if test x"$with_panel_icon_keyboard" = x"legacy"; then
384 with_panel_icon_keyboard="ibus-keyboard"
386 IBUS_ICON_KEYBOARD=$with_panel_icon_keyboard
388 IBUS_ICON_KEYBOARD="input-keyboard-symbolic"
390 AC_SUBST(IBUS_ICON_KEYBOARD)
392 # option for enable surrounding-text
393 AC_ARG_ENABLE(surrounding-text,
394 AS_HELP_STRING([--enable-surrounding-text],
395 [Enable surrounding-text support]),
396 [enable_surrounding_text=$enableval],
397 [enable_surrounding_text=no]
399 if test x"$enable_surrounding_text" = x"yes"; then
400 AC_DEFINE(ENABLE_SURROUNDING, TRUE, [Enable surrounding-text support])
402 enable_surrounding_text="no (disabled, use --enable-surrounding-text to enable)"
406 PKG_CHECK_MODULES(ISOCODES, [
409 ISOCODES_PREFIX=`pkg-config iso-codes --variable=prefix`
410 AC_SUBST(ISOCODES_PREFIX)
413 AC_CONFIG_FILES([ po/Makefile.in
419 memconf/memconf.xml.in
432 data/keymaps/Makefile
435 docs/reference/Makefile
436 docs/reference/ibus/ibus-docs.sgml
437 docs/reference/ibus/Makefile
441 ibus/interface/Makefile
445 ui/gtk/gtkpanel.xml.in
451 bindings/vala/Makefile
460 Install prefix $prefix
461 Build shared libs $enable_shared
462 Build static libs $enable_static
464 Gtk2 immodule dir $GTK2_IM_MODULEDIR
465 Gtk3 immodule dir $GTK3_IM_MODULEDIR
466 Build gtk2 immodule $enable_gtk2
467 Build gtk3 immodule $enable_gtk3
468 Build XIM agent server $enable_xim
469 Build python modules $enable_python
470 Build gconf modules $enable_gconf
471 Build memconf modules $enable_memconf
472 Build dconf modules $enable_dconf
473 Build introspection $found_introspection
474 IBus-1.0.gir scannerflags "$IBUS_GIR_SCANNERFLAGS"
475 Build vala binding $enable_vala
476 Build document $enable_gtk_doc
477 Enable key snooper $enable_key_snooper
478 No snooper regexes "$NO_SNOOPER_APPS"
479 Panel icon "$IBUS_ICON_KEYBOARD"
480 Enable surrounding-text $enable_surrounding_text