forked from janghe11/nimf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
257 lines (205 loc) · 9.15 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
dnl Process this file with autoconf to produce a configure script.
AC_INIT(nimf, 2018.05.20)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror])
AM_MAINTAINER_MODE([disable])
AM_SILENT_RULES([yes])
AM_PROG_AR
AC_PROG_CC
AC_PROG_CXX
AS_IF([test "$CXX" = "g++"],
[AS_IF([test "$GXX" != "yes"],
AC_MSG_ERROR([C++ compiler is not found.]))])
dnl ***************************************************************************
dnl Libtool Versioning
dnl ***************************************************************************
# Before making a release, the LT_VERSION string should be modified.
# The string is of the form C:R:A.
# - If interfaces have been changed or added, but binary compatibility has
# been preserved, change to C+1:0:A+1
# - If binary compatibility has been broken (eg removed or changed interfaces)
# change to C+1:0:0
# - If the interface is the same as the previous version, change to C:R+1:A
LIBNIMF_LT_VERSION=0:0:0
AC_SUBST(LIBNIMF_LT_VERSION)
dnl ***************************************************************************
dnl Internationalization
dnl ***************************************************************************
IT_PROG_INTLTOOL(0.50.1)
GETTEXT_PACKAGE=nimf
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [gettext package name])
AC_SUBST(GETTEXT_PACKAGE)
AM_GLIB_GNU_GETTEXT
AM_GLIB_DEFINE_LOCALEDIR(NIMF_LOCALE_DIR)
LT_INIT([disable-static])
LIBNIMF_REQUIRES="glib-2.0 gio-2.0 gio-unix-2.0 gmodule-2.0 audit"
AC_SUBST(LIBNIMF_REQUIRES)
PKG_CHECK_MODULES(LIBNIMF_DEPS, [$LIBNIMF_REQUIRES])
dnl ***************************************************************************
dnl nimf-chewing nimf-libhangul nimf-rime nimf-system-keyboard
dnl ***************************************************************************
PKG_CHECK_MODULES(NIMF_CHEWING_DEPS, [chewing $LIBNIMF_REQUIRES])
PKG_CHECK_MODULES(NIMF_LIBHANGUL_DEPS, [libhangul >= 0.0.12 $LIBNIMF_REQUIRES])
PKG_CHECK_MODULES(NIMF_RIME_DEPS, [rime >= 1.2.9 $LIBNIMF_REQUIRES])
PKG_CHECK_MODULES(NIMF_SYSTEM_KEYBOARD_DEPS,
[xkbcommon >= 0.5.0 $LIBNIMF_REQUIRES])
dnl ***************************************************************************
dnl nimf-anthy
dnl ***************************************************************************
PKG_CHECK_MODULES(NIMF_ANTHY_DEPS, [anthy $LIBNIMF_REQUIRES])
AC_CHECK_FILE([/var/lib/anthy/anthy.dic], [HAVE_ANTHY_DIC="yes"])
AC_CHECK_FILE([/usr/share/anthy/anthy.dic], [HAVE_ANTHY_DIC="yes"])
AS_IF([test "x$HAVE_ANTHY_DIC" != "xyes"],
AC_MSG_ERROR([anthy.dic is not found.]))
dnl ***************************************************************************
dnl Qt
dnl ***************************************************************************
PKG_CHECK_MODULES(NIMF_QT4_DEPS, [QtGui], [],
[AC_MSG_ERROR([No package 'QtGui' found.
If you are using Debian, please install 'libqt4-dev'.])])
PKG_CHECK_MODULES(NIMF_QT5_DEPS, [Qt5Core Qt5Gui Qt5Widgets], [],
[AC_MSG_ERROR([Package requirements (Qt5Core Qt5Gui Qt5Widgets) were not met:
If you are using Debian, please install 'qtbase5-dev'.])])
QT5_VERSION=`pkg-config --modversion Qt5Core`
QT5_INCLUDE_DIR=`pkg-config --variable=includedir Qt5Core`
QT5_CORE_PRIVATE_INCLUDE_PATH=$QT5_INCLUDE_DIR/QtCore/$QT5_VERSION
QT5_GUI_PRIVATE_INCLUDE_PATH=$QT5_INCLUDE_DIR/QtGui/$QT5_VERSION
AC_CHECK_FILES(
[$QT5_GUI_PRIVATE_INCLUDE_PATH/QtGui/qpa/qplatforminputcontext.h
$QT5_GUI_PRIVATE_INCLUDE_PATH/QtGui/qpa/qplatforminputcontextplugin_p.h], [],
AC_MSG_ERROR([Qt 5 base private development files are not found.]))
AC_SUBST(QT5_CORE_PRIVATE_INCLUDE_PATH)
AC_SUBST(QT5_GUI_PRIVATE_INCLUDE_PATH)
AC_PATH_PROGS([QT5_MOC], [moc-qt5 moc], [no],
[`pkg-config --variable=host_bins Qt5Core`])
if test "x$QT5_MOC" = "xno"; then
AC_MSG_ERROR([moc for qt5 not found])
fi
QT5_LIB_DIR=`pkg-config --variable=libdir Qt5Core`
case `pkg-config --variable=includedir Qt5Core` in
*/qt5)
QT5_IM_MODULE_DIR=$QT5_LIB_DIR/qt5/plugins/platforminputcontexts
;;
*/qt)
QT5_IM_MODULE_DIR=$QT5_LIB_DIR/qt/plugins/platforminputcontexts
;;
*)
AC_MSG_ERROR(Can not determine Qt5 plugins/platforminputcontexts directory)
;;
esac
AC_SUBST(QT5_IM_MODULE_DIR)
dnl ***************************************************************************
dnl Check for im-nimf-gtk
dnl ***************************************************************************
PKG_CHECK_MODULES(IM_NIMF_GTK3_DEPS, [gtk+-3.0 gdk-x11-3.0])
PKG_CHECK_MODULES(IM_NIMF_GTK2_DEPS, [gtk+-2.0])
case `uname -m` in
x86_64)
BITS=64
;;
*)
BITS=32
;;
esac
GTK3_LIBDIR=`pkg-config --variable=libdir gtk+-3.0`
GTK3_BINARY_VERSION=`pkg-config --variable=gtk_binary_version gtk+-3.0`
AC_SUBST(GTK3_LIBDIR)
AC_SUBST(GTK3_BINARY_VERSION)
AC_PATH_PROGS([GTK_QUERY_IMMODULES3],
[gtk-query-immodules-3.0 gtk-query-immodules-3.0-$BITS], [no],
[/usr/bin:$GTK3_LIBDIR/libgtk-3-0])
if test "x$GTK_QUERY_IMMODULES3" = "xno"; then
AC_MSG_ERROR([gtk-query-immodules-3.0 or gtk-query-immodules-3.0-$BITS not found])
fi
GTK2_LIBDIR=`pkg-config --variable=libdir gtk+-2.0`
GTK2_BINARY_VERSION=`pkg-config --variable=gtk_binary_version gtk+-2.0`
AC_SUBST(GTK2_LIBDIR)
AC_SUBST(GTK2_BINARY_VERSION)
AC_PATH_PROGS([GTK_QUERY_IMMODULES2],
[gtk-query-immodules-2.0 gtk-query-immodules-2.0-$BITS], [no],
[/usr/bin:$GTK2_LIBDIR/libgtk2.0-0])
if test "x$GTK_QUERY_IMMODULES2" = "xno"; then
AC_MSG_ERROR([gtk-query-immodules-2.0 or gtk-query-immodules-2.0-$BITS not found])
fi
dnl ***************************************************************************
dnl icon cache
dnl ***************************************************************************
AC_PATH_PROGS([GTK_UPDATE_ICON_CACHE],
[gtk-update-icon-cache-3.0 gtk-update-icon-cache], [no],
[/usr/bin:$GTK3_LIBDIR/libgtk-3-0:$GTK2_LIBDIR/libgtk2.0-0])
if test "x$GTK_UPDATE_ICON_CACHE" = "xno"; then
AC_MSG_ERROR([gtk-update-icon-cache-3.0 or gtk-update-icon-cache not found])
fi
AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg], [no])
if test "x$RSVG_CONVERT" = "xno"; then
AC_MSG_ERROR([rsvg-convert or rsvg is not found, please install librsvg2-bin])
fi
dnl ***************************************************************************
dnl nimf-wayland
dnl ***************************************************************************
PKG_CHECK_MODULES(NIMF_WAYLAND_DEPS, [$LIBNIMF_REQUIRES]
wayland-client wayland-server
wayland-protocols xkbcommon)
dnl ***************************************************************************
dnl nimf-xim
dnl ***************************************************************************
PKG_CHECK_MODULES(NIMF_XIM_DEPS, [$LIBNIMF_REQUIRES] x11)
dnl ***************************************************************************
dnl nimf-daemon
dnl ***************************************************************************
PKG_CHECK_MODULES(NIMF_DAEMON_DEPS, [glib-2.0 gio-unix-2.0 gobject-2.0 audit])
dnl ***************************************************************************
dnl nimf-indicator
dnl ***************************************************************************
PKG_CHECK_MODULES(NIMF_INDICATOR_DEPS, [glib-2.0 x11 gtk+-3.0 appindicator3-0.1])
dnl ***************************************************************************
dnl nimf-preedit-window nimf-candidate
dnl ***************************************************************************
PKG_CHECK_MODULES(NIMF_PREEDIT_WINDOW_DEPS, [glib-2.0 gtk+-3.0])
PKG_CHECK_MODULES(NIMF_CANDIDATE_DEPS, [glib-2.0 gtk+-3.0])
dnl ***************************************************************************
dnl nimf-settings
dnl ***************************************************************************
PKG_CHECK_MODULES(NIMF_SETTINGS_DEPS, [gtk+-3.0 gio-2.0 gmodule-2.0])
dnl ***************************************************************************
dnl im-config data
dnl ***************************************************************************
AC_ARG_WITH([im-config-data],
AS_HELP_STRING([--with-im-config-data], [Install im-config data]),
[with_im_config_data=yes])
AM_CONDITIONAL([WITH_IM_CONFIG_DATA],
[test "$with_im_config_data" = "yes"])
dnl ***************************************************************************
GLIB_GSETTINGS
AC_OUTPUT([
Makefile
daemon/Makefile
data/Makefile
data/apparmor-abstractions/Makefile
data/autostart/Makefile
data/icons/Makefile
data/im-config/Makefile
libnimf/Makefile
libnimf/nimf.pc
modules/Makefile
modules/clients/Makefile
modules/clients/gtk/Makefile
modules/clients/qt4/Makefile
modules/clients/qt5/Makefile
modules/engines/Makefile
modules/engines/nimf-anthy/Makefile
modules/engines/nimf-chewing/Makefile
modules/engines/nimf-libhangul/Makefile
modules/engines/nimf-rime/Makefile
modules/engines/nimf-system-keyboard/Makefile
modules/services/Makefile
modules/services/candidate/Makefile
modules/services/indicator/Makefile
modules/services/preedit-window/Makefile
modules/services/wayland/Makefile
modules/services/xim/Makefile
po/Makefile.in
settings/Makefile
])