5 # Copyright (c) 2007-2009 Peng Huang <shawn.p.huang@gmail.com>
6 # Copyright (c) 2007-2009 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], [0])
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
64 m4_define([lt_current], [1])
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(PYGOBJECT2, [
88 # pygobject-2.0 >= 2.14
91 # check for gtk, gdk & pygtk
92 PKG_CHECK_MODULES(GTK2, [
96 gtk_binary_version=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
97 GTK_IM_MODULEDIR="$libdir"/gtk-2.0/$gtk_binary_version/immodules
99 PKG_CHECK_MODULES(GDK2, [
106 # check for dbus-glib
107 PKG_CHECK_MODULES(DBUS, [
112 PKG_CHECK_MODULES(GCONF,
116 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
117 if test x"$GCONFTOOL" = xno; then
118 AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
123 # GCONF_SERVERDIR=`$PKG_CONFIG --variable=gconf_serverdir gconf-2.0`
125 # if test x"$GCONF_SERVERDIR" != x; then
126 # PATH=$GCONF_SERVERDIR:$PATH
129 # AC_PATH_PROG(GCONF_SANITY_CHECK, gconf-sanity-check-2, no)
130 # if test x"$GCONF_SANITY_CHECK" = xno; then
131 # AC_MSG_ERROR([gconf-sanity-check-2 executable not found in your path - should be installed with GConf])
134 # AC_SUBST(GCONF_SANITY_CHECK)
138 PKG_CHECK_MODULES(X11, [
142 AC_CHECK_HEADERS([X11/XKBlib.h])
145 AC_PATH_PROG(ENV, env)
150 AM_PATH_PYTHON([2.5])
151 AC_PATH_PROG(PYTHON_CONFIG, python$PYTHON_VERSION-config)
152 if test x"$PYTHON_CONFIG" == x""; then
153 AC_PATH_PROG(PYTHON_CONFIG, python-config)
155 if test x"$PYTHON_CONFIG" != x""; then
156 PYTHON_CFLAGS=`$PYTHON_CONFIG --includes`
157 PYTHON_LIBS=`$PYTHON_CONFIG --libs`
159 PYTHON_CFLAGS=`$PYTHON $srcdir/python-config.py --includes`
160 PYTHON_LIBS=`$PYTHON $srcdir/python-config.py --libs`
162 PYTHON_INCLUDES="$PYTHON_CFLAGS"
163 AC_SUBST(PYTHON_CFLAGS)
164 AC_SUBST(PYTHON_INCLUDES)
165 AC_SUBST(PYTHON_LIBS)
171 # define GETTEXT_* variables
173 AC_SUBST(GETTEXT_PACKAGE)
174 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
178 # define configure arguments
179 AC_ARG_WITH(gtk-im-module-dir,
180 AS_HELP_STRING([--with-gtk-im-module-dir[=DIR]],
181 [Select gtk immodule dir]),
182 GTK_IM_MODULEDIR=$with_gtk_im_module_dir
184 AC_SUBST(GTK_IM_MODULEDIR)
186 # check for dbus-python
187 AC_ARG_ENABLE(dbus-python-check,
188 AS_HELP_STRING([--disable-dbus-python-check],
189 [Do not check dbus-python]),
190 [enable_dbus_python_check=$enableval],
191 [enable_dbus_python_check=yes],
193 PKG_CHECK_MODULES(DBUS_PYTHON,
194 [dbus-python >= 0.83.0],
195 [IBUS_HAS_DBUS_PYTHON=yes],
196 [IBUS_HAS_DBUS_PYTHON=no]
198 if test x"$IBUS_HAS_DBUS_PYTHON" != x"yes"; then
199 if test x"$enable_dbus_python_check" != x"no"; then
200 AC_MSG_ERROR([can not find dbus-python >= 0.83.0. Please install or update dbus-python.])
202 AC_MSG_WARN([can not find dbus-python >= 0.83.0. It is required.])
207 AC_ARG_ENABLE(iso-codes-check,
208 AS_HELP_STRING([--disable-iso-codes-check],
209 [Do not check iso-codes]),
210 [enable_iso_codes_check=$enableval],
211 [enable_iso_codes_check=yes],
213 PKG_CHECK_MODULES(ISOCODES,
215 [IBUS_HAS_ISOCODES=yes],
216 [IBUS_HAS_ISOCODES=no],
218 if test x"$IBUS_HAS_ISOCODES" != x"yes"; then
219 if test x"$enable_iso_codes_check" != x"no"; then
220 AC_MSG_ERROR([can not find iso-codes. Please install iso-codes or configure with --disable-iso-codes-check])
222 AC_MSG_WARN([can not find iso-codes. It is required.])
227 AC_CONFIG_FILES([ po/Makefile.in
234 ibus/interface/Makefile
238 ui/gtk/gtkpanel.xml.in
253 data/keymaps/Makefile
255 docs/reference/Makefile
256 docs/reference/ibus/Makefile
264 Install prefix $prefix
265 Build shared libs $enable_shared
266 Build static libs $enable_static
267 Gtk immodule dir $GTK_IM_MODULEDIR
268 Build document $enable_gtk_doc