3 # ibus-libpinyin - Intelligent Pinyin engine based on libpinyin for IBus
5 # Copyright (c) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 # if not 1, append datestamp to the version number.
22 m4_define([ibus_released], [1])
23 m4_define([ibus_major_version], [1])
24 m4_define([ibus_minor_version], [5])
25 m4_define([ibus_micro_version], [91])
26 m4_define(ibus_maybe_datestamp,
27 m4_esyscmd([if test x]ibus_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi]))
29 m4_define([ibus_version],
30 ibus_major_version.ibus_minor_version.ibus_micro_version[]ibus_maybe_datestamp)
32 AC_INIT([ibus-libpinyin], [ibus_version], [https://github.com/libpinyin/ibus-libpinyin/issues/new],[ibus-libpinyin])
33 AM_INIT_AUTOMAKE([1.10])
36 AC_CONFIG_HEADERS([config.h])
37 AC_CONFIG_MACRO_DIR([m4])
38 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
40 # define PACKAGE_VERSION_* variables
51 IT_PROG_INTLTOOL([0.35.0])
55 PKG_CHECK_MODULES(IBUS, [
60 PKG_CHECK_MODULES(SQLITE, [
63 AC_PATH_PROG(SQLITE3, sqlite3)
65 PKG_CHECK_MODULES(LIBPINYIN, [
67 ], [enable_libpinyin=yes])
69 AM_CONDITIONAL(IBUS_BUILD_LIBPINYIN, [test x"$enable_libpinyin" = x"yes"])
71 LIBPINYIN_DATADIR=`$PKG_CONFIG --variable=pkgdatadir libpinyin`
73 AC_SUBST(LIBPINYIN_DATADIR)
76 AC_CHECK_FUNCS([uuid_create], [], [
77 PKG_CHECK_MODULES(LIBUUID, uuid, [
79 AC_DEFINE(HAVE_LIBUUID, 1, [Define if found libuuid])
82 # uuid.pc does not exist
84 AC_CHECK_HEADERS(uuid/uuid.h, [
85 AC_SEARCH_LIBS(uuid_generate, uuid, [
86 test x"$ac_cv_search_uuid_generate" != x"none required" && LIBUUID_LIBS=$ac_cv_search_uuid_generate
87 AC_DEFINE(HAVE_LIBUUID, 1, [Define if found libuuid])
90 AC_MSG_ERROR([Can not find uuid_create and uuid_generate in libc or libuuid])
93 AC_MSG_ERROR([Can not find uuid_create and uuid_generate in libc or libuuid])
99 AM_CONDITIONAL(HAVE_LIBUUID, test x"$HAVE_LIBUUID" = x"yes")
101 # check if ibus_config_get_values, which is available in ibus-1.3.99+ (git master)
102 save_CFLAGS="$CFLAGS"
104 CFLAGS="$CFLAGS $IBUS_CFLAGS"
105 LIBS="$LIBS $IBUS_LIBS"
106 AC_CHECK_FUNCS([ibus_config_get_values])
107 CFLAGS="$save_CFLAGS"
112 AC_PATH_PROG(ENV, env)
116 AM_PATH_PYTHON([2.5])
120 AC_HELP_STRING([--enable-boost],
121 [Use boost to replace stdc++0x.]),
122 [enable_boost=$enableval],
125 if test x"$enable_boost" = x"yes"; then
127 BOOST_REQUIRE([1.39])
128 BOOST_FIND_HEADER([boost/bind.hpp])
129 BOOST_FIND_HEADER([boost/signals2.hpp])
131 AM_CONDITIONAL(HAVE_BOOST, test x"$enable_boost" = x"yes")
134 AC_ARG_ENABLE(opencc,
135 AC_HELP_STRING([--enable-opencc],
136 [Use opencc for simplified and traditional Chinese conversion]),
137 [enable_opencc=$enableval],
140 if test x"$enable_opencc" = x"yes"; then
142 PKG_CHECK_MODULES(OPENCC, [opencc], [
143 AC_DEFINE(HAVE_OPENCC, 1, [Define if found opencc])
147 # define GETTEXT_* variables
148 GETTEXT_PACKAGE=ibus-libpinyin
149 AC_SUBST(GETTEXT_PACKAGE)
150 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
154 # --disable-lua-extension
155 AC_ARG_ENABLE(lua-extension,
156 AS_HELP_STRING([--disable-lua-extension],
157 [do not build lua extension]),
158 [enable_lua_extension=$enableval],
159 [enable_lua_extension=yes]
163 PKG_CHECK_MODULES(LUA, [
166 [has_lua_extension=no]
169 if test x"$has_lua_extension" = x"no";
171 PKG_CHECK_MODULES(LUA, [
174 [enable_lua_extension=no]
178 AM_CONDITIONAL(IBUS_BUILD_LUA_EXTENSION, [test x"$enable_lua_extension" = x"yes"])
180 # --disable-english-input-mode
181 AC_ARG_ENABLE(english-input-mode,
182 AS_HELP_STRING([--disable-english-input-mode],
183 [do not build english input mode]),
184 [enable_english_input_mode=$enableval],
185 [enable_english_input_mode=yes]
188 AM_CONDITIONAL(IBUS_BUILD_ENGLISH_INPUT_MODE, [test x"$enable_english_input_mode" = x"yes"])
190 # --disable-stroke-input-mode
191 AC_ARG_ENABLE(stroke-input-mode,
192 AS_HELP_STRING([--disable-stroke-input-mode],
193 [do not build stroke input mode]),
194 [enable_stroke_input_mode=$enableval],
195 [enable_stroke_input_mode=yes]
198 AM_CONDITIONAL(IBUS_BUILD_STROKE_INPUT_MODE, [test x"$enable_stroke_input_mode" = x"yes"])
201 AC_CONFIG_FILES([ po/Makefile.in
208 setup/ibus-setup-libpinyin
220 Install prefix $prefix
221 Use boost $enable_boost
222 Use opencc $enable_opencc
223 Use libpinyin $enable_libpinyin
224 Build lua extension $enable_lua_extension
225 Build stroke input mode $enable_stroke_input_mode
226 Build english input mode $enable_english_input_mode