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
23 # if not 1, append datestamp to the version number.
24 m4_define([ibus_released], [1])
25 m4_define([ibus_major_version], [1])
26 m4_define([ibus_minor_version], [3])
27 m4_define([ibus_micro_version], [3])
28 m4_define(ibus_maybe_datestamp,
29 m4_esyscmd([if test x]ibus_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi]))
31 m4_define([ibus_version],
32 ibus_major_version.ibus_minor_version.ibus_micro_version[]ibus_maybe_datestamp)
34 AC_INIT([ibus], [ibus_version], [http://code.google.com/p/ibus/issues/entry],[ibus])
35 AM_INIT_AUTOMAKE([1.10])
38 AC_CONFIG_HEADERS([config.h])
39 AC_CONFIG_MACRO_DIR([m4])
40 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
42 # define PACKAGE_VERSION_* variables
53 IT_PROG_INTLTOOL([0.35.0])
56 m4_define(ibus_datedisplay,
57 m4_esyscmd(date '+%a %b %d %Y' | tr -d '\n\r'))
58 DATE_DISPLAY="ibus_datedisplay"
59 AC_SUBST(DATE_DISPLAY)
61 # If only source code changed, lt_revision + 1
62 # If any interface added, lt_age + 1
63 # If any interfaces changed or removed, lt_current + 1, lt_revision = 0, lt_age = 0
64 m4_define([lt_current], [2])
65 m4_define([lt_revision], [0])
66 m4_define([lt_age], [0])
67 LT_VERSION_INFO="lt_current:lt_revision:lt_age"
68 AC_SUBST(LT_VERSION_INFO)
71 AC_CHECK_HEADERS([sys/inotify.h])
74 AC_CHECK_FUNCS(daemon)
78 PKG_CHECK_MODULES(GLIB2, [
81 PKG_CHECK_MODULES(GOBJECT2, [
84 PKG_CHECK_MODULES(GIO2, [
87 PKG_CHECK_MODULES(GTHREAD2, [
90 # PKG_CHECK_MODULES(PYGOBJECT2, [
91 # pygobject-2.0 >= 2.14
94 # check for gtk, gdk & pygtk
95 PKG_CHECK_MODULES(GTK2, [
99 gtk_binary_version=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
100 GTK_IM_MODULEDIR="$libdir"/gtk-2.0/$gtk_binary_version/immodules
102 PKG_CHECK_MODULES(GDK2, [
109 # check for dbus-glib
110 PKG_CHECK_MODULES(DBUS, [
115 AS_HELP_STRING([--disable-gconf],
116 [Do not use GConf code]),
117 [enable_gconf=$enableval],
121 AM_CONDITIONAL([ENABLE_GCONF], [test "x$enable_gconf" = "xyes"])
123 if test x"$enable_gconf" != x"no"; then
125 PKG_CHECK_MODULES(GCONF,
129 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
130 if test x"$GCONFTOOL" = xno; then
131 AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
135 # GCONF_SCHEMAS_INSTALL should be set in macro AM_GCONF_SOURCE_2
137 AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [false])
141 PKG_CHECK_MODULES(X11, [
145 AC_CHECK_HEADERS([X11/XKBlib.h])
148 AC_PATH_PROG(ENV, env)
151 AC_ARG_ENABLE(python,
152 AS_HELP_STRING([--disable-python],
153 [Do not use Python code]),
154 [enable_python=$enableval],
158 AM_CONDITIONAL([ENABLE_PYTHON], [test "x$enable_python" = "xyes"])
160 if test x"$enable_python" != x"no"; then
162 AM_PATH_PYTHON([2.5])
163 AC_PATH_PROG(PYTHON_CONFIG, python$PYTHON_VERSION-config)
164 if test x"$PYTHON_CONFIG" = x""; then
165 AC_PATH_PROG(PYTHON_CONFIG, python-config)
167 if test x"$PYTHON_CONFIG" != x""; then
168 PYTHON_CFLAGS=`$PYTHON_CONFIG --includes`
169 PYTHON_LIBS=`$PYTHON_CONFIG --libs`
171 PYTHON_CFLAGS=`$PYTHON $srcdir/python-config.py --includes`
172 PYTHON_LIBS=`$PYTHON $srcdir/python-config.py --libs`
174 PYTHON_INCLUDES="$PYTHON_CFLAGS"
175 AC_SUBST(PYTHON_CFLAGS)
176 AC_SUBST(PYTHON_INCLUDES)
177 AC_SUBST(PYTHON_LIBS)
184 # define GETTEXT_* variables
186 AC_SUBST(GETTEXT_PACKAGE)
187 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
191 # define configure arguments
192 AC_ARG_WITH(gtk-im-module-dir,
193 AS_HELP_STRING([--with-gtk-im-module-dir[=DIR]],
194 [Select gtk immodule dir]),
195 GTK_IM_MODULEDIR=$with_gtk_im_module_dir
197 AC_SUBST(GTK_IM_MODULEDIR)
199 if test x"$enable_python" != x"no"; then
200 # check for dbus-python
201 AC_ARG_ENABLE(dbus-python-check,
202 AS_HELP_STRING([--disable-dbus-python-check],
203 [Do not check dbus-python]),
204 [enable_dbus_python_check=$enableval],
205 [enable_dbus_python_check=yes]
207 PKG_CHECK_MODULES(DBUS_PYTHON,
208 [dbus-python >= 0.83.0],
209 [IBUS_HAS_DBUS_PYTHON=yes],
210 [IBUS_HAS_DBUS_PYTHON=no]
212 if test x"$IBUS_HAS_DBUS_PYTHON" != x"yes"; then
213 if test x"$enable_dbus_python_check" != x"no"; then
214 AC_MSG_ERROR([can not find dbus-python >= 0.83.0. Please install or update dbus-python.])
216 AC_MSG_WARN([can not find dbus-python >= 0.83.0. It is required.])
221 # option for disable snooper applications
222 AC_ARG_ENABLE(key-snooper,
223 AS_HELP_STRING([--disable-key-snooper],
224 [Disable key snooper in gtk im module]),
225 [enable_key_snooper=$enableval],
226 [enable_key_snooper=yes]
228 if test x"$enable_key_snooper" != x"no"; then
229 AC_DEFINE(ENABLE_SNOOPER, TRUE, [Enable key snooper])
231 AC_DEFINE(ENABLE_SNOOPER, FALSE, [Enable key snooper])
234 # option for no snooper applications
235 AC_ARG_WITH(no-snooper-apps,
236 AS_HELP_STRING([--with-no-snooper-apps[=app1,app2]],
237 [Does not enable keyboard snooper in those applications]),
238 NO_SNOOPER_APPS=$with_no_snooper_apps
240 AC_DEFINE_UNQUOTED(NO_SNOOPER_APPS, "$NO_SNOOPER_APPS",
241 [Does not enbale key snooper in those applications])
244 PKG_CHECK_MODULES(ISOCODES, [
247 ISOCODES_PREFIX=`pkg-config iso-codes --variable=prefix`
248 AC_SUBST(ISOCODES_PREFIX)
251 AC_CONFIG_FILES([ po/Makefile.in
266 data/keymaps/Makefile
268 docs/reference/Makefile
269 docs/reference/ibus/Makefile
273 ibus/interface/Makefile
277 ui/gtk/gtkpanel.xml.in
288 Install prefix $prefix
289 Build shared libs $enable_shared
290 Build static libs $enable_static
291 Gtk immodule dir $GTK_IM_MODULEDIR
292 Build python modules $enable_python
293 Build gconf modules $enable_gconf
294 Build document $enable_gtk_doc
295 Enable key snooper $enable_key_snooper
296 No snooper apps "$NO_SNOOPER_APPS"