Develop and Download Open Source Software

Browse CVS Repository

Contents of /freewnn/FreeWnn/configure.in

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.49 - (show annotations) (download)
Sat Jun 23 16:34:16 2007 UTC (16 years, 9 months ago) by aonoto
Branch: MAIN
Changes since 1.48: +153 -32 lines
- Added detection code if your system need to install uum as set-[ug]id
  program on configure time. Recent systems may install uum as normal program
  (to reduce security risk). You can also specify --enable-client-setuid /
  --enable-client-setgid=group (group must be specified) to control
  set-[ug]id of uum.

- Added uum-related option to INSTALL* file.

- Use modern style AC_INIT. (added pseudo(?) version number and
  contact address. comments are welcome.)

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, 2007
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 AC_INIT(FreeWnn, [1.1.1-cvs-a022], [freewnn-users-owner@lists.sourceforge.jp], FreeWnn)
37 AC_CONFIG_SRCDIR(Wnn/conv/cvt_head.h)
38 dnl old-style AC_INIT ...
39 dnl 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 dnl If you set set-[ug]id user/group to (ex.) 'yes',
98 dnl you can configure this with setting UUMOWNER / UUMGROUP .
99 AC_ARG_ENABLE(client-setuid,
100 [ --enable-client-setuid[[=user]] Install client with setuid and specified user [[default=guess if your system need this]]],
101 [case "${enableval}" in
102 yes) client_setuid=true; UUMOWNER=${UUMOWNER:-root} ;;
103 no) client_setuid=false ;;
104 *) client_setuid=true; UUMOWNER=${enableval} ;;
105 esac],
106 [client_setuid=auto # guess later ...
107 UUMOWNER=root]
108 )
109
110 AC_ARG_ENABLE(client-setgid,
111 [ --enable-client-setgid=group Install client with setgid and specified group [[default=guess if your system need this]]],
112 [case "${enableval}" in
113 yes)
114 if test "x$UUMGROUP" = "x"; then
115 AC_ERROR([You must set group name with --enable-client-setgid.])
116 else
117 client_setgid=true; # we already defined UUMGROUP ...
118 fi
119 ;;
120 no) client_setgid=false ;;
121 *) client_setgid=true; UUMGROUP=${enableval} ;;
122 esac],
123 [client_setgid=auto # guess later ...
124 UUMGROUP=]
125 )
126
127 if test $libraries = true; then
128 SUBDIRS="\$(LIB_SUBDIRS)"
129 WNNMANDIR="\$(LIB_WNNMANDIR)"
130 fi
131 if test $server = true; then
132 SUBDIRS="$SUBDIRS \$(SERVER_SUBDIRS)"
133 WNNMANDIR="$WNNMANDIR \$(SERVER_WNNMANDIR)"
134 fi
135 if test $client = true; then
136 SUBDIRS="$SUBDIRS \$(CLIENT_SUBDIRS)"
137 dnl currently client is only uum and its man is in SERVER_WNNMANDIR
138 dnl WNNMANDIR=$WNNMANDIR \$(CLIENT_WNNMANDIR)"
139 fi
140
141 AC_SUBST(SUBDIRS)
142 AC_SUBST(WNNMANDIR)
143
144 dnl For Severs
145
146 AC_ARG_ENABLE(Wnn,
147 [ --enable-Wnn build and install Wnn [[default=yes]]],
148 [case "${enableval}" in
149 yes) Wnn="Wnn";;
150 no) Wnn="" ;;
151 *) AC_MSG_ERROR(bad value for --enable-Wnn) ;;
152 esac], Wnn="Wnn")
153 AC_SUBST(Wnn)
154
155 if test "$server" = true -a "$Wnn" = Wnn; then
156 # JSERVER_SUBDIRS1="\$(JSERVER_SUBDIRS1)"
157 JSERVER_SUBDIRS2="\$(JSERVER_SUBDIRS2)"
158 else
159 # JSERVER_SUBDIRS1=""
160 JSERVER_SUBDIRS2=""
161 fi
162 dnl AC_SUBST(JSERVER_SUBDIRS1)
163 AC_SUBST(JSERVER_SUBDIRS2)
164
165 AC_ARG_ENABLE(cWnn,
166 [ --enable-cWnn build and install cWnn [[default=yes]]],
167 [case "${enableval}" in
168 yes) cWnn="cWnn" ;;
169 no) cWnn="" ;;
170 *) AC_MSG_ERROR(bad value for --enable-cWnn) ;;
171 esac], cWnn="cWnn")
172 AC_SUBST(cWnn)
173
174 AC_ARG_ENABLE(kWnn,
175 [ --enable-kWnn build and install kWnn [[default=yes]]],
176 [case "${enableval}" in
177 yes) kWnn="kWnn" ;;
178 no) kWnn="" ;;
179 *) AC_MSG_ERROR(bad value for --enable-kWnn) ;;
180 esac], kWnn="kWnn")
181 AC_SUBST(kWnn)
182
183 dnl For a library libwnn
184
185 dnl AC_ARG_WITH(libwnn,
186 dnl [ --with-libwnn use installed Wnn library [default=no]],
187 dnl [case "${withval}" in
188 dnl yes|no) with_libwnn=${withval};;
189 dnl *) AC_MSG_ERROR(invalid argument to --with-libwnn) ;;
190 dnl esac], with_libwnn=no)
191 dnl
192
193 AC_ARG_WITH(libwnn,
194 [ --with-libwnn use installed Wnn library [[default=no]]],
195 [ with_libwnn="${withval}"
196 AC_ARG_WITH(wnn-includes,
197 [ --with-wnn-includes=DIR WNN include files are in DIR],
198 [wnnincludedir="-I${withval}"], [wnnincludedir=''])
199 AC_ARG_WITH(wnn-libraries,
200 [ --with-wnn-libraries=DIR Search for WNN libraries in DIR [[default=/usr/local/lib]]],
201 [wnnlibdir="${withval}"], [wnnlibdir='/usr/local/lib'])
202 if test "X${with_libwnn}" = X-lwnn; then
203 WNNJLIB="-L${wnnlibdir} -lwnn"
204 elif test X"`echo ${with_libwnn} | grep '^/.*'`" != X ; then
205 WNNJLIB="${with_libwnn}"
206 else
207 WNNJLIB="${wnnlibdir}/libwnn.a"
208 fi
209 DEPWNNJLIB=""
210 HINSI_DATA="\$(JWNNWNNDIR)/hinsi.data"
211 ],
212 [ WNNJLIB="\$(top_builddir)/Wnn/jlib/libwnn.la"
213 DEPWNNJLIB="\$(WNNJLIB)"
214 HINSI_DATA="\$(top_builddir)/Wnn/jd/hinsi.data"
215 ])
216 AC_SUBST(WNNJLIB)
217 AC_SUBST(DEPWNNJLIB)
218 AC_SUBST(HINSI_DATA)
219
220 AC_ARG_WITH(libcwnn,
221 [ --with-libcwnn use installed cWnn library [[default=no]]],
222 [
223 AC_ARG_WITH(cwnn-includes,
224 [ --with-cwnn-includes=DIR CWNN include files are in DIR],
225 [cwnnincludedir="-I${withval}"], [cwnnincludedir=''])
226 AC_ARG_WITH(cwnn-libraries,
227 [ --with-cwnn-libraries=DIR Search for CWNN libraries in DIR [[default=/usr/local/lib]]],
228 [cwnnlibdir="${withval}"], [cwnnlibdir='/usr/local/lib'])
229 if test "X${with_libcwnn}" = X-lcwnn; then
230 CWNNJLIB="-L${cwnnlibdir} -lcwnn"
231 elif test X"`echo ${with_libcwnn} | grep '^/.*'`" != X ; then
232 CWNNJLIB="${with_libcwnn}"
233 else
234 CWNNJLIB="${cwnnlibdir}/libcwnn.a"
235 fi
236 DEPCWNNJLIB=""
237 CHINSI_DATA="\$(CWNNWNNDIR)/cixing.data"
238 THINSI_DATA="\$(TWNNTDSRC)/cixing.data"
239 ],
240 [ CWNNJLIB="\$(top_builddir)/cWnn/jlib/libcwnn.la"
241 DEPCWNNJLIB="\$(CWNNJLIB)"
242 CHINSI_DATA="\$(CWNNCDSRC)/cixing.data"
243 THINSI_DATA="\$(TWNNTDSRC)/cixing.data"
244 ])
245 AC_SUBST(CWNNJLIB)
246 AC_SUBST(DEPCWNNJLIB)
247 AC_SUBST(CHINSI_DATA)
248 AC_SUBST(THINSI_DATA)
249
250 AC_ARG_WITH(libkwnn,
251 [ --with-libkwnn use installed kWnn library [[default=no]]],
252 [
253 AC_ARG_WITH(kwnn-includes,
254 [ --with-kwnn-includes=DIR KWNN include files are in DIR],
255 [kwnnincludedir="-I${withval}"], [kwnnincludedir=''])
256 AC_ARG_WITH(kwnn-libraries,
257 [ --with-kwnn-libraries=DIR Search for KWNN libraries in DIR [[default=/usr/local/lib]]],
258 [kwnnlibdir="${withval}"], [kwnnlibdir='/usr/local/lib'])
259 if test "X${with_libkwnn}" = X-lkwnn; then
260 KWNNJLIB="-L${kwnnlibdir} -lkwnn"
261 elif test X"`echo ${with_libkwnn} | grep '^/.*'`" != X ; then
262 KWNNJLIB="${with_libkwnn}"
263 else
264 KWNNJLIB="${kwnnlibdir}/libkwnn.a"
265 fi
266 DEPKWNNJLIB=""
267 KHINSI_DATA="\$(KWNNWNNDIR)/hinsi.data"
268 ],
269 [ KWNNJLIB="\$(top_builddir)/kWnn/jlib/libkwnn.la"
270 DEPKWNNJLIB="\$(KWNNJLIB)"
271 KHINSI_DATA="\$(KWNNKDSRC)/hinsi.data"
272 ])
273 AC_SUBST(KWNNJLIB)
274 AC_SUBST(DEPKWNNJLIB)
275 AC_SUBST(KHINSI_DATA)
276
277 dnl
278 dnl Build Options
279 dnl
280
281 AC_ARG_ENABLE(ipv6,
282 [ --enable-ipv6 build and install IPv6 [[default=no]]],
283 [case "${enableval}" in
284 yes) ipv6="-DINET6";;
285 no) ipv6="" ;;
286 *) AC_MSG_ERROR(bad value for --enable-ipv6) ;;
287 esac], ipv6="")
288 AC_SUBST(ipv6)
289
290 AC_ARG_ENABLE(unsafe-path,
291 [ --enable-unsafe-path allow creating files in an arbitrary path [[default=no]]],
292 [case "${enableval}" in
293 yes) unsafe_path=true;;
294 no) unsafe_path=false;;
295 *) AC_MSG_ERROR(bad value for --enable-unsafe-path) ;;
296 esac], unsafe_path=false)
297 AC_SUBST(unsafe_path)
298
299 if test ${unsafe_path} = true; then
300 AC_DEFINE(WNN_ALLOW_UNSAFE_PATH, 1,
301 [Define to allow writing to other than JSERVERDIR.])
302 fi
303
304 dnl
305 dnl Checks for cc and cpp.
306 dnl
307 AC_PROG_CC
308
309 dnl System specific options
310 dnl Now that we are using autoconf, CCOPTIONS should be nuked...
311 dnl But please report if your system needs specific settings (CCOPTIONS etc.)
312 case $host in
313 *-*-linux*)
314 CCOPTIONS="-Dlinux -D_GNU_SOURCE -D_POSIX_SOURCE -D_BSD_SOURCE"
315 ;;
316 *-*-darwin*)
317 if test $GCC = yes; then
318 # Unfortunately, autoconf (at least 2.57) does not recognize
319 # proper CPP. (Normal cpp-precomp nor auto-retrying in basic mode does
320 # not work with pubdic+ processing.) So define here ....
321 # Note: It seems gcc-3.3 (or (probably) later) does not need this.
322 CPP=${CPP:-"$CC -E -no-cpp-precomp"}
323 fi
324 # Don't care other CC-s.
325 ;;
326 *-*-sunos*)
327 if test $GCC = yes; then
328 CCOPTIONS="-Dsun -Dsparc"
329 else
330 CCOPTIONS=""
331 fi
332 ;;
333 *-*-solaris2.*)
334 # Will 'solaris*' be OK?
335 if test $GCC = yes; then
336 CCOPTIONS="-Dsun -D`uname -p` -DSVR4 -DSYSV"
337 else
338 CCOPTIONS="-Xc -xF -xcg92 -Dsun -D`uname -p` -DSVR4 -DSYSV"
339 fi
340 ;;
341 *-*-hpux*)
342 if test $GCC = yes; then
343 CCOPTIONS="-Dhpux -DSYSV"
344 else
345 CCOPTIONS="-Ae -Dhpux -DSYSV"
346 fi
347 ;;
348 i[[34567]]86-pc-beos*)
349 CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE"
350 ;;
351 powerpc-*-beos*)
352 CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE"
353 ;;
354 *-*-aix*)
355 CCOPTIONS="-DSYSV"
356 ;;
357 esac
358
359 dnl Checking if we use gcc or not
360 if test $debug = true; then
361 if test $GCC = yes; then
362 # FIXME: gcc -fstack-check doesn't work well on Linux/i386 ...
363 CDEBUGFLAGS=${CDEBUGFLAGS:-"-g2 -O2 -Wall"}
364 else
365 CDEBUGFLAGS=${CDEBUGFLAGS:-""}
366 fi
367 INSTPGMFLAGS=
368 else
369 CDEBUGFLAGS=${CDEBUGFLAGS:-""}
370 INSTPGMFLAGS="-s"
371 fi
372 AC_SUBST(CCOPTIONS)
373 AC_SUBST(CDEBUGFLAGS)
374 AC_SUBST(INSTPGMFLAGS)
375
376 echo "Set CDEBUGFLAGS and CCOPTIONS to following:"
377 echo ' CDEBUGFLAGS="'"$CDEBUGFLAGS"'"'
378 echo ' CCOPTIONS="'"$CCOPTIONS"'"'
379
380 dnl ��������������������������������configure������������CPP������������
381 dnl ������������������������������������CPP������������������������
382 dnl ��CPP=${CPP:-"/usr/ccs/lib/cpp"}������������������������������������
383 dnl ����������������
384 AC_PROG_CPP
385
386 dnl
387 dnl Checks for programs.
388 dnl
389 dnl ### AC_PROG_YACC
390 dnl ### AC_PROG_LEX
391 AC_PROG_INSTALL
392 AC_PROG_LN_S
393 AC_PROG_MAKE_SET
394 AC_PROG_LIBTOOL
395 AC_SUBST(LIBTOOL_DEPS)
396
397 dnl Checks for libraries.
398 dnl ### dnl Replace `main' with a function in -lX11:
399 dnl ### AC_CHECK_LIB(X11, main)
400 dnl ### dnl Replace `main' with a function in -lcurses:
401 dnl ### AC_CHECK_LIB(curses, main)
402
403 AC_SEARCH_LIBS(crypt, crypt)
404 AC_CHECK_LIB(socket, connect)
405 AC_CHECK_LIB(bind, getservbyname)
406 AC_CHECK_LIB(nsl, gethostbyname)
407 dnl libutil only needed by uum w/openpty...
408 dnl FIXME: deals with Linux that have both ptsname & openpty
409 AC_CHECK_LIB(util, openpty)
410
411 dnl
412 dnl Checks for header files.
413 dnl
414 AC_PATH_X
415 AC_HEADER_STDC
416 AC_HEADER_SYS_WAIT
417 AC_HEADER_TIME
418 AC_CHECK_HEADERS(fcntl.h syslog.h unistd.h utmp.h utmpx.h \
419 sys/file.h sys/ioctl.h sys/time.h sys/types.h sys/param.h \
420 malloc.h strings.h memory.h \
421 curses.h ncurses.h sgtty.h term.h termio.h termios.h \
422 termcap.h sys/termio.h libutil.h\
423 )
424
425 dnl
426 dnl Terminal library selection.
427 dnl ported from vim6.1 via canuum (Canna 3.6p3) for uum.
428 dnl FIXME: cross compilation
429 dnl
430 olibs="$LIBS"
431 CNVFILE_SUBDIR=bsd
432 AC_MSG_CHECKING(--with-term-libs argument)
433 AC_ARG_WITH(tlib,
434 [ --with-term-libs=-lLIB terminal library to be used ],)
435 if test -n "$with_term_libs"; then
436 AC_MSG_RESULT($with_term_libs)
437 dnl LIBS="$LIBS $with_term_libs"
438 TERMLIB=$with_term_libs
439 else
440 AC_MSG_RESULT([automatic terminal library selection])
441 dnl On HP-UX 10.10 termcap or termlib should be used instead of
442 dnl curses, because curses is much slower.
443 dnl Newer versions of ncurses are preferred over anything.
444 dnl Older versions of ncurses have bugs, get a new one!
445 dnl Digital Unix (OSF1) should use curses (Ronald Schild).
446 case "`uname -s 2>/dev/null`" in
447 OSF1) tlibs="ncurses curses termlib termcap";;
448 *) tlibs="ncurses termlib termcap curses";;
449 esac
450 for libname in $tlibs; do
451 AC_CHECK_LIB(${libname}, tgetent, [
452 dnl It's possible that a library is found but it doesn't work
453 dnl e.g., shared library that cannot be found.
454 dnl compile and run a test program to be sure
455 LIBS="${LIBS} -l${libname}"
456 AC_TRY_RUN([
457 #ifdef HAVE_TERMCAP_H
458 # include <termcap.h>
459 #endif
460 main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }],
461 res="OK", res="FAIL", res="FAIL")
462 if test "$res" = "OK"; then
463 TERMLIB="${TERMLIB} -l${libname}"
464 dnl lname=`echo ${libname} | sed 'y/termcaplibnus/TERMCAPLIBNUS/'`
465 dnl AC_DEFINE_UNQUOTED(HAVE_${lname}, 1, [use ${libname} for terminal control])
466 dnl We need to define AH_TEMPLATE (if we really need this)
467 dnl ex. AH_TEMPLATE(HAVE_NCURSES, [use ncurses for terminal control])
468 break
469 fi
470 AC_MSG_RESULT($libname library is not usable)
471 ],)
472 LIBS=${olibs}
473 done
474 fi
475 if test "x$TERMLIB" != "x"; then
476 LIBS="${LIBS} ${TERMLIB}"
477 AC_MSG_CHECKING(whether we talk terminfo)
478 AC_TRY_RUN([
479 #ifdef HAVE_TERMCAP_H
480 # include <termcap.h>
481 #endif
482 main()
483 {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }],
484 [ AC_MSG_RESULT([no -- we are in termcap land])
485 CNVFILE_SUBDIR=bsd ],
486 [ AC_DEFINE(HAVE_TERMINFO, 1, [terminfo spoken here])
487 AC_MSG_RESULT([yes -- terminfo spoken here])
488 CNVFILE_SUBDIR=sysV ],
489 AC_MSG_ERROR(failed to compile test program.))
490 else
491 AC_MSG_RESULT(none found)
492 fi
493 LIBS=${olibs}
494 AC_SUBST(TERMLIB)
495 AC_SUBST(CNVFILE_SUBDIR)
496
497 dnl Checks for typedefs, structures, and compiler characteristics.
498 dnl
499 AC_TYPE_MODE_T
500 AC_HEADER_TIME
501
502 dnl AC_CHECK_TYPES(time_t,,
503 dnl AC_DEFINE(time_t, long, [Define missing time_t.]),
504 dnl [INCLUDES = time.h])
505 AC_CHECK_TYPES(socklen_t,,
506 AC_DEFINE(socklen_t, int, [Define missing socklen_t.]), [
507 #if HAVE_SYS_TYPES_H
508 # include <sys/types.h>
509 #endif
510 #include <sys/socket.h>])
511
512 AC_CHECK_MEMBERS([struct utmp.ut_user, struct utmp.ut_name, struct utmp.ut_id],,,[
513 #include <sys/types.h>
514 #if HAVE_UTMPX_H
515 # include <utmpx.h>
516 #endif
517 #if HAVE_UTMP_H
518 # include <utmp.h>
519 #endif])
520
521 dnl
522 dnl Checks for symbol
523 dnl
524
525 dnl
526 dnl Checks for library functions.
527 dnl
528 AC_PROG_GCC_TRADITIONAL
529
530 dnl idea borrowed from EB Library http://www.sra.co.jp/people/m-kasahr/eb/
531 AC_TYPE_SIGNAL
532 if test "$ac_cv_type_signal" = void; then
533 AC_DEFINE(RETSIGTYPE_VOID, 1, [Define if the signal function returns void.])
534 fi
535
536 AC_FUNC_MEMCMP
537 AC_CHECK_FUNCS(getpgid getpgrp setpgrp wait3)
538 AC_FUNC_GETPGRP
539 AC_FUNC_SETPGRP
540 dnl FreeWnn do not use the 3rd parameter of wait3().
541 dnl AC_FUNC_WAIT3
542
543 dnl NOTE: FD_SET is defined as macro on many systems. But this check
544 dnl will be done in Wnn/include/wnn_os.h , so don't care...
545 AC_CHECK_FUNCS(random drand48 fchmod getopt killpg \
546 FD_SET \
547 gethostname select socket closesocket setsockopt send recv \
548 getdtablesize getrlimit syslog vsyslog setenv snprintf \
549 ptsname posix_openpt openpty pututxline pututline setsid)
550 dnl for bcopy/index -> memcpy/strchr conversion (preparation):
551 AC_CHECK_FUNCS(bcopy bzero bcmp index rindex \
552 memcpy memmove memset strchr strrchr)
553
554 dnl Check fallback functions for jserver (should use AC_REPLACE_FUNCS?)
555 JS_SUPPORTOBJS=
556 AC_CHECK_FUNCS(mkdir vasprintf, ,
557 [JS_SUPPORTOBJS="${JS_SUPPORTOBJS} ${ac_func}.o"])
558 AC_SUBST(JS_SUPPORTOBJS)
559
560 dnl delayed check for --enable-client-utmp
561 if test $client = true; then
562 if test $client_utmp = auto; then
563 AC_EGREP_CPP(yes, [
564 #if HAVE_SYS_PARAM_H
565 # include <sys/param.h>
566 #endif
567 #if defined(BSD) && (BSD >= 199306) && !defined(HAVE_PUTUTXLINE) && !defined(HAVE_PUTUTLINE)
568 yes
569 #endif
570 ], client_utmp=false, client_utmp=true)
571 fi
572
573 dnl for Debug
574 AC_MSG_CHECKING([whether we're using utmp with uum])
575 if test $client_utmp = true; then
576 dnl We need to look again if we introduce libspt check
577 AC_DEFINE(USE_UTMP, 1, [Define to 1 if uum writes utmp entry])
578 AC_MSG_RESULT(yes)
579 else
580 AC_MSG_RESULT(no)
581 fi
582 fi
583
584 dnl delayed check for --enable-client-set[ug]id
585 if test $client = true; then
586 guess_setuid=
587 guess_setgid=false
588 dnl Note: (HAVE_OPENPTY && defined(TIOCPTMGET)): for recent OpenBSD
589 if test $client_utmp = true; then
590 AC_EGREP_CPP(yes, [
591 #if HAVE_SYS_IOCTL_H
592 # include <sys/ioctl.h>
593 #endif
594 #if HAVE_PTSNAME || (HAVE_OPENPTY && defined(TIOCPTMGET))
595 # if HAVE_PUTUTLINE || HAVE_PUTUTXLINE
596 yes
597 # endif
598 #endif
599 ], [
600 case $host_os in
601 linux*)
602 # On recent Linux, it has both ptsname() and putut*line().
603 # But putut*line() will take effect only if prog is installed
604 # with set-gid to group utmp.
605 guess_setgid=true
606 UUMGROUP=${UUMGROUP:-utmp}
607 ;;
608 esac
609 guess_setuid=false
610 ], guess_setuid=true)
611 else
612 # $client_utmp != true
613 AC_EGREP_CPP(yes, [
614 #if HAVE_SYS_IOCTL_H
615 # include <sys/ioctl.h>
616 #endif
617 #if HAVE_PTSNAME || (HAVE_OPENPTY && defined(TIOCPTMGET))
618 yes
619 #endif
620 ], guess_setuid=false, guess_setuid=true)
621 fi
622 # $client_utmp != true
623
624 if test $client_setuid = auto; then
625 client_setuid=$guess_setuid
626 # UUMOWNER is already set ...
627 fi
628 if test $client_setgid = auto; then
629 client_setgid=$guess_setgid
630 # UUMGROUP is already set (if it needs)
631 fi
632
633 dnl set install flag (at last)
634 if test $client_setuid = true; then
635 INSTUUMFLAGS="-o \$(UUMOWNER)"
636 if test $client_setgid = true; then
637 INSTUUMFLAGS="-m 6711 $INSTUUMFLAGS -g \$(UUMGROUP)"
638 else
639 # client_setuid && !client_setgid
640 INSTUUMFLAGS="-m 4711 $INSTUUMFLAGS"
641 fi
642 else
643 if test $client_setgid = true; then
644 # !client_setuid && client_setgid
645 INSTUUMFLAGS="-m 2711 -g \$(UUMGROUP)"
646 else
647 # !client_setuid && !client_setgid
648 INSTUUMFLAGS="-m 0711"
649 fi
650 fi
651
652 dnl for Debug
653 AC_MSG_CHECKING([whether we need to install uum as setuid program])
654 if test $client_setuid = true; then
655 AC_MSG_RESULT([yes, $UUMOWNER])
656 else
657 AC_MSG_RESULT(no)
658 fi
659 AC_MSG_CHECKING([whether we need to install uum as setgid program])
660 if test $client_setgid = true; then
661 AC_MSG_RESULT([yes, $UUMGROUP])
662 else
663 AC_MSG_RESULT(no)
664 fi
665 else
666 # $client != true
667 INSTUUMFLAGS="-m 4711 -o \$(UUMOWNER)"
668 fi
669 # $client = true
670
671 AC_SUBST(INSTUUMFLAGS)
672 AC_SUBST(UUMOWNER)
673 AC_SUBST(UUMGROUP)
674
675 dnl
676
677 dnl
678 dnl File Existence
679 dnl Checking file at compile time may bring false result when cross-
680 dnl compiling. So, one have to check generated config.h and edit it
681 dnl if necessary after running configure.
682 dnl
683 dnl AC_CHECK_FILE(/dev/ptmx, AC_DEFINE(HAVE_DEV_PTMX, 1, [/dev/ptmx found]),)
684 AC_CHECK_FILES(/dev/ptmx,,)
685
686
687 dnl
688 dnl FIXME: libspt support
689 dnl for example:
690 dnl
691 dnl --with-libspt[=/path/to/libspt-config]
692 dnl
693 dnl LIBSPT_CFLAGS=`/path/to/libspt-config --cflags`
694 dnl LIBSPT_LIBS=`/path/to/libspt-config --libs`
695 dnl AC_SUBST(LIBSPT_CFLAGS)
696 dnl AC_SUBST(LIBSPT_LIBS)
697 dnl AC_DEFINE(HAVE_LIBSPT, 1, [Define if you have libspt support.])
698
699 dnl
700 dnl TCP Wrapper.
701 dnl
702 WRAPLIB=
703 AC_MSG_CHECKING(whether to use libwrap)
704 AC_ARG_WITH(libwrap,
705 [ --with-libwrap[[=DIR]] Compile in libwrap (tcp_wrappers) support [[default=try to find libwrap]]],
706 [ case "$withval" in
707 no)
708 AC_MSG_RESULT(no)
709 WRAP_TRY=no
710 ;;
711 yes)
712 AC_MSG_RESULT(yes)
713 WRAP_TRY=yes
714 ;;
715 *)
716 AC_MSG_RESULT(yes)
717 WRAP_TRY=yes
718 if test -d "$withval"; then
719 WRAPINCLUDES="-I$withval"
720 if test -d $withval/include; then
721 WRAPINCLUDES="-I$withval/include $WRAPINCLUDES"
722 fi
723 WRAPLIB="-L$withval -lwrap"
724 if test -d $withval/lib; then
725 WRAPLIB="-L$withval/lib $WRAPLIB"
726 fi
727 else
728 WRAPINCLUDES="$withval"
729 fi
730 ;;
731 esac],
732 [AC_MSG_RESULT([try to find])
733 WRAP_TRY=auto]
734 )
735 # Link test for libwrap
736 if test "$WRAP_TRY" = yes -o "$WRAP_TRY" = auto; then
737 OLDCFLAGS="$CFLAGS"
738 CFLAGS="$WRAPINCLUDES $CFLAGS"
739 OLDLIBS="$LIBS"
740 WRAPLIB=${WRAPLIB:-"-lwrap"}
741 LIBS="$WRAPLIB $OLDLIBS"
742 AC_MSG_CHECKING([libwrap is working])
743 AC_TRY_LINK([ int allow_severity; int deny_severity; ],
744 [ hosts_access(); ],
745 [ AC_MSG_RESULT(yes)
746 AC_DEFINE(HAVE_LIBWRAP, 1,
747 [Define if you have libwrap (TCP wrapper) support.])
748 AC_SUBST(WRAPLIB)],
749 [ AC_MSG_RESULT(no)
750 if test "$WRAP_TRY" = yes; then
751 AC_MSG_ERROR([Could not find libwrap. Please check config.log.])
752 else
753 # recover old flag / clear needless WRAPLIB and continue
754 CFLAGS=$OLDCFLAGS
755 WRAPLIB=
756 fi] )
757 # only jserver needs libwrap, recover LIBS also
758 LIBS=$OLDLIBS
759 fi
760
761
762 dnl
763 dnl Creating Makefiles.
764 dnl
765 # mkdir -p Contrib/dic/gerodic in case builddir != srcdir
766 dir=Contrib/dic/gerodic
767 if test ! -d $dir; then
768 echo "creating $dir ..."
769 $ac_install_sh -d $dir
770 fi
771
772 dnl
773 dnl Generate Makefiles
774 dnl
775
776 dnl Generic
777
778 makefiles_generic="makerule.mk Makefile"
779
780 dnl Japanese
781
782 if test "x${Wnn}" = "xWnn"; then
783 makefiles_wnn="Wnn/Makefile Wnn/conv/Makefile Wnn/include/Makefile \
784 Wnn/jd/Makefile Wnn/jd/rk/Makefile Wnn/jd/rk.vi/Makefile \
785 Wnn/jlib/Makefile Wnn/jlib.V3/Makefile Wnn/jserver/Makefile \
786 Wnn/jutil/Makefile Wnn/ld/Makefile Wnn/ld/rk/Makefile \
787 Wnn/romkan/Makefile Wnn/uum/Makefile \
788 Wnn/man/Makefile Wnn/man/2.env/Makefile Wnn/man/3.libwnn/Makefile \
789 Wnn/man/4.cmd/Makefile Wnn/man/6.jutil/Makefile \
790 Wnn/man/2.env/dic/Makefile Wnn/man/2.env/wnn/Makefile \
791 Wnn/man/3.libwnn/jl_lib/Makefile Wnn/man/3.libwnn/js_lib/Makefile \
792 Wnn/man/3.libwnn/misc_lib/Makefile Wnn/man/3.libwnn/rk_lib/Makefile"
793 makefiles_wnn_dic="Contrib/dic/gerodic/Makefile Wnn/pubdicplus/Makefile \
794 Wnn/wnncons/Makefile Wnn/wnncons/dic/Makefile"
795 fi
796
797 dnl Chinese and Taiwanese
798
799 if test "x$cWnn" = "xcWnn"; then
800 makefiles_cwnn="cWnn/Makefile cWnn/conv/Makefile cWnn/etc/Makefile \
801 cWnn/cd/Makefile cWnn/cd/rk/Makefile \
802 cWnn/cd/rk_p/Makefile cWnn/cd/rk_z/Makefile \
803 cWnn/td/Makefile cWnn/td/rk/Makefile \
804 cWnn/td/rk_z/Makefile cWnn/td/rk_p/Makefile \
805 cWnn/include/Makefile cWnn/jlib/Makefile \
806 cWnn/jserver/Makefile cWnn/jutil/Makefile \
807 cWnn/man/Makefile cWnn/man/1.intro/Makefile cWnn/man/2.env/Makefile \
808 cWnn/man/4.cmd/Makefile cWnn/man/6.jutil/Makefile \
809 cWnn/romkan/Makefile cWnn/uum/Makefile"
810 makefiles_cwnn_dic="cWnn/cdic/Makefile cWnn/tdic/Makefile"
811 fi
812
813 dnl Korean
814
815 if test "x$kWnn" = "xkWnn"; then
816 makefiles_kwnn="kWnn/Makefile kWnn/conv/Makefile kWnn/etc/Makefile \
817 kWnn/include/Makefile kWnn/jlib/Makefile kWnn/jutil/Makefile \
818 kWnn/jserver/Makefile kWnn/kd/Makefile kWnn/kd/rk/Makefile \
819 kWnn/romkan/Makefile kWnn/uum/Makefile"
820 makefiles_kwnn_dic="kWnn/kdic/Makefile"
821 fi
822
823 AC_OUTPUT(${makefiles_generic} \
824 ${makefiles_wnn} ${makefiles_wnn_dic} \
825 ${makefiles_cwnn} ${makefiles_cwnn_dic} \
826 ${makefiles_kwnn} ${makefiles_kwnn_dic})

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26