Mercurial > freewnn
annotate configure.in @ 17:a3fdd8ad75dc
2ch dictionary has been added
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Mon, 14 Apr 2008 17:01:14 +0900 |
parents | bbc77ca4def5 |
children | e7e2aba67cb3 |
rev | line source |
---|---|
0 | 1 dnl |
2 dnl $Id: configure.in,v 1.48 2006/09/25 17:31:35 aonoto Exp $ | |
3 dnl | |
4 | |
5 dnl | |
6 dnl FreeWnn is a network-extensible Kana-to-Kanji conversion system. | |
7 dnl This file is part of FreeWnn. | |
8 dnl | |
9 dnl Copyright Kyoto University Research Institute for Mathematical Sciences | |
10 dnl 1987, 1988, 1989, 1990, 1991, 1992 | |
11 dnl Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1999 | |
12 dnl Copyright ASTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992 | |
13 dnl Copyright FreeWnn Project | |
14 dnl 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 | |
15 dnl | |
16 dnl Maintainer: FreeWnn Project | |
17 dnl | |
18 dnl This program is free software; you can redistribute it and/or modify | |
19 dnl it under the terms of the GNU General Public License as published by | |
20 dnl the Free Software Foundation; either version 2 of the License, or | |
21 dnl (at your option) any later version. | |
22 dnl | |
23 dnl This program is distributed in the hope that it will be useful, | |
24 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | |
25 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
26 dnl GNU General Public License for more details. | |
27 dnl | |
28 dnl You should have received a copy of the GNU General Public License | |
29 dnl along with this program; if not, write to the Free Software | |
30 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
31 dnl | |
32 | |
33 dnl | |
34 dnl Process this file with autoconf to produce a configure script. | |
35 dnl | |
36 dnl new AC_INIT do not work. I seem to make a mistake... | |
37 dnl AC_INIT("FreeWnn", "1.11-pl21", "freewnn-users-owner@lists.sourceforge.jp") | |
38 dnl AC_CONFIG_SRC_DIR(Wnn/conv/cvt_head.h) | |
39 AC_INIT(Wnn/conv/cvt_head.h) | |
40 AC_CONFIG_HEADER(config.h) | |
41 | |
42 dnl ==================================================================== | |
43 dnl Check optional features | |
44 dnl ==================================================================== | |
45 | |
46 # Quick and Dirty workaround for Autoconf-2.53 and Libtools-1.5 pair ... | |
47 # not to use additional tagged configuration. (default: CXX F77) | |
48 # NOTICE: Please remove next line if situation changes. (aono) | |
49 tagnames= | |
50 | |
51 AC_CANONICAL_HOST | |
52 | |
53 dnl build and install libraries, server or client | |
54 | |
55 AC_ARG_ENABLE(debug, | |
56 [ --enable-debug enable debug options [[default=no]]], | |
57 [case "${enableval}" in | |
58 yes) debug=true ;; | |
59 no) debug=false ;; | |
60 *) AC_MSG_ERROR(bad value for --enable-debug) | |
61 esac], debug=false) | |
62 | |
63 AC_ARG_ENABLE(libraries, | |
64 [ --enable-libraries build and install libraries [[default=yes]]], | |
65 [case "${enableval}" in | |
66 yes) libraries=true ;; | |
67 no) libraries=false ;; | |
68 *) AC_MSG_ERROR(bad value for --enable-libraries) ;; | |
69 esac], libraries=true) | |
70 | |
71 AC_ARG_ENABLE(server, | |
72 [ --enable-server build and install server [[default=yes]]], | |
73 [case "${enableval}" in | |
74 yes) server=true ;; | |
75 no) server=false ;; | |
76 *) AC_MSG_ERROR(bad value for --enable-server) ;; | |
77 esac], server=true) | |
78 | |
79 AC_ARG_ENABLE(client, | |
80 [ --enable-client build and install clients [[default=no]]], | |
81 [case "${enableval}" in | |
82 yes) client=true ;; | |
83 no) client=false ;; | |
84 *) AC_MSG_ERROR(bad value for --enable-client) ;; | |
85 esac], client=false) | |
86 | |
87 AC_ARG_ENABLE(client-utmp, | |
88 [ --enable-client-utmp write utmp with client [[default=yes if not modern BSD]]], | |
89 [case "${enableval}" in | |
90 yes) client_utmp=true ;; | |
91 no) client_utmp=false ;; | |
92 *) AC_MSG_ERROR(bad value for --enable-client-utmp) ;; | |
93 esac], | |
94 client_utmp=auto | |
95 ) | |
96 | |
97 if test $libraries = true; then | |
98 SUBDIRS="\$(LIB_SUBDIRS)" | |
99 WNNMANDIR="\$(LIB_WNNMANDIR)" | |
100 fi | |
101 if test $server = true; then | |
102 SUBDIRS="$SUBDIRS \$(SERVER_SUBDIRS)" | |
103 WNNMANDIR="$WNNMANDIR \$(SERVER_WNNMANDIR)" | |
104 fi | |
105 if test $client = true; then | |
106 SUBDIRS="$SUBDIRS \$(CLIENT_SUBDIRS)" | |
107 dnl currently client is only uum and its man is in SERVER_WNNMANDIR | |
108 dnl WNNMANDIR=$WNNMANDIR \$(CLIENT_WNNMANDIR)" | |
109 fi | |
110 | |
111 AC_SUBST(SUBDIRS) | |
112 AC_SUBST(WNNMANDIR) | |
113 | |
114 dnl For Severs | |
115 | |
116 AC_ARG_ENABLE(Wnn, | |
117 [ --enable-Wnn build and install Wnn [[default=yes]]], | |
118 [case "${enableval}" in | |
119 yes) Wnn="Wnn";; | |
120 no) Wnn="" ;; | |
121 *) AC_MSG_ERROR(bad value for --enable-Wnn) ;; | |
122 esac], Wnn="Wnn") | |
123 AC_SUBST(Wnn) | |
124 | |
125 if test "$server" = true -a "$Wnn" = Wnn; then | |
126 # JSERVER_SUBDIRS1="\$(JSERVER_SUBDIRS1)" | |
127 JSERVER_SUBDIRS2="\$(JSERVER_SUBDIRS2)" | |
128 else | |
129 # JSERVER_SUBDIRS1="" | |
130 JSERVER_SUBDIRS2="" | |
131 fi | |
132 dnl AC_SUBST(JSERVER_SUBDIRS1) | |
133 AC_SUBST(JSERVER_SUBDIRS2) | |
134 | |
135 AC_ARG_ENABLE(cWnn, | |
136 [ --enable-cWnn build and install cWnn [[default=yes]]], | |
137 [case "${enableval}" in | |
138 yes) cWnn="cWnn" ;; | |
139 no) cWnn="" ;; | |
140 *) AC_MSG_ERROR(bad value for --enable-cWnn) ;; | |
141 esac], cWnn="cWnn") | |
142 AC_SUBST(cWnn) | |
143 | |
144 AC_ARG_ENABLE(kWnn, | |
145 [ --enable-kWnn build and install kWnn [[default=yes]]], | |
146 [case "${enableval}" in | |
147 yes) kWnn="kWnn" ;; | |
148 no) kWnn="" ;; | |
149 *) AC_MSG_ERROR(bad value for --enable-kWnn) ;; | |
150 esac], kWnn="kWnn") | |
151 AC_SUBST(kWnn) | |
152 | |
153 dnl For a library libwnn | |
154 | |
155 dnl AC_ARG_WITH(libwnn, | |
156 dnl [ --with-libwnn use installed Wnn library [default=no]], | |
157 dnl [case "${withval}" in | |
158 dnl yes|no) with_libwnn=${withval};; | |
159 dnl *) AC_MSG_ERROR(invalid argument to --with-libwnn) ;; | |
160 dnl esac], with_libwnn=no) | |
161 dnl | |
162 | |
163 AC_ARG_WITH(libwnn, | |
164 [ --with-libwnn use installed Wnn library [[default=no]]], | |
165 [ with_libwnn="${withval}" | |
166 AC_ARG_WITH(wnn-includes, | |
167 [ --with-wnn-includes=DIR WNN include files are in DIR], | |
168 [wnnincludedir="-I${withval}"], [wnnincludedir='']) | |
169 AC_ARG_WITH(wnn-libraries, | |
170 [ --with-wnn-libraries=DIR Search for WNN libraries in DIR [[default=/usr/local/lib]]], | |
171 [wnnlibdir="${withval}"], [wnnlibdir='/usr/local/lib']) | |
172 if test "X${with_libwnn}" = X-lwnn; then | |
173 WNNJLIB="-L${wnnlibdir} -lwnn" | |
174 elif test X"`echo ${with_libwnn} | grep '^/.*'`" != X ; then | |
175 WNNJLIB="${with_libwnn}" | |
176 else | |
177 WNNJLIB="${wnnlibdir}/libwnn.a" | |
178 fi | |
179 DEPWNNJLIB="" | |
180 HINSI_DATA="\$(JWNNWNNDIR)/hinsi.data" | |
181 ], | |
182 [ WNNJLIB="\$(top_builddir)/Wnn/jlib/libwnn.la" | |
183 DEPWNNJLIB="\$(WNNJLIB)" | |
184 HINSI_DATA="\$(top_builddir)/Wnn/jd/hinsi.data" | |
185 ]) | |
186 AC_SUBST(WNNJLIB) | |
187 AC_SUBST(DEPWNNJLIB) | |
188 AC_SUBST(HINSI_DATA) | |
189 | |
190 AC_ARG_WITH(libcwnn, | |
191 [ --with-libcwnn use installed cWnn library [[default=no]]], | |
192 [ | |
193 AC_ARG_WITH(cwnn-includes, | |
194 [ --with-cwnn-includes=DIR CWNN include files are in DIR], | |
195 [cwnnincludedir="-I${withval}"], [cwnnincludedir='']) | |
196 AC_ARG_WITH(cwnn-libraries, | |
197 [ --with-cwnn-libraries=DIR Search for CWNN libraries in DIR [[default=/usr/local/lib]]], | |
198 [cwnnlibdir="${withval}"], [cwnnlibdir='/usr/local/lib']) | |
199 if test "X${with_libcwnn}" = X-lcwnn; then | |
200 CWNNJLIB="-L${cwnnlibdir} -lcwnn" | |
201 elif test X"`echo ${with_libcwnn} | grep '^/.*'`" != X ; then | |
202 CWNNJLIB="${with_libcwnn}" | |
203 else | |
204 CWNNJLIB="${cwnnlibdir}/libcwnn.a" | |
205 fi | |
206 DEPCWNNJLIB="" | |
207 CHINSI_DATA="\$(CWNNWNNDIR)/cixing.data" | |
208 THINSI_DATA="\$(TWNNTDSRC)/cixing.data" | |
209 ], | |
210 [ CWNNJLIB="\$(top_builddir)/cWnn/jlib/libcwnn.la" | |
211 DEPCWNNJLIB="\$(CWNNJLIB)" | |
212 CHINSI_DATA="\$(CWNNCDSRC)/cixing.data" | |
213 THINSI_DATA="\$(TWNNTDSRC)/cixing.data" | |
214 ]) | |
215 AC_SUBST(CWNNJLIB) | |
216 AC_SUBST(DEPCWNNJLIB) | |
217 AC_SUBST(CHINSI_DATA) | |
218 AC_SUBST(THINSI_DATA) | |
219 | |
220 AC_ARG_WITH(libkwnn, | |
221 [ --with-libkwnn use installed kWnn library [[default=no]]], | |
222 [ | |
223 AC_ARG_WITH(kwnn-includes, | |
224 [ --with-kwnn-includes=DIR KWNN include files are in DIR], | |
225 [kwnnincludedir="-I${withval}"], [kwnnincludedir='']) | |
226 AC_ARG_WITH(kwnn-libraries, | |
227 [ --with-kwnn-libraries=DIR Search for KWNN libraries in DIR [[default=/usr/local/lib]]], | |
228 [kwnnlibdir="${withval}"], [kwnnlibdir='/usr/local/lib']) | |
229 if test "X${with_libkwnn}" = X-lkwnn; then | |
230 KWNNJLIB="-L${kwnnlibdir} -lkwnn" | |
231 elif test X"`echo ${with_libkwnn} | grep '^/.*'`" != X ; then | |
232 KWNNJLIB="${with_libkwnn}" | |
233 else | |
234 KWNNJLIB="${kwnnlibdir}/libkwnn.a" | |
235 fi | |
236 DEPKWNNJLIB="" | |
237 KHINSI_DATA="\$(KWNNWNNDIR)/hinsi.data" | |
238 ], | |
239 [ KWNNJLIB="\$(top_builddir)/kWnn/jlib/libkwnn.la" | |
240 DEPKWNNJLIB="\$(KWNNJLIB)" | |
241 KHINSI_DATA="\$(KWNNKDSRC)/hinsi.data" | |
242 ]) | |
243 AC_SUBST(KWNNJLIB) | |
244 AC_SUBST(DEPKWNNJLIB) | |
245 AC_SUBST(KHINSI_DATA) | |
246 | |
247 dnl | |
248 dnl Build Options | |
249 dnl | |
250 | |
251 AC_ARG_ENABLE(ipv6, | |
252 [ --enable-ipv6 build and install IPv6 [[default=no]]], | |
253 [case "${enableval}" in | |
254 yes) ipv6="-DINET6";; | |
255 no) ipv6="" ;; | |
256 *) AC_MSG_ERROR(bad value for --enable-ipv6) ;; | |
257 esac], ipv6="") | |
258 AC_SUBST(ipv6) | |
259 | |
260 AC_ARG_ENABLE(unsafe-path, | |
261 [ --enable-unsafe-path allow creating files in an arbitrary path [[default=no]]], | |
262 [case "${enableval}" in | |
263 yes) unsafe_path=true;; | |
264 no) unsafe_path=false;; | |
265 *) AC_MSG_ERROR(bad value for --enable-unsafe-path) ;; | |
266 esac], unsafe_path=false) | |
267 AC_SUBST(unsafe_path) | |
268 | |
269 if test ${unsafe_path} = true; then | |
270 AC_DEFINE(WNN_ALLOW_UNSAFE_PATH, 1, | |
271 [Define to allow writing to other than JSERVERDIR.]) | |
272 fi | |
273 | |
274 dnl | |
275 dnl Checks for cc and cpp. | |
276 dnl | |
277 AC_PROG_CC | |
278 | |
279 dnl System specific options | |
280 dnl Now that we are using autoconf, CCOPTIONS should be nuked... | |
281 dnl But please report if your system needs specific settings (CCOPTIONS etc.) | |
282 case $host in | |
283 *-*-linux*) | |
284 CCOPTIONS="-Dlinux -D_GNU_SOURCE -D_POSIX_SOURCE -D_BSD_SOURCE" | |
285 ;; | |
286 *-*-darwin*) | |
287 if test $GCC = yes; then | |
288 # Unfortunately, autoconf (at least 2.57) does not recognize | |
289 # proper CPP. (Normal cpp-precomp nor auto-retrying in basic mode does | |
290 # not work with pubdic+ processing.) So define here .... | |
291 # Note: It seems gcc-3.3 (or (probably) later) does not need this. | |
292 CPP=${CPP:-"$CC -E -no-cpp-precomp"} | |
293 fi | |
294 # Don't care other CC-s. | |
295 ;; | |
296 *-*-sunos*) | |
297 if test $GCC = yes; then | |
298 CCOPTIONS="-Dsun -Dsparc" | |
299 else | |
300 CCOPTIONS="" | |
301 fi | |
302 ;; | |
303 *-*-solaris2.*) | |
304 # Will 'solaris*' be OK? | |
305 if test $GCC = yes; then | |
306 CCOPTIONS="-Dsun -D`uname -p` -DSVR4 -DSYSV" | |
307 else | |
308 CCOPTIONS="-Xc -xF -xcg92 -Dsun -D`uname -p` -DSVR4 -DSYSV" | |
309 fi | |
310 ;; | |
311 *-*-hpux*) | |
312 if test $GCC = yes; then | |
313 CCOPTIONS="-Dhpux -DSYSV" | |
314 else | |
315 CCOPTIONS="-Ae -Dhpux -DSYSV" | |
316 fi | |
317 ;; | |
318 i[[34567]]86-pc-beos*) | |
319 CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE" | |
320 ;; | |
321 powerpc-*-beos*) | |
322 CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE" | |
323 ;; | |
324 *-*-aix*) | |
325 CCOPTIONS="-DSYSV" | |
326 ;; | |
327 esac | |
328 | |
329 dnl Checking if we use gcc or not | |
330 if test $debug = true; then | |
331 if test $GCC = yes; then | |
332 # FIXME: gcc -fstack-check doesn't work well on Linux/i386 ... | |
333 CDEBUGFLAGS=${CDEBUGFLAGS:-"-g2 -O2 -Wall"} | |
334 else | |
335 CDEBUGFLAGS=${CDEBUGFLAGS:-""} | |
336 fi | |
337 INSTPGMFLAGS= | |
338 else | |
339 CDEBUGFLAGS=${CDEBUGFLAGS:-""} | |
340 INSTPGMFLAGS="-s" | |
341 fi | |
342 AC_SUBST(CCOPTIONS) | |
343 AC_SUBST(CDEBUGFLAGS) | |
344 AC_SUBST(INSTPGMFLAGS) | |
345 | |
346 echo "Set CDEBUGFLAGS and CCOPTIONS to following:" | |
347 echo ' CDEBUGFLAGS="'"$CDEBUGFLAGS"'"' | |
348 echo ' CCOPTIONS="'"$CCOPTIONS"'"' | |
349 | |
350 dnl ¼«Æ°Ç§¼±¤Ç·èÄꤵ¤ì¤¿¤¯¤Ê¤¤¾ì¹ç¤Ïconfigure»þ¤Ë´Ä¶ÊÑ¿ôCPP¤òÀßÄꤻ¤è¡£ | |
351 dnl ¤³¤Î°ÌÃ֤ʤé¤Ð¤Þ¤À¥·¥¹¥Æ¥à¸ÇÍÉôʬ¤ÇCPP¤ò¥ª¡¼¥Ð¥é¥¤¥É¤Ç¤¤ë¤¬¡¢ | |
352 dnl ¡ÖCPP=${CPP:-"/usr/ccs/lib/cpp"}¡×¤Î¤´¤È¤¯¥æ¡¼¥¶¤Î°Õ»Ö¤òº½Å¤·¤¿Êý¤¬ | |
353 dnl ¤è¤¤¤È»×¤ï¤ì¤ë¡£ | |
354 AC_PROG_CPP | |
355 | |
356 dnl | |
357 dnl Checks for programs. | |
358 dnl | |
359 dnl ### AC_PROG_YACC | |
360 dnl ### AC_PROG_LEX | |
361 AC_PROG_INSTALL | |
362 AC_PROG_LN_S | |
363 AC_PROG_MAKE_SET | |
364 AC_PROG_LIBTOOL | |
365 AC_SUBST(LIBTOOL_DEPS) | |
366 | |
367 dnl Checks for libraries. | |
368 dnl ### dnl Replace `main' with a function in -lX11: | |
369 dnl ### AC_CHECK_LIB(X11, main) | |
370 dnl ### dnl Replace `main' with a function in -lcurses: | |
371 dnl ### AC_CHECK_LIB(curses, main) | |
372 | |
373 AC_SEARCH_LIBS(crypt, crypt) | |
374 AC_CHECK_LIB(socket, connect) | |
375 AC_CHECK_LIB(bind, getservbyname) | |
376 AC_CHECK_LIB(nsl, gethostbyname) | |
377 dnl libutil only needed by uum w/openpty... | |
378 dnl FIXME: deals with Linux that have both ptsname & openpty | |
379 AC_CHECK_LIB(util, openpty) | |
380 | |
381 dnl | |
382 dnl Checks for header files. | |
383 dnl | |
384 AC_PATH_X | |
385 AC_HEADER_STDC | |
386 AC_HEADER_SYS_WAIT | |
387 AC_HEADER_TIME | |
388 AC_CHECK_HEADERS(fcntl.h syslog.h unistd.h utmp.h utmpx.h \ | |
389 sys/file.h sys/ioctl.h sys/time.h sys/types.h sys/param.h \ | |
390 malloc.h strings.h memory.h \ | |
391 curses.h ncurses.h sgtty.h term.h termio.h termios.h \ | |
392 termcap.h sys/termio.h libutil.h\ | |
393 ) | |
394 | |
395 dnl | |
396 dnl Terminal library selection. | |
397 dnl ported from vim6.1 via canuum (Canna 3.6p3) for uum. | |
398 dnl FIXME: cross compilation | |
399 dnl | |
400 olibs="$LIBS" | |
401 CNVFILE_SUBDIR=bsd | |
402 AC_MSG_CHECKING(--with-term-libs argument) | |
403 AC_ARG_WITH(tlib, | |
404 [ --with-term-libs=-lLIB terminal library to be used ],) | |
405 if test -n "$with_term_libs"; then | |
406 AC_MSG_RESULT($with_term_libs) | |
407 dnl LIBS="$LIBS $with_term_libs" | |
408 TERMLIB=$with_term_libs | |
409 else | |
410 AC_MSG_RESULT([automatic terminal library selection]) | |
411 dnl On HP-UX 10.10 termcap or termlib should be used instead of | |
412 dnl curses, because curses is much slower. | |
413 dnl Newer versions of ncurses are preferred over anything. | |
414 dnl Older versions of ncurses have bugs, get a new one! | |
415 dnl Digital Unix (OSF1) should use curses (Ronald Schild). | |
416 case "`uname -s 2>/dev/null`" in | |
417 OSF1) tlibs="ncurses curses termlib termcap";; | |
418 *) tlibs="ncurses termlib termcap curses";; | |
419 esac | |
420 for libname in $tlibs; do | |
421 AC_CHECK_LIB(${libname}, tgetent, [ | |
422 dnl It's possible that a library is found but it doesn't work | |
423 dnl e.g., shared library that cannot be found. | |
424 dnl compile and run a test program to be sure | |
425 LIBS="${LIBS} -l${libname}" | |
426 AC_TRY_RUN([ | |
427 #ifdef HAVE_TERMCAP_H | |
428 # include <termcap.h> | |
429 #endif | |
430 main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }], | |
431 res="OK", res="FAIL", res="FAIL") | |
432 if test "$res" = "OK"; then | |
433 TERMLIB="${TERMLIB} -l${libname}" | |
434 dnl lname=`echo ${libname} | sed 'y/termcaplibnus/TERMCAPLIBNUS/'` | |
435 dnl AC_DEFINE_UNQUOTED(HAVE_${lname}, 1, [use ${libname} for terminal control]) | |
436 dnl We need to define AH_TEMPLATE (if we really need this) | |
437 dnl ex. AH_TEMPLATE(HAVE_NCURSES, [use ncurses for terminal control]) | |
438 break | |
439 fi | |
440 AC_MSG_RESULT($libname library is not usable) | |
441 ],) | |
442 LIBS=${olibs} | |
443 done | |
444 fi | |
445 if test "x$TERMLIB" != "x"; then | |
446 LIBS="${LIBS} ${TERMLIB}" | |
447 AC_MSG_CHECKING(whether we talk terminfo) | |
448 AC_TRY_RUN([ | |
449 #ifdef HAVE_TERMCAP_H | |
450 # include <termcap.h> | |
451 #endif | |
452 main() | |
453 {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }], | |
454 [ AC_MSG_RESULT([no -- we are in termcap land]) | |
455 CNVFILE_SUBDIR=bsd ], | |
456 [ AC_DEFINE(HAVE_TERMINFO, 1, [terminfo spoken here]) | |
457 AC_MSG_RESULT([yes -- terminfo spoken here]) | |
458 CNVFILE_SUBDIR=sysV ], | |
459 AC_MSG_ERROR(failed to compile test program.)) | |
460 else | |
461 AC_MSG_RESULT(none found) | |
462 fi | |
463 LIBS=${olibs} | |
464 AC_SUBST(TERMLIB) | |
465 AC_SUBST(CNVFILE_SUBDIR) | |
466 | |
467 dnl delayed check for --enable-client-utmp | |
468 if test $client = true; then | |
469 if test $client_utmp = auto; then | |
470 AC_EGREP_CPP(yes, [ | |
471 #if HAVE_SYS_PARAM_H | |
472 # include <sys/param.h> | |
473 #endif | |
474 #if defined(BSD) && (BSD >= 199306) | |
475 yes | |
476 #endif | |
477 ], client_utmp=false, client_utmp=true) | |
478 fi | |
479 | |
480 dnl for Debug | |
481 AC_MSG_CHECKING([whether we're using utmp with uum]) | |
482 if test $client_utmp = true; then | |
483 dnl We need to look again if we introduce libspt check | |
484 AC_DEFINE(USE_UTMP, 1, [Define to 1 if uum writes utmp entry]) | |
485 AC_MSG_RESULT(yes) | |
486 else | |
487 AC_MSG_RESULT(no) | |
488 fi | |
489 fi | |
490 | |
491 dnl | |
492 dnl Checks for typedefs, structures, and compiler characteristics. | |
493 dnl | |
494 AC_TYPE_MODE_T | |
495 AC_HEADER_TIME | |
496 | |
497 dnl AC_CHECK_TYPES(time_t,, | |
498 dnl AC_DEFINE(time_t, long, [Define missing time_t.]), | |
499 dnl [INCLUDES = time.h]) | |
500 AC_CHECK_TYPES(socklen_t,, | |
501 AC_DEFINE(socklen_t, int, [Define missing socklen_t.]), [ | |
502 #if HAVE_SYS_TYPES_H | |
503 # include <sys/types.h> | |
504 #endif | |
505 #include <sys/socket.h>]) | |
506 | |
507 AC_CHECK_MEMBERS([struct utmp.ut_user, struct utmp.ut_name, struct utmp.ut_id],,,[ | |
508 #include <sys/types.h> | |
509 #if HAVE_UTMPX_H | |
510 # include <utmpx.h> | |
511 #endif | |
512 #if HAVE_UTMP_H | |
513 # include <utmp.h> | |
514 #endif]) | |
515 | |
516 dnl | |
517 dnl Checks for symbol | |
518 dnl | |
519 | |
520 dnl | |
521 dnl Checks for library functions. | |
522 dnl | |
523 AC_PROG_GCC_TRADITIONAL | |
524 | |
525 dnl idea borrowed from EB Library http://www.sra.co.jp/people/m-kasahr/eb/ | |
526 AC_TYPE_SIGNAL | |
527 if test "$ac_cv_type_signal" = void; then | |
528 AC_DEFINE(RETSIGTYPE_VOID, 1, [Define if the signal function returns void.]) | |
529 fi | |
530 | |
531 AC_FUNC_MEMCMP | |
532 AC_CHECK_FUNCS(getpgid getpgrp setpgrp wait3) | |
533 AC_FUNC_GETPGRP | |
534 AC_FUNC_SETPGRP | |
535 dnl FreeWnn do not use the 3rd parameter of wait3(). | |
536 dnl AC_FUNC_WAIT3 | |
537 | |
538 dnl NOTE: FD_SET is defined as macro on many systems. But this check | |
539 dnl will be done in Wnn/include/wnn_os.h , so don't care... | |
540 AC_CHECK_FUNCS(random drand48 fchmod getopt killpg \ | |
541 FD_SET \ | |
542 gethostname select socket closesocket setsockopt send recv \ | |
543 getdtablesize getrlimit syslog vsyslog setenv snprintf \ | |
544 ptsname posix_openpt openpty pututxline pututline setsid) | |
545 dnl for bcopy/index -> memcpy/strchr conversion (preparation): | |
546 AC_CHECK_FUNCS(bcopy bzero bcmp index rindex \ | |
547 memcpy memmove memset strchr strrchr) | |
548 | |
549 dnl Check fallback functions for jserver (should use AC_REPLACE_FUNCS?) | |
550 JS_SUPPORTOBJS= | |
551 AC_CHECK_FUNCS(mkdir vasprintf, , | |
552 [JS_SUPPORTOBJS="${JS_SUPPORTOBJS} ${ac_func}.o"]) | |
553 AC_SUBST(JS_SUPPORTOBJS) | |
554 | |
555 | |
556 dnl | |
557 dnl File Existence | |
558 dnl Checking file at compile time may bring false result when cross- | |
559 dnl compiling. So, one have to check generated config.h and edit it | |
560 dnl if necessary after running configure. | |
561 dnl | |
562 dnl AC_CHECK_FILE(/dev/ptmx, AC_DEFINE(HAVE_DEV_PTMX, 1, [/dev/ptmx found]),) | |
563 AC_CHECK_FILES(/dev/ptmx,,) | |
564 | |
565 | |
566 dnl | |
567 dnl FIXME: libspt support | |
568 dnl for example: | |
569 dnl | |
570 dnl --with-libspt[=/path/to/libspt-config] | |
571 dnl | |
572 dnl LIBSPT_CFLAGS=`/path/to/libspt-config --cflags` | |
573 dnl LIBSPT_LIBS=`/path/to/libspt-config --libs` | |
574 dnl AC_SUBST(LIBSPT_CFLAGS) | |
575 dnl AC_SUBST(LIBSPT_LIBS) | |
576 dnl AC_DEFINE(HAVE_LIBSPT, 1, [Define if you have libspt support.]) | |
577 | |
578 dnl | |
579 dnl TCP Wrapper. | |
580 dnl | |
581 WRAPLIB= | |
582 AC_MSG_CHECKING(whether to use libwrap) | |
583 AC_ARG_WITH(libwrap, | |
584 [ --with-libwrap[[=DIR]] Compile in libwrap (tcp_wrappers) support [[default=try to find libwrap]]], | |
585 [ case "$withval" in | |
586 no) | |
587 AC_MSG_RESULT(no) | |
588 WRAP_TRY=no | |
589 ;; | |
590 yes) | |
591 AC_MSG_RESULT(yes) | |
592 WRAP_TRY=yes | |
593 ;; | |
594 *) | |
595 AC_MSG_RESULT(yes) | |
596 WRAP_TRY=yes | |
597 if test -d "$withval"; then | |
598 WRAPINCLUDES="-I$withval" | |
599 if test -d $withval/include; then | |
600 WRAPINCLUDES="-I$withval/include $WRAPINCLUDES" | |
601 fi | |
602 WRAPLIB="-L$withval -lwrap" | |
603 if test -d $withval/lib; then | |
604 WRAPLIB="-L$withval/lib $WRAPLIB" | |
605 fi | |
606 else | |
607 WRAPINCLUDES="$withval" | |
608 fi | |
609 ;; | |
610 esac], | |
611 [AC_MSG_RESULT([try to find]) | |
612 WRAP_TRY=auto] | |
613 ) | |
614 # Link test for libwrap | |
615 if test "$WRAP_TRY" = yes -o "$WRAP_TRY" = auto; then | |
616 OLDCFLAGS="$CFLAGS" | |
617 CFLAGS="$WRAPINCLUDES $CFLAGS" | |
618 OLDLIBS="$LIBS" | |
619 WRAPLIB=${WRAPLIB:-"-lwrap"} | |
620 LIBS="$WRAPLIB $OLDLIBS" | |
621 AC_MSG_CHECKING([libwrap is working]) | |
622 AC_TRY_LINK([ int allow_severity; int deny_severity; ], | |
623 [ hosts_access(); ], | |
624 [ AC_MSG_RESULT(yes) | |
625 AC_DEFINE(HAVE_LIBWRAP, 1, | |
626 [Define if you have libwrap (TCP wrapper) support.]) | |
627 AC_SUBST(WRAPLIB)], | |
628 [ AC_MSG_RESULT(no) | |
629 if test "$WRAP_TRY" = yes; then | |
630 AC_MSG_ERROR([Could not find libwrap. Please check config.log.]) | |
631 else | |
632 # recover old flag / clear needless WRAPLIB and continue | |
633 CFLAGS=$OLDCFLAGS | |
634 WRAPLIB= | |
635 fi] ) | |
636 # only jserver needs libwrap, recover LIBS also | |
637 LIBS=$OLDLIBS | |
638 fi | |
639 | |
640 | |
641 dnl | |
642 dnl Creating Makefiles. | |
643 dnl | |
644 # mkdir -p Contrib/dic/gerodic in case builddir != srcdir | |
645 dir=Contrib/dic/gerodic | |
646 if test ! -d $dir; then | |
647 echo "creating $dir ..." | |
648 $ac_install_sh -d $dir | |
649 fi | |
17
a3fdd8ad75dc
2ch dictionary has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
650 dir=Contrib/dic/2ch |
a3fdd8ad75dc
2ch dictionary has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
651 if test ! -d $dir; then |
a3fdd8ad75dc
2ch dictionary has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
652 echo "creating $dir ..." |
a3fdd8ad75dc
2ch dictionary has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
653 $ac_install_sh -d $dir |
a3fdd8ad75dc
2ch dictionary has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
654 fi |
0 | 655 |
656 dnl | |
657 dnl Generate Makefiles | |
658 dnl | |
659 | |
660 dnl Generic | |
661 | |
662 makefiles_generic="makerule.mk Makefile" | |
663 | |
664 dnl Japanese | |
665 | |
666 if test "x${Wnn}" = "xWnn"; then | |
667 makefiles_wnn="Wnn/Makefile Wnn/conv/Makefile Wnn/include/Makefile \ | |
668 Wnn/jd/Makefile Wnn/jd/rk/Makefile Wnn/jd/rk.vi/Makefile \ | |
669 Wnn/jlib/Makefile Wnn/jlib.V3/Makefile Wnn/jserver/Makefile \ | |
670 Wnn/jutil/Makefile Wnn/ld/Makefile Wnn/ld/rk/Makefile \ | |
671 Wnn/romkan/Makefile Wnn/uum/Makefile \ | |
672 Wnn/man/Makefile Wnn/man/2.env/Makefile Wnn/man/3.libwnn/Makefile \ | |
673 Wnn/man/4.cmd/Makefile Wnn/man/6.jutil/Makefile \ | |
674 Wnn/man/2.env/dic/Makefile Wnn/man/2.env/wnn/Makefile \ | |
675 Wnn/man/3.libwnn/jl_lib/Makefile Wnn/man/3.libwnn/js_lib/Makefile \ | |
676 Wnn/man/3.libwnn/misc_lib/Makefile Wnn/man/3.libwnn/rk_lib/Makefile" | |
17
a3fdd8ad75dc
2ch dictionary has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
677 makefiles_wnn_dic="Contrib/dic/gerodic/Makefile Contrib/dic/2ch/Makefile \ |
a3fdd8ad75dc
2ch dictionary has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
678 Wnn/pubdicplus/Makefile \ |
0 | 679 Wnn/wnncons/Makefile Wnn/wnncons/dic/Makefile" |
680 fi | |
681 | |
682 dnl Chinese and Taiwanese | |
683 | |
684 if test "x$cWnn" = "xcWnn"; then | |
685 makefiles_cwnn="cWnn/Makefile cWnn/conv/Makefile cWnn/etc/Makefile \ | |
686 cWnn/cd/Makefile cWnn/cd/rk/Makefile \ | |
687 cWnn/cd/rk_p/Makefile cWnn/cd/rk_z/Makefile \ | |
688 cWnn/td/Makefile cWnn/td/rk/Makefile \ | |
689 cWnn/td/rk_z/Makefile cWnn/td/rk_p/Makefile \ | |
690 cWnn/include/Makefile cWnn/jlib/Makefile \ | |
691 cWnn/jserver/Makefile cWnn/jutil/Makefile \ | |
692 cWnn/man/Makefile cWnn/man/1.intro/Makefile cWnn/man/2.env/Makefile \ | |
693 cWnn/man/4.cmd/Makefile cWnn/man/6.jutil/Makefile \ | |
694 cWnn/romkan/Makefile cWnn/uum/Makefile" | |
695 makefiles_cwnn_dic="cWnn/cdic/Makefile cWnn/tdic/Makefile" | |
696 fi | |
697 | |
698 dnl Korean | |
699 | |
700 if test "x$kWnn" = "xkWnn"; then | |
701 makefiles_kwnn="kWnn/Makefile kWnn/conv/Makefile kWnn/etc/Makefile \ | |
702 kWnn/include/Makefile kWnn/jlib/Makefile kWnn/jutil/Makefile \ | |
703 kWnn/jserver/Makefile kWnn/kd/Makefile kWnn/kd/rk/Makefile \ | |
704 kWnn/romkan/Makefile kWnn/uum/Makefile" | |
705 makefiles_kwnn_dic="kWnn/kdic/Makefile" | |
706 fi | |
707 | |
708 AC_OUTPUT(${makefiles_generic} \ | |
709 ${makefiles_wnn} ${makefiles_wnn_dic} \ | |
710 ${makefiles_cwnn} ${makefiles_cwnn_dic} \ | |
711 ${makefiles_kwnn} ${makefiles_kwnn_dic}) |