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], [0])
25 m4_define([ibus_major_version], [1])
26 m4_define([ibus_minor_version], [2])
27 m4_define([ibus_micro_version], [99])
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])
41 # define PACKAGE_VERSION_* variables
52 IT_PROG_INTLTOOL([0.35.0])
55 m4_define(ibus_maybe_datedisplay,
56 m4_esyscmd([if test x]ibus_released[ != x1; then date '+%a %b %d %Y' | tr -d '\n\r'; fi]))
57 m4_define([ibus_datedisplay], ibus_maybe_datedisplay)
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 PKG_CHECK_MODULES(GCONF,
119 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
120 if test x"$GCONFTOOL" = xno; then
121 AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
126 # GCONF_SERVERDIR=`$PKG_CONFIG --variable=gconf_serverdir gconf-2.0`
128 # if test x"$GCONF_SERVERDIR" != x; then
129 # PATH=$GCONF_SERVERDIR:$PATH
132 # AC_PATH_PROG(GCONF_SANITY_CHECK, gconf-sanity-check-2, no)
133 # if test x"$GCONF_SANITY_CHECK" = xno; then
134 # AC_MSG_ERROR([gconf-sanity-check-2 executable not found in your path - should be installed with GConf])
137 # AC_SUBST(GCONF_SANITY_CHECK)
141 PKG_CHECK_MODULES(X11, [
145 AC_CHECK_HEADERS([X11/XKBlib.h])
148 AC_PATH_PROG(ENV, env)
153 AM_PATH_PYTHON([2.5])
154 AC_PATH_PROG(PYTHON_CONFIG, python$PYTHON_VERSION-config)
155 if test x"$PYTHON_CONFIG" == x""; then
156 AC_PATH_PROG(PYTHON_CONFIG, python-config)
158 if test x"$PYTHON_CONFIG" != x""; then
159 PYTHON_CFLAGS=`$PYTHON_CONFIG --includes`
160 PYTHON_LIBS=`$PYTHON_CONFIG --libs`
162 PYTHON_CFLAGS=`$PYTHON $srcdir/python-config.py --includes`
163 PYTHON_LIBS=`$PYTHON $srcdir/python-config.py --libs`
165 PYTHON_INCLUDES="$PYTHON_CFLAGS"
166 AC_SUBST(PYTHON_CFLAGS)
167 AC_SUBST(PYTHON_INCLUDES)
168 AC_SUBST(PYTHON_LIBS)
174 # define GETTEXT_* variables
176 AC_SUBST(GETTEXT_PACKAGE)
177 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
181 # define configure arguments
182 AC_ARG_WITH(gtk-im-module-dir,
183 AS_HELP_STRING([--with-gtk-im-module-dir[=DIR]],
184 [Select gtk immodule dir]),
185 GTK_IM_MODULEDIR=$with_gtk_im_module_dir
187 AC_SUBST(GTK_IM_MODULEDIR)
189 # check for dbus-python
190 AC_ARG_ENABLE(dbus-python-check,
191 AS_HELP_STRING([--disable-dbus-python-check],
192 [Do not check dbus-python]),
193 [enable_dbus_python_check=$enableval],
194 [enable_dbus_python_check=yes],
196 PKG_CHECK_MODULES(DBUS_PYTHON,
197 [dbus-python >= 0.83.0],
198 [IBUS_HAS_DBUS_PYTHON=yes],
199 [IBUS_HAS_DBUS_PYTHON=no]
201 if test x"$IBUS_HAS_DBUS_PYTHON" != x"yes"; then
202 if test x"$enable_dbus_python_check" != x"no"; then
203 AC_MSG_ERROR([can not find dbus-python >= 0.83.0. Please install or update dbus-python.])
205 AC_MSG_WARN([can not find dbus-python >= 0.83.0. It is required.])
210 AC_ARG_ENABLE(iso-codes-check,
211 AS_HELP_STRING([--disable-iso-codes-check],
212 [Do not check iso-codes]),
213 [enable_iso_codes_check=$enableval],
214 [enable_iso_codes_check=yes],
216 PKG_CHECK_MODULES(ISOCODES,
218 [IBUS_HAS_ISOCODES=yes],
219 [IBUS_HAS_ISOCODES=no],
221 if test x"$IBUS_HAS_ISOCODES" != x"yes"; then
222 if test x"$enable_iso_codes_check" != x"no"; then
223 AC_MSG_ERROR([can not find iso-codes. Please install iso-codes or configure with --disable-iso-codes-check])
225 AC_MSG_WARN([can not find iso-codes. It is required.])
230 AC_CONFIG_FILES([ po/Makefile.in
237 ibus/interface/Makefile
241 ui/gtk/gtkpanel.xml.in
256 data/keymaps/Makefile
258 docs/reference/Makefile
259 docs/reference/ibus/Makefile
267 Install prefix $prefix
268 Build shared libs $enable_shared
269 Build static libs $enable_static
270 Gtk immodule dir $GTK_IM_MODULEDIR
271 Build document $enable_gtk_doc