-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
234 lines (195 loc) · 5.88 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
# Process this file with autoconf to produce a configure script.
AC_INIT([scim-input-pad],[0.1.3.1],[[email protected]])
AC_CONFIG_SRCDIR([src/scim_input_pad.cpp])
SCIM_VERSION=1.4.0
# GTK_VERSION=2.4.0
AC_SUBST(SCIM_VERSION)
# AC_SUBST(GTK_VERSION)
# libtool versioning for SCIM Input Pad
# increment if the interface has additions, changes, removals.
SCIM_INPUT_PAD_CURRENT=1
# increment any time the source changes; set to 0 if you increment CURRENT
SCIM_INPUT_PAD_REVISION=0
# increment if any interfaces have been added; set to 0
# if any interfaces have been removed. removal has
# precedence over adding, so set to 0 if both happened.
SCIM_INPUT_PAD_AGE=1
AC_SUBST(SCIM_INPUT_PAD_CURRENT)
AC_SUBST(SCIM_INPUT_PAD_REVISION)
AC_SUBST(SCIM_INPUT_PAD_AGE)
SCIM_INPUT_PAD_VERSION=$SCIM_INPUT_PAD_CURRENT.$SCIM_INPUT_PAD_REVISION.$SCIM_INPUT_PAD_AGE
GETTEXT_PACKAGE=scim-input-pad
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext domain])
# Init automake stuff
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
#AC_REQUIRE(AC_CANONICAL_HOST)_LT_SET_OPTION([LT_INIT],[win32-dll])
#AC_DIAGNOSE([obsolete],[AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you
#put the `win32-dll' option into LT_INIT's first parameter.])
LT_CONFIG_LTDL_DIR([libltdl])
LT_INIT([dlopen])
LTDL_INIT
AC_SUBST(LIBTOOL_DEPS)
AC_PROG_CXX
AC_PROG_CC
AC_LANG(C)
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
# Init gettext
# ALL_LINGUAS="zh_CN zh_TW pa ja de fr it nl"
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.14.1])
# Check intltool
IT_PROG_INTLTOOL([0.33], [no-xml])
# Check SCIM
PKG_CHECK_MODULES(SCIM,[scim >= $SCIM_VERSION])
# Check gtk2
# PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.4.0])
PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.4.0],
[SCIM_INPUT_PAD_HAS_GTK2=yes],
[SCIM_INPUT_PAD_HAS_GTK2=no])
PKG_CHECK_MODULES(GTK3, [gtk+-3.0 >= 3.0.0],
[SCIM_INPUT_PAD_HAS_GTK3=yes],
[SCIM_INPUT_PAD_HAS_GTK3=no])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([libintl.h dirent.h])
# libtool option to control which symbols are exported
# right now, symbols starting with _ are not exported
LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
# Extra args.
AC_ARG_ENABLE(debug,
[ --enable-debug Turn on debugging],
enable_debug=yes,
enable_debug=no)
AC_ARG_WITH(gtk-version,
AS_HELP_STRING([--with-gtk-version=2 or 3],
[Select gtk version if both gtk2 and gtk3 are available (default is 3)]),
[WANT_GTK_VERSION=$withval],
[WANT_GTK_VERSION=3])
if test "$SCIM_INPUT_PAD_HAS_GTK3" = "yes" \
-a "$SCIM_INPUT_PAD_HAS_GTK2" = "yes"; then
if test "$WANT_GTK_VERSION" = "2"; then
USE_GTK_VERSION=2
else
USE_GTK_VERSION=3
fi
elif test "$SCIM_INPUT_PAD_HAS_GTK3" = "yes"; then
USE_GTK_VERSION=3
elif test "$SCIM_INPUT_PAD_HAS_GTK2" = "yes"; then
USE_GTK_VERSION=2
else
AC_MSG_ERROR([GTK >= 2.4 can not be found!])
fi
if test "$USE_GTK_VERSION" = "3"; then
GTK_VERSION=3.0.0
GTK_MAJOR_VERSION=3
GTK_BINARY_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`
GTK_LIBDIR=`$PKG_CONFIG --variable=libdir gtk+-3.0`
GTK_CFLAGS=$GTK3_CFLAGS
GTK_LIBS=$GTK3_LIBS
else
GTK_VERSION=2.4.0
GTK_MAJOR_VERSION=2
GTK_BINARY_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
GTK_LIBDIR=`$PKG_CONFIG --variable=libdir gtk+-2.0`
GTK_CFLAGS=$GTK2_CFLAGS
GTK_LIBS=$GTK2_LIBS
fi
AC_SUBST(GTK_VERSION)
AC_SUBST(GTK_MAJOR_VERSION)
AC_SUBST(GTK_BINARY_VERSION)
AC_SUBST(GTK_LIBDIR)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
if test "$enable_debug" = "yes"; then
AC_DEFINE(ENABLE_DEBUG,1,[Define this to enable the debug facility in libscim])
CFLAGS="$CFLAGS -g"
CXXFLAGS="$CXXFLAGS -g"
fi
SCIM_ICONDIR=`$PKG_CONFIG --variable=icondir scim`
SCIM_MODULEDIR=`$PKG_CONFIG --variable=moduledir scim`
SCIM_DATADIR=`$PKG_CONFIG --variable=scimdatadir scim`
SCIM_LIBEXECDIR=`$PKG_CONFIG --variable=moduledir scim`
if test "x$SCIM_ICONDIR" = "x"; then
SCIM_ICONDIR=${datadir}/scim/icons
fi
if test "x$SCIM_MODULEDIR" = "x"; then
SCIM_MODULEDIR=${libdir}/scim-1.0
fi
if test "x$SCIM_DATADIR" = "x"; then
SCIM_DATADIR=${datadir}/scim
fi
if test "x$SCIM_LIBEXECDIR" = "x"; then
SCIM_LIBEXECDIR=${libdir}/scim-1.0
fi
AC_SUBST(SCIM_ICONDIR)
AC_SUBST(SCIM_MODULEDIR)
AC_SUBST(SCIM_DATADIR)
AC_SUBST(SCIM_LIBEXECDIR)
SCIM_INPUT_PAD_DATADIR=$SCIM_DATADIR/input-pad
SCIM_INPUT_PAD_USER_DATADIR=/.scim/input-pad
AC_SUBST(SCIM_INPUT_PAD_DATADIR)
AC_SUBST(SCIM_INPUT_PAD_USER_DATADIR)
AC_CONFIG_FILES([Makefile po/Makefile.in
data/Makefile
data/scim-input-pad
data/base.pad
data/keyboard.pad
data/japanese.pad
data/chinese.pad
data/korean.pad
data/arabian.pad
data/ethiopic.pad
data/india_bengali.pad
data/india_chiki.pad
data/india_devanagari.pad
data/india_gujarati.pad
data/india_gurmukhi.pad
data/india_kannada.pad
data/india_lepcha.pad
data/india_limbu.pad
data/india_malayalam.pad
data/india_oriya.pad
data/india_saurashtra.pad
data/india_sinhala.pad
data/india_syloti_nagri.pad
data/india_tamil.pad
data/india_telugu.pad
data/armenian.pad
data/balinese.pad
data/buginese.pad
data/cham.pad
data/georgian.pad
data/hebrew.pad
data/kaya.pad
data/khmer.pad
data/lao.pad
data/myanmar.pad
data/mongolian.pad
data/philipine_buhid.pad
data/philipine_hanunoo.pad
data/philipine_tagalog.pad
data/russian.pad
data/tai_lue.pad
data/rejang.pad
data/sundanese.pad
data/tai_le.pad
data/thai.pad
data/tibet.pad
src/Makefile
scim-input-pad.spec])
AC_OUTPUT
AC_MSG_RESULT([
Build options:
Version $SCIM_INPUT_PAD_VERSION
Install prefix $prefix
Build shared libs $enable_shared
Build static libs $enable_static
Enable debug $enable_debug
Module options:
GTK Version $USE_GTK_VERSION
])