-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
executable file
·215 lines (170 loc) · 5.57 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(ccinput, 0.3.0, [email protected])
AC_CONFIG_SRCDIR([src/pinyin_parse.c])
###########################################################
## Start Configuration. ##
###########################################################
# Init automake stuff
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER([config.h])
# Init gettext
ALL_LINGUAS="zh_CN zh_TW"
#AM_GNU_GETTEXT
# Init libtool
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AC_LIB_LTDL
AC_SUBST(LIBTOOL_DEPS)
# libtool option to control which symbols are exported
# right now, symbols starting with _ are not exported
LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
# Checks if doxygen is avaiable
AC_PATH_PROG(DOXYGEN, doxygen, no)
AM_CONDITIONAL(HAVE_DOXYGEN, test x$DOXYGEN != xno)
AC_SUBST(DOXYGEN)
# Checks if graphviz is available
AC_CHECK_PROG(HAVE_GRAPHVIZ, dot, YES, NO)
AC_PATH_PROG(DOT, dot)
AC_SUBST(DOT)
AC_PATH_PROG(PERL, perl)
AC_SUBST(PERL)
# Checks if gconftool-2 is available
AC_PATH_PROG(GCONFTOOL, gconftool-2)
AC_SUBST(GCONFTOOL)
# Checks if xsltproc is available
AC_PATH_PROG(XSLTPROC, xsltproc, no)
AM_CONDITIONAL(HAVE_XSLTPROC, test x$XSLTPROC != xno)
AC_SUBST(XSLTPROC)
# Checks if docbook-style-xsl is available
AC_CHECK_FILE(
[/usr/share/sgml/docbook/xsl-stylesheets/html/tldp-html.xsl],
[DOCBOOK_XSL=/usr/share/sgml/docbook/xsl-stylesheets/html/tldp-html.xsl],
[AC_CHECK_FILE(
[/usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl],
[DOCBOOK_XSL=/usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl],
[DOCBOOK_XSL=no])])
AC_SUBST(DOCBOOK_XSL)
AM_CONDITIONAL(HAVE_DOCBOOK, test x$DOCBOOK_XSL != xno)
AM_CONDITIONAL(BUILD_MANUAL, test x$XSLTPROC != xno -a x$DOCBOOK_XSL != xno)
# Check intltool
#AC_PROG_INTLTOOL([0.22])
# Checks for libraries.
AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS([langinfo.h libintl.h string.h dirent.h fcntl.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(wchar_t)
if test x$ac_cv_sizeof_short = x2 && test x$ac_cv_sizeof_char = x1 ; then
:
else
AC_MSG_ERROR([
*** SCIM requires
*** sizeof (short) == 2
*** sizeof (char) == 1
*** You might want to consider using the GNU C compiler.
])
fi
if test x$ac_cv_sizeof_wchar_t = x0 ; then
AC_MSG_ERROR([
*** SCIM requires a compiler that supports wchar_t,
*** You might want to consider using the GNU C compiler.
])
fi
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([gettimeofday memmove memset nl_langinfo setlocale daemon])
AC_CHECK_FUNCS([opendir closedir readdir])
AC_CHECK_FUNCS([gethostbyname gethostbyname_r socket bind accept connect listen],
[socket_ok=yes],
[socket_ok=no])
AC_CHECK_FUNCS([bzero mkdir strtol])
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_STAT
AC_HEADER_DIRENT
AC_HEADER_STDBOOL
# Checks for libraries.
SCIM_VERSION=1.2.0
PKG_CHECK_MODULES(SCIM,[scim >= $SCIM_VERSION])
# Check if we should build setup module
PKG_CHECK_MODULES(SCIM_GTKUTILS,[scim-gtkutils >= $SCIM_VERSION],
[SCIM_HAS_GTKUTILS=yes],
[SCIM_HAS_GTKUTILS=no])
install_scim_version=`$PKG_CONFIG --modversion scim`
if [ "x`echo ${install_scim_version} | sed -E 's/^(...).+$/\1/'`" = "x1.2" ]; then
AC_DEFINE(SCIM_1_2_API,1,[Whether the current scim is 1.2.x])
else
AC_DEFINE(SCIM_1_2_API,0)
fi
AC_ARG_ENABLE(skim-support,
[ --disable-skim-support Enable skim Setup UI],
skim_support=no,
skim_support=yes)
AM_CONDITIONAL(SCIM_BUILD_SKIM_SETUP, [test "$skim_support" = "yes"])
AC_SUBST(SCIM_VERSION)
SCIM_ICONDIR=`$PKG_CONFIG --variable=icondir scim`
SCIM_MODULEDIR=`$PKG_CONFIG --variable=moduledir scim`
SCIM_DATADIR=`$PKG_CONFIG --variable=scimdatadir 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
AC_SUBST(SCIM_ICONDIR)
AC_SUBST(SCIM_MODULEDIR)
AC_SUBST(SCIM_DATADIR)
###########################################################
AC_CONFIG_FILES([Makefile
ccinput.spec
configs/ccinput.cfg
po/Makefile
icons/Makefile
data/Makefile
configs/Makefile
src/Makefile
scim/Makefile
scim/IMEngine/Makefile
scim/SetupUI/Makefile])
if test "$skim_support" = "yes"; then
REQUIRED_SKIM_VERSION=1.2.1
dnl skim probably has been installed under prefix=$KDEDIR, so add it to search path of pkgconfig
test -z "$KDEDIR" && KDEDIR=`kde-config --prefix`
export PKG_CONFIG_PATH=$KDEDIR/lib/pkgconfig
PKG_CHECK_MODULES(SKIM, [skim >= $REQUIRED_SKIM_VERSION],
[HAS_SKIM=yes],
[HAS_SKIM=no])
else
HAS_SKIM=no
fi
if test "x$HAS_SKIM" = "xyes"; then
PKG_CHECK_MODULES(SCIM_KDEUTILS,[scim_kdeutils >= $REQUIRED_SKIM_VERSION],
[HAS_KDEUTILS=yes],
[HAS_KDEUTILS=no])
if test "x$HAS_KDEUTILS" = "xyes"; then
SCIM_TABLES_ENABLE_SKIM_SUPPORT=1
AC_CONFIG_SUBDIRS(skim)
else
SCIM_TABLES_ENABLE_SKIM_SUPPORT=0
fi
fi
AM_CONDITIONAL(SCIM_TABLES_ENABLE_SKIM_SUPPORT, [test "$HAS_KDEUTILS" = "yes"])
AC_SUBST(SCIM_TABLES_ENABLE_SKIM_SUPPORT)
AC_OUTPUT