5
# Copyright (c) 2007-2014 Peng Huang <shawn.p.huang@gmail.com>
6
# Copyright (c) 2007-2014 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.1 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 GNU
16
# 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 library; if not, write to the Free Software
20
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
24
# If ibus_released is 0, append datestamp to the version number.
25
m4_define([ibus_released], [1])
27
m4_define([ibus_major_version], [1])
28
m4_define([ibus_minor_version], [5])
29
m4_define([ibus_micro_version], [7])
30
m4_define([ibus_abi_current], [5])
31
m4_define([ibus_abi_revision],
32
[m4_eval(100 * ibus_minor_version + ibus_micro_version)])
33
m4_define([ibus_abi_age], [0])
34
m4_define([ibus_maybe_datestamp],
35
m4_esyscmd([test x]ibus_released[ != x1 && date +.%Y%m%d | tr -d '\n\r']))
36
m4_define([ibus_version],
37
ibus_major_version.ibus_minor_version.ibus_micro_version[]ibus_maybe_datestamp)
38
m4_define([ibus_api_version], [ibus_major_version.0])
41
AC_INIT([ibus], [ibus_version],
42
[http://code.google.com/p/ibus/issues/entry],
45
AC_CONFIG_HEADERS([config.h])
46
AC_CONFIG_MACRO_DIR([m4])
48
m4_define([ibus_abi_current_minus_age],
49
[m4_eval(ibus_abi_current - ibus_abi_age)])
50
m4_define([ibus_binary_version],
51
[ibus_major_version.ibus_abi_current_minus_age.ibus_abi_age.ibus_abi_revision])
53
# Required versions of other packages.
54
m4_define([glib_required_version], [2.32.0])
56
# VALA_TARGET_GLIB_VERSION is used by valac --ccode --target-glib .
57
# VALA_TARGET_GLIB_VERSION and glib_required_version will be different
59
VALA_TARGET_GLIB_VERSION=2.32
60
AC_SUBST(VALA_TARGET_GLIB_VERSION)
63
AM_INIT_AUTOMAKE([1.11.1 parallel-tests])
64
AM_MAINTAINER_MODE([enable])
67
# Support silent build rules. Disable
68
# by either passing --disable-silent-rules to configure or passing V=1
70
AM_SILENT_RULES([yes])
72
# Define sustituted variables:
73
IBUS_MAJOR_VERSION=ibus_major_version
74
IBUS_MINOR_VERSION=ibus_minor_version
75
IBUS_MICRO_VERSION=ibus_micro_version
76
IBUS_ABI_CURRENT=ibus_abi_current
77
IBUS_ABI_REVISION=ibus_abi_revision
78
IBUS_ABI_AGE=ibus_abi_age
79
IBUS_VERSION=ibus_version
80
IBUS_API_VERSION=ibus_api_version
81
IBUS_BINARY_VERSION=ibus_binary_version
82
AC_SUBST(IBUS_MAJOR_VERSION)
83
AC_SUBST(IBUS_MINOR_VERSION)
84
AC_SUBST(IBUS_MICRO_VERSION)
85
AC_SUBST(IBUS_ABI_CURRENT)
86
AC_SUBST(IBUS_ABI_REVISION)
87
AC_SUBST(IBUS_ABI_AGE)
88
AC_SUBST(IBUS_API_VERSION)
89
AC_SUBST(IBUS_VERSION)
90
AC_SUBST(IBUS_BINARY_VERSION)
94
# If LT_VERSION_INFO="lt_current:lt_revision:lt_age", libibus is
95
# libibus-ibus_api_version.so.(lt_current - lt_age).lt_age.lt_revision
96
# If the abi is changed, but it is compatible with last version,
97
# ibus_abi_current++, ibus_abi_age++;
98
# If the abi is not compatible with last version,
99
# ibus_abi_current++, ibus_abi_age = 0;
100
m4_define([lt_current], [ibus_abi_current])
101
m4_define([lt_revision], [ibus_abi_revision])
102
m4_define([lt_age], [ibus_abi_age])
103
LT_VERSION_INFO="lt_current:lt_revision:lt_age"
104
LT_CURRENT_MINUS_AGE=m4_eval(lt_current - lt_age)
105
AC_SUBST(LT_VERSION_INFO)
106
AC_SUBST(LT_CURRENT_MINUS_AGE)
108
# Define GETTEXT_* variables.
109
GETTEXT_PACKAGE=ibus10
110
AC_SUBST(GETTEXT_PACKAGE)
111
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
112
[The prefix for out gettext translation domains.])
113
GLIB_DEFINE_LOCALEDIR(GLIB_LOCALE_DIR)
114
GLIB_LOCALE_DIR=$localedir
115
AC_SUBST(GLIB_LOCALE_DIR)
118
m4_define(ibus_datedisplay,
119
m4_esyscmd(date '+%a %b %d %Y' | tr -d '\n\r'))
120
DATE_DISPLAY="ibus_datedisplay"
121
AC_SUBST(DATE_DISPLAY)
124
# Check for programs.
128
AM_PROG_VALAC([0.20])
135
# Define PACKAGE_VERSION_* variables.
140
IT_PROG_INTLTOOL([0.35.0])
143
AC_CHECK_FUNCS(daemon)
148
PKG_CHECK_MODULES(GLIB2, [
149
glib-2.0 >= glib_required_version
151
PKG_CHECK_MODULES(GOBJECT2, [
152
gobject-2.0 >= glib_required_version
154
PKG_CHECK_MODULES(GIO2, [
155
gio-2.0 >= glib_required_version
157
PKG_CHECK_MODULES(GTHREAD2, [
158
gthread-2.0 >= glib_required_version
161
# --disable-tests option.
163
AS_HELP_STRING([--disable-tests],
165
[enable_tests=$enableval],
168
AM_CONDITIONAL([ENABLE_TESTS], [test x"$enable_tests" = x"yes"])
169
if test x"$enable_tests" != x"yes"; then
170
enable_tests="no (disabled, use --enable-tests to enable)"
173
# --disable-gtk2 option.
175
AS_HELP_STRING([--disable-gtk2],
176
[Do not build gtk2 im module]),
177
[enable_gtk2=$enableval],
180
AM_CONDITIONAL([ENABLE_GTK2], [test x"$enable_gtk2" = x"yes"])
182
# --disable-gtk3 option.
184
AS_HELP_STRING([--disable-gtk3],
185
[Do not build gtk3 im module]),
186
[enable_gtk3=$enableval],
189
AM_CONDITIONAL([ENABLE_GTK3], [test x"$enable_gtk3" = x"yes"])
191
# --disable-xim option.
193
AS_HELP_STRING([--disable-xim],
194
[Do not build xim server]),
195
[enable_xim=$enableval],
198
AM_CONDITIONAL([ENABLE_XIM], [test x"$enable_xim" = x"yes"])
200
# --enable-wayland option.
201
AC_ARG_ENABLE(wayland,
202
AS_HELP_STRING([--enable-wayland],
203
[Build wayland support]),
204
[enable_wayland=$enableval],
207
AM_CONDITIONAL([ENABLE_WAYLAND], [test x"$enable_wayland" = x"yes"])
209
if test x"$enable_gtk2" = x"yes" -o x"$enable_xim" = x"yes" ; then
211
PKG_CHECK_MODULES(GTK2, [
216
if test x"$enable_gtk2" = x"yes"; then
218
gtk2_binary_version=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
219
GTK2_IM_MODULEDIR="$libdir"/gtk-2.0/$gtk2_binary_version/immodules
221
PKG_CHECK_MODULES(GDK2, [
225
enable_gtk2="no (disabled, use --enable-gtk2 to enable)"
228
if test x"$enable_gtk3" = x"yes"; then
229
# check for gtk3, gdk3
230
PKG_CHECK_MODULES(GTK3, [
234
gtk3_binary_version=`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`
235
GTK3_IM_MODULEDIR="$libdir"/gtk-3.0/$gtk3_binary_version/immodules
237
PKG_CHECK_MODULES(GDK3, [
241
enable_gtk3="no (disabled, use --enable-gtk3 to enable)"
244
if test x"$enable_xim" = x"yes"; then
246
PKG_CHECK_MODULES(X11, [
249
AC_CHECK_HEADERS([X11/XKBlib.h])
251
enable_xim="no (disabled, use --enable-xim to enable)"
254
if test x"$enable_wayland" = x"yes"; then
256
PKG_CHECK_MODULES(WAYLAND, [
257
wayland-client >= 1.2.0
261
enable_wayland="no (disabled, use --enable-wayland to enable)"
264
# GObject introspection
265
GOBJECT_INTROSPECTION_CHECK([0.6.8])
267
IBUS_GIR_SCANNERFLAGS=
268
if test x"$found_introspection" = x"yes" ; then
269
IBUS_GIR_SCANNERFLAGS="--warn-all --identifier-prefix=IBus --symbol-prefix=ibus"
270
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 0.9.6],
271
[gir_symbol_prefix=yes],
272
[gir_symbol_prefix=no])
273
if test x"$gir_symbol_prefix" = x"no" ; then
274
IBUS_GIR_SCANNERFLAGS="--strip-prefix=IBus"
277
AC_SUBST(IBUS_GIR_SCANNERFLAGS)
280
VAPIGEN_CHECK([0.16])
284
if test x"$enable_gtk_doc" = x"no"; then
285
enable_gtk_doc="no (disabled, use --enable-gtk-doc to enable)"
289
PKG_CHECK_MODULES(DBUS, [
293
# --enable-gconf option.
295
AS_HELP_STRING([--enable-gconf],
297
[enable_gconf=$enableval],
300
AM_CONDITIONAL([ENABLE_GCONF], [test x"$enable_gconf" = x"yes"])
302
if test x"$enable_gconf" = x"yes"; then
304
PKG_CHECK_MODULES(GCONF,
308
AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
309
if test x"$GCONFTOOL" = xno; then
310
AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
314
# GCONF_SCHEMAS_INSTALL should be set in macro AM_GCONF_SOURCE_2
316
AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [false])
317
enable_gconf="no (disabled, use --enable-gconf to enable)"
320
# --enable-memconf option.
321
AC_ARG_ENABLE(memconf,
322
AS_HELP_STRING([--enable-memconf],
323
[Enable configure base on memory]),
324
[enable_memconf=$enableval],
327
AM_CONDITIONAL([ENABLE_MEMCONF], [test "x$enable_memconf" = "xyes"])
330
AS_HELP_STRING([--disable-dconf],
331
[Disable configure base on dconf]),
332
[enable_dconf=$enableval],
335
AM_CONDITIONAL([ENABLE_DCONF], [test x"$enable_dconf" = x"yes"])
337
if test x"$enable_dconf" = x"yes"; then
339
PKG_CHECK_MODULES(DCONF,
342
PKG_CHECK_EXISTS([dconf >= 0.13.4],
343
[AC_DEFINE(DCONF_0_13_4, TRUE, [dconf is 0.13.4 or later])],
345
# check glib-compile-schemas
347
enable_dconf="yes (enabled, use --disable-dconf to disable)"
351
AC_PATH_PROG(ENV_IBUS_TEST, env)
352
AC_SUBST(ENV_IBUS_TEST)
354
AC_ARG_ENABLE(python-library,
355
AS_HELP_STRING([--enable-python-library],
356
[Use ibus python library]),
357
[enable_python_library=$enableval],
358
[enable_python_library=no]
362
AS_HELP_STRING([--disable-setup],
363
[Do not use setup ui.]),
364
[enable_setup=$enableval],
368
AM_CONDITIONAL([ENABLE_PYTHON_LIBRARY], [test x"$enable_python_library" = x"yes"])
369
AM_CONDITIONAL([ENABLE_SETUP], [test x"$enable_setup" = x"yes"])
370
AM_CONDITIONAL([ENABLE_DAEMON], [true])
372
# Define python version
374
AS_HELP_STRING([--with-python[=PATH]],
375
[Select python2 or python3]),
376
[PYTHON=$with_python], []
379
AM_PATH_PYTHON([2.5])
380
AC_PATH_PROG(PYTHON2, python2)
382
if test x"$PYTHON2" = x""; then
386
PYGOBJECT_REQUIRED=3.0.0
388
PKG_CHECK_EXISTS([pygobject-3.0 >= $PYGOBJECT_REQUIRED],
389
[enable_pygobject=yes], [enable_pygobject=no])
391
if test "x$enable_pygobject" = "xyes"; then
392
PKG_CHECK_MODULES(PYTHON, [pygobject-3.0 >= $PYGOBJECT_REQUIRED])
394
pyoverridesdir=`$PYTHON -c "import gi; print(gi._overridesdir)"`
395
AC_SUBST(pyoverridesdir)
397
py2overridesdir=`$PYTHON2 -c "import gi; print(gi._overridesdir)"`
398
AC_SUBST(py2overridesdir)
401
AM_CONDITIONAL(ENABLE_PYGOBJECT, test x"$enable_pygobject" = "xyes")
403
if test x"$enable_python_library" = x"yes"; then
405
AC_PATH_PROG(PYTHON_CONFIG, python$PYTHON_VERSION-config)
406
if test x"$PYTHON_CONFIG" = x""; then
407
AC_PATH_PROG(PYTHON_CONFIG, python-config)
409
if test x"$PYTHON_CONFIG" != x""; then
410
PYTHON_CFLAGS=`$PYTHON_CONFIG --includes`
411
PYTHON_LIBS=`$PYTHON_CONFIG --libs`
413
PYTHON_CFLAGS=`$PYTHON $srcdir/python-config.py --includes`
414
PYTHON_LIBS=`$PYTHON $srcdir/python-config.py --libs`
416
PYTHON_INCLUDES="$PYTHON_CFLAGS"
417
AC_SUBST(PYTHON_CFLAGS)
418
AC_SUBST(PYTHON_INCLUDES)
419
AC_SUBST(PYTHON_LIBS)
421
PYTHON2_PREFIX=`$PYTHON2 -c "import sys; sys.stdout.write(sys.prefix)"`
422
PYTHON2_VERSION=`$PYTHON2 -c "import sys; sys.stdout.write(sys.version[[:3]])"`
423
PYTHON2_LIBDIR="$PYTHON2_PREFIX/lib/python$PYTHON2_VERSION"
424
python2dir="$PYTHON2_LIBDIR/site-packages"
425
pkgpython2dir="$python2dir/ibus"
426
AC_SUBST(pkgpython2dir)
428
enable_python_library="no (disabled, use --enable-python-library to enable)"
431
# Define gtk2 immodule dir.
432
AC_ARG_WITH(gtk2-im-module-dir,
433
AS_HELP_STRING([--with-gtk2-im-module-dir[=DIR]],
434
[Select gtk2 immodule dir]),
435
GTK2_IM_MODULEDIR=$with_gtk2_im_module_dir
437
AC_SUBST(GTK2_IM_MODULEDIR)
439
# Define gtk3 immodule dir.
440
AC_ARG_WITH(gtk3-im-module-dir,
441
AS_HELP_STRING([--with-gtk3-im-module-dir[=DIR]],
442
[Select gtk3 immodule dir]),
443
GTK3_IM_MODULEDIR=$with_gtk3_im_module_dir
445
AC_SUBST(GTK3_IM_MODULEDIR)
447
if test x"$enable_python" = x"yes"; then
448
# Check for dbus-python.
449
AC_ARG_ENABLE(dbus-python-check,
450
AS_HELP_STRING([--disable-dbus-python-check],
451
[Do not check dbus-python]),
452
[enable_dbus_python_check=$enableval],
453
[enable_dbus_python_check=yes]
455
PKG_CHECK_MODULES(DBUS_PYTHON,
456
[dbus-python >= 0.83.0],
457
[IBUS_HAS_DBUS_PYTHON=yes],
458
[IBUS_HAS_DBUS_PYTHON=no]
460
if test x"$IBUS_HAS_DBUS_PYTHON" != x"yes"; then
461
if test x"$enable_dbus_python_check" != x"no"; then
462
AC_MSG_ERROR([can not find dbus-python >= 0.83.0. Please install or update dbus-python.])
464
AC_MSG_WARN([can not find dbus-python >= 0.83.0. It is required.])
469
# Option for always disable snooper applications.
470
AC_ARG_ENABLE(key-snooper,
471
AS_HELP_STRING([--disable-key-snooper],
472
[Always disable key snooper in gtk im module]),
473
[enable_key_snooper=$enableval],
474
[enable_key_snooper=yes]
476
if test x"$enable_key_snooper" = x"yes"; then
477
AC_DEFINE(ENABLE_SNOOPER, TRUE, [Enable key snooper])
479
AC_DEFINE(ENABLE_SNOOPER, FALSE, [Enable key snooper])
480
enable_key_snooper="no (disabled, use --enable-key-snooper to enable)"
483
# Option for no snooper applications.
484
AC_ARG_WITH(no-snooper-apps,
485
AS_HELP_STRING([--with-no-snooper-apps[=regex1,regex2]],
486
[Does not enable keyboard snooper in those applications (like: .*chrome.*,firefox.*)]),
487
NO_SNOOPER_APPS=$with_no_snooper_apps,
488
NO_SNOOPER_APPS=[.*chrome.*,.*chromium.*,firefox.*,Do.*]
490
AC_DEFINE_UNQUOTED(NO_SNOOPER_APPS, "$NO_SNOOPER_APPS",
491
[Does not enbale keyboard snooper in those applications])
493
# GNOME 3 uses the theme's icon.
494
AC_ARG_WITH(panel-icon-keyboard,
495
AS_HELP_STRING([--with-panel-icon-keyboard[=icon_name]],
496
[Set the default panel icon (default: "ibus-keyboard")]),
497
[if test x"$with_panel_icon_keyboard" = x"yes" -o \
498
x"$with_panel_icon_keyboard" = x; then
499
with_panel_icon_keyboard="input-keyboard-symbolic"
501
if test x"$with_panel_icon_keyboard" = x"legacy"; then
502
with_panel_icon_keyboard="ibus-keyboard"
504
IBUS_ICON_KEYBOARD=$with_panel_icon_keyboard
506
IBUS_ICON_KEYBOARD="ibus-keyboard"
508
AC_SUBST(IBUS_ICON_KEYBOARD)
510
# --disable-surrounding-text option.
511
AC_ARG_ENABLE(surrounding-text,
512
AS_HELP_STRING([--disable-surrounding-text],
513
[Enable surrounding-text support]),
514
[enable_surrounding_text=$enableval],
515
[enable_surrounding_text=yes]
517
if test x"$enable_surrounding_text" = x"yes"; then
518
AC_DEFINE(ENABLE_SURROUNDING, TRUE, [Enable surrounding-text support])
520
enable_surrounding_text="no (disabled, use --enable-surrounding-text to enable)"
525
AS_HELP_STRING([--disable-ui],
526
[Disable ibus default user interface]),
527
[enable_ui=$enableval],
530
AM_CONDITIONAL([ENABLE_UI], [test x"$enable_ui" = x"yes"])
531
if test x"$enable_ui" = x"yes"; then
532
enable_ui="yes (enabled, use --disable-ui to disable)"
536
AC_ARG_ENABLE(engine,
537
AS_HELP_STRING([--disable-engine],
538
[Disable ibus simple engine]),
539
[enable_engine=$enableval],
542
AM_CONDITIONAL([ENABLE_ENGINE], [test x"$enable_engine" = x"yes"])
543
if test x"$enable_engine" = x"yes"; then
544
enable_engine="yes (enabled, use --disable-engine to disable)"
547
# --disable-libnotify
548
AC_ARG_ENABLE(libnotify,
549
AS_HELP_STRING([--disable-libnotify],
550
[Disable to link libnotify]),
551
[enable_libnotify=$enableval],
552
[enable_libnotify=yes]
554
AM_CONDITIONAL([ENABLE_LIBNOTIFY], [test x"$enable_libnotify" = x"yes"])
555
if test x"$enable_libnotify" = x"yes"; then
556
PKG_CHECK_MODULES(LIBNOTIFY, [
559
enable_libnotify="yes (enabled, use --disable-libnotify to disable)"
563
PKG_CHECK_MODULES(ISOCODES, [
566
ISOCODES_PREFIX=`pkg-config iso-codes --variable=prefix`
567
AC_SUBST(ISOCODES_PREFIX)
570
AC_CONFIG_FILES([ po/Makefile.in
578
client/wayland/Makefile
588
data/keymaps/Makefile
591
docs/reference/Makefile
592
docs/reference/ibus/ibus-docs.sgml
593
docs/reference/ibus/Makefile
597
ibus/interface/Makefile
603
bindings/pygobject/Makefile
604
bindings/vala/Makefile
608
conf/memconf/Makefile
615
Version $IBUS_VERSION
616
Install prefix $prefix
617
Build shared libs $enable_shared
618
Build static libs $enable_static
622
Gtk2 immodule dir $GTK2_IM_MODULEDIR
623
Gtk3 immodule dir $GTK3_IM_MODULEDIR
624
Build gtk2 immodule $enable_gtk2
625
Build gtk3 immodule $enable_gtk3
626
Build XIM agent server $enable_xim
627
Build wayland support $enable_wayland
628
Build python library $enable_python_library
629
Build gconf modules $enable_gconf
630
Build memconf modules $enable_memconf
631
Build dconf modules $enable_dconf
632
Build introspection $found_introspection
633
IBus-1.0.gir scannerflags "$IBUS_GIR_SCANNERFLAGS"
634
Build vala binding $enable_vala
635
Build document $enable_gtk_doc
637
Build engine $enable_engine
638
Enable key snooper $enable_key_snooper
639
No snooper regexes "$NO_SNOOPER_APPS"
640
Panel icon "$IBUS_ICON_KEYBOARD"
641
Enable surrounding-text $enable_surrounding_text
642
Enable libnotify $enable_libnotify
643
Run test cases $enable_tests