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])
82 m4_define(ibus_datedisplay,
83 m4_esyscmd(date '+%a %b %d %Y' | tr -d '\n\r'))
84 DATE_DISPLAY="ibus_datedisplay"
85 AC_SUBST(DATE_DISPLAY)
87 # If only source code changed, lt_revision + 1
88 # If any interface added, lt_age + 1
89 # If any interfaces changed or removed, lt_current + 1, lt_revision = 0, lt_age = 0
90 m4_define([lt_current], [0])
91 m4_define([lt_revision], [0])
92 m4_define([lt_age], [0])
93 LT_VERSION_INFO="lt_current:lt_revision:lt_age"
94 AC_SUBST(LT_VERSION_INFO)
97 AC_CHECK_FUNCS(daemon)
101 PKG_CHECK_MODULES(GLIB2, [
102 glib-2.0 >= glib_required_version
104 PKG_CHECK_MODULES(GOBJECT2, [
105 gobject-2.0 >= glib_required_version
107 PKG_CHECK_MODULES(GIO2, [
108 gio-2.0 >= glib_required_version
110 PKG_CHECK_MODULES(GTHREAD2, [
111 gthread-2.0 >= glib_required_version
115 AS_HELP_STRING([--disable-gtk2],
116 [Do not build gtk2 im module]),
117 [enable_gtk2=$enableval],
120 AM_CONDITIONAL([ENABLE_GTK2], [test x"$enable_gtk2" = x"yes"])
123 AS_HELP_STRING([--enable-gtk3],
124 [Build gtk3 im module]),
125 [enable_gtk3=$enableval],
128 AM_CONDITIONAL([ENABLE_GTK3], [test x"$enable_gtk3" = x"yes"])
131 AS_HELP_STRING([--disable-xim],
132 [Do not build xim server]),
133 [enable_xim=$enableval],
136 AM_CONDITIONAL([ENABLE_XIM], [test x"$enable_xim" = x"yes"])
139 AS_HELP_STRING([--disable-vala],
140 [Do not build ibus vala binding]),
141 [enable_vala=$enableval],
144 AM_CONDITIONAL([ENABLE_VALA], [test x"$enable_vala" = x"yes"])
145 if test x"$enable_vala" != x"yes"; then
146 enable_vala="no (disabled, use --enable-vala to enable)"
149 if test x"$enable_gtk2" = x"yes" -o x"$enable_xim" = x"yes" ; then
151 PKG_CHECK_MODULES(GTK2, [
156 if test x"$enable_gtk2" = x"yes"; then
158 gtk2_binary_version=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
159 GTK2_IM_MODULEDIR="$libdir"/gtk-2.0/$gtk2_binary_version/immodules
161 PKG_CHECK_MODULES(GDK2, [
165 enable_gtk2="no (disabled, use --enable-gtk2 to enable)"
168 if test x"$enable_gtk3" = x"yes"; then
169 # check for gtk3, gdk3
170 PKG_CHECK_MODULES(GTK3, [
174 gtk3_binary_version=`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`
175 GTK3_IM_MODULEDIR="$libdir"/gtk-3.0/$gtk3_binary_version/immodules
177 PKG_CHECK_MODULES(GDK3, [
181 enable_gtk3="no (disabled, use --enable-gtk3 to enable)"
184 if test x"$enable_xim" = x"yes"; then
186 PKG_CHECK_MODULES(X11, [
189 AC_CHECK_HEADERS([X11/XKBlib.h])
191 enable_xim="no (disabled, use --enable-xim to enable)"
194 # GObject introspection
195 GOBJECT_INTROSPECTION_CHECK([0.6.8])
197 IBUS_GIR_SCANNERFLAGS=
198 if test x"$found_introspection" = x"yes" ; then
199 IBUS_GIR_SCANNERFLAGS="--identifier-prefix=IBus --symbol-prefix=ibus"
200 PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 0.9.6],
201 [gir_symbol_prefix=yes],
202 [gir_symbol_prefix=no])
203 if test x"$gir_symbol_prefix" = x"no" ; then
204 IBUS_GIR_SCANNERFLAGS="--strip-prefix=IBus"
207 AC_SUBST(IBUS_GIR_SCANNERFLAGS)
211 if test x"$enable_gtk_doc" = x"no"; then
212 enable_gtk_doc="no (disabled, use --enable-gtk-doc to enable)"
216 PKG_CHECK_MODULES(DBUS, [
221 AS_HELP_STRING([--disable-gconf],
222 [Do not use GConf code]),
223 [enable_gconf=$enableval],
226 AM_CONDITIONAL([ENABLE_GCONF], [test x"$enable_gconf" = x"yes"])
228 if test x"$enable_gconf" = x"yes"; then
230 PKG_CHECK_MODULES(GCONF,
234 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
235 if test x"$GCONFTOOL" = xno; then
236 AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
240 # GCONF_SCHEMAS_INSTALL should be set in macro AM_GCONF_SOURCE_2
242 AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [false])
243 enable_gconf="no (disabled, use --enable-gconf to enable)"
246 AC_ARG_ENABLE(memconf,
247 AS_HELP_STRING([--enable-memconf],
248 [Enable configure base on memory]),
249 [enable_memconf=$enableval],
252 AM_CONDITIONAL([ENABLE_MEMCONF], [test "x$enable_memconf" = "xyes"])
255 AS_HELP_STRING([--enable-dconf],
256 [Enable configure base on dconf]),
257 [enable_dconf=$enableval],
261 if test x"$enable_dconf" = x"yes"; then
263 PKG_CHECK_MODULES(DCONF,
267 # check glib-compile-schemas
270 AM_CONDITIONAL([ENABLE_DCONF], [test x"$enable_dconf" = x"yes"])
273 AC_PATH_PROG(ENV_IBUS_TEST, env)
274 AC_SUBST(ENV_IBUS_TEST)
276 AC_ARG_ENABLE(python,
277 AS_HELP_STRING([--disable-python],
278 [Do not use Python code]),
279 [enable_python=$enableval],
283 AM_CONDITIONAL([ENABLE_PYTHON], [test x"$enable_python" = x"yes"])
284 AM_CONDITIONAL([ENABLE_DAEMON], [true])
286 if test x"$enable_python" = x"yes"; then
288 AM_PATH_PYTHON([2.5])
289 AC_PATH_PROG(PYTHON_CONFIG, python$PYTHON_VERSION-config)
290 if test x"$PYTHON_CONFIG" = x""; then
291 AC_PATH_PROG(PYTHON_CONFIG, python-config)
293 if test x"$PYTHON_CONFIG" != x""; then
294 PYTHON_CFLAGS=`$PYTHON_CONFIG --includes`
295 PYTHON_LIBS=`$PYTHON_CONFIG --libs`
297 PYTHON_CFLAGS=`$PYTHON $srcdir/python-config.py --includes`
298 PYTHON_LIBS=`$PYTHON $srcdir/python-config.py --libs`
300 PYTHON_INCLUDES="$PYTHON_CFLAGS"
301 AC_SUBST(PYTHON_CFLAGS)
302 AC_SUBST(PYTHON_INCLUDES)
303 AC_SUBST(PYTHON_LIBS)
305 enable_python="no (disabled, use --enable-python to enable)"
312 # define GETTEXT_* variables
313 GETTEXT_PACKAGE=ibus10
314 AC_SUBST(GETTEXT_PACKAGE)
315 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
319 # define gtk2 immodule dir
320 AC_ARG_WITH(gtk2-im-module-dir,
321 AS_HELP_STRING([--with-gtk2-im-module-dir[=DIR]],
322 [Select gtk2 immodule dir]),
323 GTK2_IM_MODULEDIR=$with_gtk2_im_module_dir
325 AC_SUBST(GTK2_IM_MODULEDIR)
327 # define gtk3 immodule dir
328 AC_ARG_WITH(gtk3-im-module-dir,
329 AS_HELP_STRING([--with-gtk3-im-module-dir[=DIR]],
330 [Select gtk3 immodule dir]),
331 GTK3_IM_MODULEDIR=$with_gtk3_im_module_dir
333 AC_SUBST(GTK3_IM_MODULEDIR)
335 if test x"$enable_python" = x"yes"; then
336 # check for dbus-python
337 AC_ARG_ENABLE(dbus-python-check,
338 AS_HELP_STRING([--disable-dbus-python-check],
339 [Do not check dbus-python]),
340 [enable_dbus_python_check=$enableval],
341 [enable_dbus_python_check=yes]
343 PKG_CHECK_MODULES(DBUS_PYTHON,
344 [dbus-python >= 0.83.0],
345 [IBUS_HAS_DBUS_PYTHON=yes],
346 [IBUS_HAS_DBUS_PYTHON=no]
348 if test x"$IBUS_HAS_DBUS_PYTHON" != x"yes"; then
349 if test x"$enable_dbus_python_check" != x"no"; then
350 AC_MSG_ERROR([can not find dbus-python >= 0.83.0. Please install or update dbus-python.])
352 AC_MSG_WARN([can not find dbus-python >= 0.83.0. It is required.])
357 # option for always disable snooper applications
358 AC_ARG_ENABLE(key-snooper,
359 AS_HELP_STRING([--disable-key-snooper],
360 [Always disable key snooper in gtk im module]),
361 [enable_key_snooper=$enableval],
362 [enable_key_snooper=yes]
364 if test x"$enable_key_snooper" = x"yes"; then
365 AC_DEFINE(ENABLE_SNOOPER, TRUE, [Enable key snooper])
367 AC_DEFINE(ENABLE_SNOOPER, FALSE, [Enable key snooper])
368 enable_key_snooper="no (disabled, use --enable-key-snooper to enable)"
371 # option for no snooper applications
372 AC_ARG_WITH(no-snooper-apps,
373 AS_HELP_STRING([--with-no-snooper-apps[=regex1,regex2]],
374 [Does not enable keyboard snooper in those applications (like: .*chrome.*,firefox.*)]),
375 NO_SNOOPER_APPS=$with_no_snooper_apps,
376 NO_SNOOPER_APPS=[.*chrome.*,.*chromium.*,firefox.*,Do.*]
378 AC_DEFINE_UNQUOTED(NO_SNOOPER_APPS, "$NO_SNOOPER_APPS",
379 [Does not enbale keyboard snooper in those applications])
381 # GNOME 3 uses the theme's icon
382 AC_ARG_WITH(panel-icon-keyboard,
383 AS_HELP_STRING([--with-panel-icon-keyboard[=icon_name]],
384 [Set the default panel icon (default: "input-keyboard-symbolic")]),
385 [if test x"$with_panel_icon_keyboard" = x"yes" -o \
386 x"$with_panel_icon_keyboard" = x; then
387 with_panel_icon_keyboard="input-keyboard-symbolic"
389 if test x"$with_panel_icon_keyboard" = x"legacy"; then
390 with_panel_icon_keyboard="ibus-keyboard"
392 IBUS_ICON_KEYBOARD=$with_panel_icon_keyboard
394 IBUS_ICON_KEYBOARD="input-keyboard-symbolic"
396 AC_SUBST(IBUS_ICON_KEYBOARD)
398 # option for enable surrounding-text
399 AC_ARG_ENABLE(surrounding-text,
400 AS_HELP_STRING([--enable-surrounding-text],
401 [Enable surrounding-text support]),
402 [enable_surrounding_text=$enableval],
403 [enable_surrounding_text=no]
405 if test x"$enable_surrounding_text" = x"yes"; then
406 AC_DEFINE(ENABLE_SURROUNDING, TRUE, [Enable surrounding-text support])
408 enable_surrounding_text="no (disabled, use --enable-surrounding-text to enable)"
412 PKG_CHECK_MODULES(ISOCODES, [
415 ISOCODES_PREFIX=`pkg-config iso-codes --variable=prefix`
416 AC_SUBST(ISOCODES_PREFIX)
419 AC_CONFIG_FILES([ po/Makefile.in
425 memconf/memconf.xml.in
438 data/keymaps/Makefile
441 docs/reference/Makefile
442 docs/reference/ibus/ibus-docs.sgml
443 docs/reference/ibus/Makefile
447 ibus/interface/Makefile
451 ui/gtk/gtkpanel.xml.in
457 bindings/vala/Makefile
466 Install prefix $prefix
467 Build shared libs $enable_shared
468 Build static libs $enable_static
470 Gtk2 immodule dir $GTK2_IM_MODULEDIR
471 Gtk3 immodule dir $GTK3_IM_MODULEDIR
472 Build gtk2 immodule $enable_gtk2
473 Build gtk3 immodule $enable_gtk3
474 Build XIM agent server $enable_xim
475 Build python modules $enable_python
476 Build gconf modules $enable_gconf
477 Build memconf modules $enable_memconf
478 Build dconf modules $enable_dconf
479 Build introspection $found_introspection
480 IBus-1.0.gir scannerflags "$IBUS_GIR_SCANNERFLAGS"
481 Build vala binding $enable_vala
482 Build document $enable_gtk_doc
483 Enable key snooper $enable_key_snooper
484 No snooper regexes "$NO_SNOOPER_APPS"
485 Panel icon "$IBUS_ICON_KEYBOARD"
486 Enable surrounding-text $enable_surrounding_text