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.57 - (show annotations) (download)
Sat Aug 3 14:56:59 2013 UTC (10 years, 8 months ago) by aonoto
Branch: MAIN
Changes since 1.56: +32 -8 lines
- Improve libutil detection. Systems that have both ptsname() and
  openpty() does not need libutil, this change (probably) covers
  these systems. Based on patch by 1xx ([freewnn-users 133]).

- Some cosmetic fixes.

1 dnl
2 dnl $Id: configure.in,v 1.56 2013/08/01 18:43:07 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 2010, 2011, 2013
16 dnl
17 dnl Maintainer: FreeWnn Project
18 dnl
19 dnl This program is free software; you can redistribute it and/or modify
20 dnl it under the terms of the GNU General Public License as published by
21 dnl the Free Software Foundation; either version 2 of the License, or
22 dnl (at your option) any later version.
23 dnl
24 dnl This program is distributed in the hope that it will be useful,
25 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
26 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 dnl GNU General Public License for more details.
28 dnl
29 dnl You should have received a copy of the GNU General Public License
30 dnl along with this program; if not, write to the Free Software
31 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 dnl
33
34 dnl
35 dnl Process this file with autoconf to produce a configure script.
36 dnl
37 AC_INIT(FreeWnn, [1.1.1-cvs-a022], [freewnn-users-owner@lists.sourceforge.jp], FreeWnn)
38 AC_CONFIG_SRCDIR(Wnn/conv/cvt_head.h)
39 dnl old-style AC_INIT ...
40 dnl AC_INIT(Wnn/conv/cvt_head.h)
41 AC_CONFIG_HEADER(config.h)
42
43 dnl ====================================================================
44 dnl Check optional features
45 dnl ====================================================================
46
47 # Quick and Dirty workaround for Autoconf-2.53 and Libtools-1.5.* pair ...
48 # not to use additional tagged configuration. (default: CXX F77)
49 # NOTICE: Please remove next line if situation changes. (aono)
50 tagnames=
51
52 AC_CANONICAL_HOST
53
54 dnl
55 AC_ARG_PROGRAM
56
57 dnl build and install libraries, server or client
58
59 AC_ARG_ENABLE(debug,
60 [ --enable-debug enable debug options [[default=no]]],
61 [case "${enableval}" in
62 yes) debug=true ;;
63 no) debug=false ;;
64 *) AC_MSG_ERROR(bad value for --enable-debug)
65 esac], debug=false)
66
67 AC_ARG_ENABLE(libraries,
68 [ --enable-libraries build and install libraries [[default=yes]]],
69 [case "${enableval}" in
70 yes) libraries=true ;;
71 no) libraries=false ;;
72 *) AC_MSG_ERROR(bad value for --enable-libraries) ;;
73 esac], libraries=true)
74
75 AC_ARG_ENABLE(server,
76 [ --enable-server build and install server [[default=yes]]],
77 [case "${enableval}" in
78 yes) server=true ;;
79 no) server=false ;;
80 *) AC_MSG_ERROR(bad value for --enable-server) ;;
81 esac], server=true)
82
83 AC_ARG_ENABLE(client,
84 [ --enable-client build and install clients [[default=no]]],
85 [case "${enableval}" in
86 yes) client=true ;;
87 no) client=false ;;
88 *) AC_MSG_ERROR(bad value for --enable-client) ;;
89 esac], client=false)
90
91 AC_ARG_ENABLE(client-utmp,
92 [ --enable-client-utmp write utmp with client [[default=yes if not modern BSD]]],
93 [case "${enableval}" in
94 yes) client_utmp=true ;;
95 no) client_utmp=false ;;
96 *) AC_MSG_ERROR(bad value for --enable-client-utmp) ;;
97 esac],
98 client_utmp=auto
99 )
100
101 dnl If you set set-[ug]id user/group to (ex.) 'yes',
102 dnl you can configure this with setting UUMOWNER / UUMGROUP .
103 AC_ARG_ENABLE(client-setuid,
104 [ --enable-client-setuid[[=user]] Install client with setuid and specified user [[default=guess if your system need this]]],
105 [case "${enableval}" in
106 yes) client_setuid=true; UUMOWNER=${UUMOWNER:-root} ;;
107 no) client_setuid=false ;;
108 *) client_setuid=true; UUMOWNER=${enableval} ;;
109 esac],
110 [client_setuid=auto # guess later ...
111 UUMOWNER=root]
112 )
113
114 AC_ARG_ENABLE(client-setgid,
115 [ --enable-client-setgid=group Install client with setgid and specified group [[default=guess if your system need this]]],
116 [case "${enableval}" in
117 yes)
118 if test "x$UUMGROUP" = "x"; then
119 AC_ERROR([You must set group name with --enable-client-setgid.])
120 else
121 client_setgid=true; # we already defined UUMGROUP ...
122 fi
123 ;;
124 no) client_setgid=false ;;
125 *) client_setgid=true; UUMGROUP=${enableval} ;;
126 esac],
127 [client_setgid=auto # guess later ...
128 UUMGROUP=]
129 )
130
131 if test $libraries = true; then
132 SUBDIRS="\$(LIB_SUBDIRS)"
133 WNNMANDIR="\$(LIB_WNNMANDIR)"
134 fi
135 if test $server = true; then
136 SUBDIRS="$SUBDIRS \$(SERVER_SUBDIRS)"
137 WNNMANDIR="$WNNMANDIR \$(SERVER_WNNMANDIR)"
138 fi
139 if test $client = true; then
140 SUBDIRS="$SUBDIRS \$(CLIENT_SUBDIRS)"
141 dnl currently client is only uum and its man is in SERVER_WNNMANDIR
142 dnl WNNMANDIR="$WNNMANDIR \$(CLIENT_WNNMANDIR)"
143 fi
144
145 AC_SUBST(SUBDIRS)
146 AC_SUBST(WNNMANDIR)
147
148 dnl For Servers
149
150 AC_ARG_ENABLE(Wnn,
151 [ --enable-Wnn build and install Wnn [[default=yes]]],
152 [case "${enableval}" in
153 yes) Wnn="Wnn";;
154 no) Wnn="" ;;
155 *) AC_MSG_ERROR(bad value for --enable-Wnn) ;;
156 esac], Wnn="Wnn")
157 AC_SUBST(Wnn)
158
159 if test "$server" = true -a "$Wnn" = Wnn; then
160 # JSERVER_SUBDIRS1="\$(JSERVER_SUBDIRS1)"
161 JSERVER_SUBDIRS2="\$(JSERVER_SUBDIRS2)"
162 else
163 # JSERVER_SUBDIRS1=""
164 JSERVER_SUBDIRS2=""
165 fi
166 dnl AC_SUBST(JSERVER_SUBDIRS1)
167 AC_SUBST(JSERVER_SUBDIRS2)
168
169 AC_ARG_ENABLE(cWnn,
170 [ --enable-cWnn build and install cWnn [[default=yes]]],
171 [case "${enableval}" in
172 yes) cWnn="cWnn" ;;
173 no) cWnn="" ;;
174 *) AC_MSG_ERROR(bad value for --enable-cWnn) ;;
175 esac], cWnn="cWnn")
176 AC_SUBST(cWnn)
177
178 AC_ARG_ENABLE(kWnn,
179 [ --enable-kWnn build and install kWnn [[default=yes]]],
180 [case "${enableval}" in
181 yes) kWnn="kWnn" ;;
182 no) kWnn="" ;;
183 *) AC_MSG_ERROR(bad value for --enable-kWnn) ;;
184 esac], kWnn="kWnn")
185 AC_SUBST(kWnn)
186
187 dnl For a library libwnn
188
189 AC_ARG_WITH(libwnn,
190 [ --with-libwnn use installed Wnn library [[default=no]]],
191 [ with_libwnn="${withval}"], [with_libwnn=no])
192 AC_ARG_WITH(wnn-includes,
193 [ --with-wnn-includes=DIR Installed Wnn include files are in DIR],
194 [wnnincludedir="-I${withval}"], [wnnincludedir=''])
195 AC_ARG_WITH(wnn-libraries,
196 [ --with-wnn-libraries=DIR Search for Wnn libraries in DIR [[default=/usr/local/lib]]],
197 [wnnlibdir="${withval}"], [wnnlibdir='/usr/local/lib'])
198
199 if test X${with_libwnn} != Xno; then
200 case X${with_libwnn} in
201 Xyes | X-lwnn)
202 WNNJLIB="-L${wnnlibdir} -lwnn" ;;
203 X/*)
204 WNNJLIB="${wnnlibdir}/libwnn.a" ;;
205 *)
206 # Honor specified value --with-libwnn
207 # (maybe wrong in most cases)
208 WNNJLIB="${with_libwnn}" ;;
209 esac
210 DEPWNNJLIB=""
211 dnl NOTICE: HINSI_DATA depends on --prefix (and makerule.mk).
212 HINSI_DATA="\$(JWNNWNNDIR)/hinsi.data"
213 EXTWNNJINC=${wnnincludedir}
214 else
215 WNNJLIB="\$(top_builddir)/Wnn/jlib/libwnn.la"
216 DEPWNNJLIB="\$(WNNJLIB)"
217 HINSI_DATA="\$(top_builddir)/Wnn/jd/hinsi.data"
218 EXTWNNJINC=""
219 fi
220 AC_SUBST(WNNJLIB)
221 AC_SUBST(DEPWNNJLIB)
222 AC_SUBST(EXTWNNJINC)
223 AC_SUBST(HINSI_DATA)
224
225 AC_ARG_WITH(libcwnn,
226 [ --with-libcwnn use installed cWnn library [[default=no]]],
227 [ with_libcwnn="${withval}"], [with_libcwnn=no])
228 AC_ARG_WITH(cwnn-includes,
229 [ --with-cwnn-includes=DIR Installed cWnn include files are in DIR],
230 [cwnnincludedir="-I${withval}"], [cwnnincludedir=''])
231 AC_ARG_WITH(cwnn-libraries,
232 [ --with-cwnn-libraries=DIR Search for cWnn libraries in DIR [[default=/usr/local/lib]]],
233 [cwnnlibdir="${withval}"], [cwnnlibdir='/usr/local/lib'])
234
235 if test X${with_libcwnn} != Xno; then
236 case X${with_libcwnn} in
237 Xyes | X-lcwnn)
238 CWNNJLIB="-L${cwnnlibdir} -lcwnn" ;;
239 X/*)
240 CWNNJLIB="${cwnnlibdir}/libcwnn.a" ;;
241 *)
242 # Honor specified value --with-libcwnn
243 # (maybe wrong in most cases)
244 CWNNJLIB="${with_libcwnn}" ;;
245 esac
246 DEPCWNNJLIB=""
247 dnl NOTICE: [CT]HINSI_DATA also depends on --prefix (and makerule.mk).
248 CHINSI_DATA="\$(CWNNWNNDIR)/cixing.data"
249 THINSI_DATA="\$(TWNNWNNDIR)/cixing.data"
250 EXTCWNNJINC=${cwnnincludedir}
251 else
252 CWNNJLIB="\$(top_builddir)/cWnn/jlib/libcwnn.la"
253 DEPCWNNJLIB="\$(CWNNJLIB)"
254 CHINSI_DATA="\$(CWNNCDSRC)/cixing.data"
255 THINSI_DATA="\$(TWNNTDSRC)/cixing.data"
256 EXTCWNNJINC=""
257 fi
258 AC_SUBST(CWNNJLIB)
259 AC_SUBST(DEPCWNNJLIB)
260 AC_SUBST(EXTCWNNJINC)
261 AC_SUBST(CHINSI_DATA)
262 AC_SUBST(THINSI_DATA)
263
264 AC_ARG_WITH(libkwnn,
265 [ --with-libkwnn use installed kWnn library [[default=no]]],
266 [ with_libkwnn="${withval}"], [with_libkwnn=no])
267 AC_ARG_WITH(kwnn-includes,
268 [ --with-kwnn-includes=DIR Installed kWnn include files are in DIR],
269 [kwnnincludedir="-I${withval}"], [kwnnincludedir=''])
270 AC_ARG_WITH(kwnn-libraries,
271 [ --with-kwnn-libraries=DIR Search for kWnn libraries in DIR [[default=/usr/local/lib]]],
272 [kwnnlibdir="${withval}"], [kwnnlibdir='/usr/local/lib'])
273
274 if test X${with_libkwnn} != Xno; then
275 case X${with_libkwnn} in
276 Xyes | X-lkwnn)
277 KWNNJLIB="-L${kwnnlibdir} -lkwnn" ;;
278 X/*)
279 KWNNJLIB="${kwnnlibdir}/libkwnn.a" ;;
280 *)
281 # Honor specified value --with-libkwnn
282 # (maybe wrong in most cases)
283 KWNNJLIB="${with_libkwnn}" ;;
284 esac
285 DEPKWNNJLIB=""
286 dnl NOTICE: KHINSI_DATA also depends on --prefix (and makerule.mk).
287 KHINSI_DATA="\$(KWNNWNNDIR)/hinsi.data"
288 EXTKWNNJINC=${kwnnincludedir}
289 else
290 KWNNJLIB="\$(top_builddir)/kWnn/jlib/libkwnn.la"
291 DEPKWNNJLIB="\$(KWNNJLIB)"
292 KHINSI_DATA="\$(KWNNKDSRC)/hinsi.data"
293 EXTKWNNJINC=""
294 fi
295 AC_SUBST(KWNNJLIB)
296 AC_SUBST(DEPKWNNJLIB)
297 AC_SUBST(EXTKWNNJINC)
298 AC_SUBST(KHINSI_DATA)
299
300 dnl
301 dnl Build Options
302 dnl
303
304 AC_ARG_ENABLE(ipv6,
305 [ --enable-ipv6 build and install IPv6 [[default=no]]],
306 [case "${enableval}" in
307 yes) ipv6="-DINET6";;
308 no) ipv6="" ;;
309 *) AC_MSG_ERROR(bad value for --enable-ipv6) ;;
310 esac], ipv6="")
311 AC_SUBST(ipv6)
312
313 AC_ARG_ENABLE(unsafe-path,
314 [ --enable-unsafe-path allow creating files in an arbitrary path [[default=no]]],
315 [case "${enableval}" in
316 yes) unsafe_path=true;;
317 no) unsafe_path=false;;
318 *) AC_MSG_ERROR(bad value for --enable-unsafe-path) ;;
319 esac], unsafe_path=false)
320 AC_SUBST(unsafe_path)
321
322 if test ${unsafe_path} = true; then
323 AC_DEFINE(WNN_ALLOW_UNSAFE_PATH, 1,
324 [Define to allow writing to other than JSERVERDIR.])
325 fi
326
327 dnl
328 dnl Install layout controlling
329 dnl
330 AC_ARG_ENABLE(traditional-layout,
331 [ --enable-traditional-layout Install files in traditional directories [[default=yes]]],
332 [case "${enableval}" in
333 yes) trad_layout=true ;;
334 no) trad_layout=false ;;
335 *) AC_MSG_ERROR([bad value for --enable-traditional-layout]) ;;
336 esac], trad_layout=true)
337
338 if test $trad_layout = "true"; then
339 WNNSBINDIR="\$(bindir)"
340 # More path settings will come later ...
341 else
342 WNNSBINDIR="\$(sbindir)"
343 # Same as above.
344 fi
345 AC_SUBST(WNNSBINDIR)
346 dnl Same as above.
347
348 AC_ARG_ENABLE(sub-bindir,
349 [ --enable-sub-bindir Install executables to (ex.) $(bindir)/Wnn4 [[default=yes if --enable-traditional-layout, no otherwise]]],
350 [case "${enableval}" in
351 yes) sub_bindir=true ;;
352 no) sub_bindir=false ;;
353 *) AC_MSG_ERROR([bad value for --enable-sub-bindir]) ;;
354 esac], sub_bindir=guess)
355
356 if test $sub_bindir = "guess"; then
357 if test $trad_layout = "true"; then
358 sub_bindir=true
359 else
360 sub_bindir=false
361 fi
362 fi
363 if test $sub_bindir = "true"; then
364 if_enable_sub_bindir=' '
365 if_disable_sub_bindir='#'
366 else
367 if_enable_sub_bindir='#'
368 if_disable_sub_bindir=' '
369 fi
370 AC_SUBST(if_enable_sub_bindir)
371 AC_SUBST(if_disable_sub_bindir)
372
373 # for debug
374 AC_MSG_CHECKING([if we use traditional layout])
375 if test $trad_layout = "true"; then
376 AC_MSG_RESULT(yes)
377 else
378 AC_MSG_RESULT(no)
379 fi
380
381 AC_MSG_CHECKING([if we install binaries on \$(bindir)/Wnn4 (etc.)])
382 if test $sub_bindir = "true"; then
383 AC_MSG_RESULT(yes)
384 else
385 AC_MSG_RESULT(no)
386 fi
387
388 dnl
389 dnl Checks for cc and cpp.
390 dnl
391 AC_PROG_CC
392
393 dnl System specific options
394 dnl Now that we are using autoconf, CCOPTIONS should be nuked...
395 dnl But please report if your system needs specific settings (CCOPTIONS etc.)
396 case $host in
397 *-*-linux*)
398 CCOPTIONS="-Dlinux -D_GNU_SOURCE -D_POSIX_SOURCE -D_BSD_SOURCE"
399 ;;
400 *-*-*-gnu)
401 # Non-Linux kernel with GNU libc.
402 CCOPTIONS="-D_GNU_SOURCE"
403 ;;
404 *-*-sunos*)
405 if test $GCC = yes; then
406 CCOPTIONS="-Dsun -Dsparc"
407 else
408 CCOPTIONS=""
409 fi
410 ;;
411 *-*-solaris2.*)
412 # Will 'solaris*' be OK?
413 if test $GCC = yes; then
414 CCOPTIONS="-Dsun -D`uname -p` -DSVR4 -DSYSV"
415 else
416 # TODO: need change for sparcv9 / x64 architecture ...
417 CCOPTIONS="-Xc -xF -xcg92 -Dsun -D`uname -p` -DSVR4 -DSYSV"
418 fi
419 ;;
420 *-*-hpux*)
421 if test $GCC = yes; then
422 CCOPTIONS="-Dhpux -DSYSV"
423 else
424 CCOPTIONS="-Ae -Dhpux -DSYSV"
425 fi
426 ;;
427 i[[34567]]86-pc-beos*)
428 CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE"
429 ;;
430 powerpc-*-beos*)
431 CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE"
432 ;;
433 *-*-aix*)
434 CCOPTIONS="-DSYSV"
435 ;;
436 esac
437
438 dnl Checking if we use gcc or not
439 if test $debug = true; then
440 if test $GCC = yes; then
441 # FIXME: gcc -fstack-check doesn't work well on Linux/i386 ...
442 CDEBUGFLAGS=${CDEBUGFLAGS:-"-g2 -O2 -Wall"}
443 else
444 CDEBUGFLAGS=${CDEBUGFLAGS:-""}
445 fi
446 INSTPGMFLAGS=
447 else
448 CDEBUGFLAGS=${CDEBUGFLAGS:-""}
449 INSTPGMFLAGS="-s"
450 fi
451 AC_SUBST(CCOPTIONS)
452 AC_SUBST(CDEBUGFLAGS)
453 AC_SUBST(INSTPGMFLAGS)
454
455 echo "Set CDEBUGFLAGS and CCOPTIONS to following:"
456 echo ' CDEBUGFLAGS="'"$CDEBUGFLAGS"'"'
457 echo ' CCOPTIONS="'"$CCOPTIONS"'"'
458
459 dnl ��������������������������������configure������������CPP������������
460 dnl ������������������������������������CPP������������������������
461 dnl ��CPP=${CPP:-"/usr/ccs/lib/cpp"}������������������������������������
462 dnl ����������������
463 AC_PROG_CPP
464
465 dnl Define cpp for text processing.
466 AC_MSG_CHECKING([cpp for text processing])
467 if test "$GCC" = "yes" -a "$CPP" = "$CC -E"; then
468 # Need checking your gcc accepts '-traditional-cpp' option?
469 FZK_PP=${FZK_PP:-"$CPP -traditional-cpp"}
470 else
471 FZK_PP=${FZK_PP:-"$CPP"}
472 fi
473 AC_MSG_RESULT($FZK_PP)
474 AC_SUBST(FZK_PP)
475
476 dnl
477 dnl Checks for programs.
478 dnl
479 dnl ### AC_PROG_YACC
480 dnl ### AC_PROG_LEX
481 AC_PROG_INSTALL
482 AC_PROG_LN_S
483 AC_PROG_MAKE_SET
484 AC_PROG_LIBTOOL
485 AC_SUBST(LIBTOOL_DEPS)
486
487 # Libtool-2.4 needs more powerful shell (other than /bin/sh),
488 # so we explicitly use this SHELL directly.
489 LIBTOOL_MOD=`echo $LIBTOOL | sed 's,\$(SHELL),'${SHELL}','`
490 AC_SUBST(LIBTOOL_MOD)
491
492 dnl Checks for libraries.
493 dnl ### dnl Replace `main' with a function in -lX11:
494 dnl ### AC_CHECK_LIB(X11, main)
495
496 AC_SEARCH_LIBS(crypt, crypt)
497 AC_CHECK_LIB(socket, connect)
498 AC_CHECK_LIB(bind, getservbyname)
499 AC_SEARCH_LIBS(gethostbyname, nsl)
500 dnl libutil only needed by uum with openpty... (determine later)
501 AC_CHECK_LIB(util, openpty, [HAVE_LIBUTIL='have_libutil'])
502
503 dnl
504 dnl Checks for header files.
505 dnl
506 dnl disabled for now ...: dnl AC_PATH_X
507 AC_HEADER_STDC
508 AC_HEADER_SYS_WAIT
509 AC_HEADER_TIME
510 AC_CHECK_HEADERS(fcntl.h syslog.h unistd.h utmp.h utmpx.h \
511 sys/file.h sys/ioctl.h sys/time.h sys/types.h sys/param.h \
512 malloc.h strings.h memory.h \
513 curses.h ncurses.h sgtty.h term.h termio.h termios.h \
514 termcap.h sys/termio.h libutil.h\
515 )
516
517 dnl
518 dnl Terminal library selection.
519 dnl ported from vim6.1 via canuum (Canna 3.6p3) for uum.
520 dnl FIXME: cross compilation
521 dnl
522 olibs="$LIBS"
523 CNVFILE_SUBDIR=bsd
524 AC_MSG_CHECKING(--with-term-libs argument)
525 AC_ARG_WITH(tlib,
526 [ --with-term-libs=-lLIB terminal library to be used ],)
527 if test -n "$with_term_libs"; then
528 AC_MSG_RESULT($with_term_libs)
529 dnl LIBS="$LIBS $with_term_libs"
530 TERMLIB=$with_term_libs
531 else
532 AC_MSG_RESULT([automatic terminal library selection])
533 dnl On HP-UX 10.10 termcap or termlib should be used instead of
534 dnl curses, because curses is much slower.
535 dnl Newer versions of ncurses are preferred over anything.
536 dnl Older versions of ncurses have bugs, get a new one!
537 dnl Digital Unix (OSF1) should use curses (Ronald Schild).
538 case "`uname -s 2>/dev/null`" in
539 OSF1) tlibs="ncurses curses termlib termcap";;
540 *) tlibs="ncurses termlib termcap curses";;
541 esac
542 for libname in $tlibs; do
543 AC_CHECK_LIB(${libname}, tgetent, [
544 dnl It's possible that a library is found but it doesn't work
545 dnl e.g., shared library that cannot be found.
546 dnl compile and run a test program to be sure
547 LIBS="${LIBS} -l${libname}"
548 AC_TRY_RUN([
549 #ifdef HAVE_TERMCAP_H
550 # include <termcap.h>
551 #endif
552 main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }],
553 res="OK", res="FAIL", res="FAIL")
554 if test "$res" = "OK"; then
555 TERMLIB="${TERMLIB} -l${libname}"
556 dnl lname=`echo ${libname} | sed 'y/termcaplibnus/TERMCAPLIBNUS/'`
557 dnl AC_DEFINE_UNQUOTED(HAVE_${lname}, 1, [use ${libname} for terminal control])
558 dnl We need to define AH_TEMPLATE (if we really need this)
559 dnl ex. AH_TEMPLATE(HAVE_NCURSES, [use ncurses for terminal control])
560 break
561 fi
562 AC_MSG_RESULT($libname library is not usable)
563 ],)
564 LIBS=${olibs}
565 done
566 fi
567 if test "x$TERMLIB" != "x"; then
568 LIBS="${LIBS} ${TERMLIB}"
569 AC_MSG_CHECKING(whether we talk terminfo)
570 AC_TRY_RUN([
571 #ifdef HAVE_TERMCAP_H
572 # include <termcap.h>
573 #endif
574 main()
575 {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }],
576 [ AC_MSG_RESULT([no -- we are in termcap land])
577 CNVFILE_SUBDIR=bsd ],
578 [ AC_DEFINE(HAVE_TERMINFO, 1, [terminfo spoken here])
579 AC_MSG_RESULT([yes -- terminfo spoken here])
580 CNVFILE_SUBDIR=sysV ],
581 AC_MSG_ERROR(failed to compile test program.))
582 else
583 AC_MSG_RESULT(none found)
584 fi
585 LIBS=${olibs}
586 AC_SUBST(TERMLIB)
587 AC_SUBST(CNVFILE_SUBDIR)
588
589 dnl
590 dnl Checks for typedefs, structures, and compiler characteristics.
591 dnl
592 AC_TYPE_MODE_T
593 AC_HEADER_TIME
594
595 dnl AC_CHECK_TYPES(time_t,,
596 dnl AC_DEFINE(time_t, long, [Define missing time_t.]),
597 dnl [INCLUDES = time.h])
598 AC_CHECK_TYPES(socklen_t,,
599 AC_DEFINE(socklen_t, int, [Define missing socklen_t.]), [
600 #if HAVE_SYS_TYPES_H
601 # include <sys/types.h>
602 #endif
603 #include <sys/socket.h>])
604
605 AC_CHECK_MEMBERS([struct utmp.ut_user, struct utmp.ut_name, struct utmp.ut_id],,,[
606 #include <sys/types.h>
607 #if HAVE_UTMPX_H
608 # include <utmpx.h>
609 #endif
610 #if HAVE_UTMP_H
611 # include <utmp.h>
612 #endif])
613
614 dnl
615 dnl Checks for symbol
616 dnl
617
618 dnl
619 dnl Checks for library functions.
620 dnl
621 AC_PROG_GCC_TRADITIONAL
622
623 dnl idea borrowed from EB Library http://www.sra.co.jp/people/m-kasahr/eb/
624 AC_TYPE_SIGNAL
625 if test "$ac_cv_type_signal" = void; then
626 AC_DEFINE(RETSIGTYPE_VOID, 1, [Define if the signal function returns void.])
627 fi
628
629 AC_FUNC_MEMCMP
630 AC_CHECK_FUNCS(getpgid getpgrp setpgrp wait3)
631 AC_FUNC_GETPGRP
632 AC_FUNC_SETPGRP
633 dnl FreeWnn do not use the 3rd parameter of wait3().
634 dnl AC_FUNC_WAIT3
635
636 olibs="$LIBS"
637 if test "x$HAVE_LIBUTIL" = "xhave_libutil"; then
638 # openpty needs libutil in AC_CHECK_FUNCS, so add temporally
639 LIBS="$LIBS -lutil"
640 fi
641
642 dnl NOTE: FD_SET is defined as macro on many systems. But this check
643 dnl will be done in Wnn/include/wnn_os.h , so don't care...
644 AC_CHECK_FUNCS(random drand48 fchmod getopt killpg \
645 FD_SET \
646 gethostname select socket closesocket setsockopt send recv \
647 getdtablesize getrlimit syslog vsyslog setenv snprintf \
648 ptsname posix_openpt openpty pututxline pututline setsid)
649 dnl for bcopy/index -> memcpy/strchr conversion (preparation):
650 AC_CHECK_FUNCS(bcopy bzero bcmp index rindex \
651 memcpy memmove memset strchr strrchr)
652 LIBS="${olibs}"
653
654 dnl Check fallback functions for jserver (should use AC_REPLACE_FUNCS?)
655 JS_SUPPORTOBJS=
656 AC_CHECK_FUNCS(mkdir vasprintf, ,
657 [JS_SUPPORTOBJS="${JS_SUPPORTOBJS} ${ac_func}.o"])
658 AC_SUBST(JS_SUPPORTOBJS)
659
660 dnl delayed check for --enable-client-utmp
661 if test $client = true; then
662 if test $client_utmp = auto; then
663 AC_EGREP_CPP(yes, [
664 #if HAVE_SYS_PARAM_H
665 # include <sys/param.h>
666 #endif
667 #if defined(BSD) && (BSD >= 199306) && !defined(HAVE_PUTUTXLINE) && !defined(HAVE_PUTUTLINE)
668 yes
669 #endif
670 ], client_utmp=false, client_utmp=true)
671 fi
672
673 dnl for Debug
674 AC_MSG_CHECKING([whether we're using utmp with uum])
675 if test $client_utmp = true; then
676 dnl We need to look again if we introduce libspt check
677 AC_DEFINE(USE_UTMP, 1, [Define to 1 if uum writes utmp entry])
678 AC_MSG_RESULT(yes)
679 else
680 AC_MSG_RESULT(no)
681 fi
682 fi
683
684 dnl delayed check whether we use libutil or not
685 dnl Environment that has ptsname & openpty should use ptsname and
686 dnl libutil is not needed.
687 if test $client = true; then
688 AC_CHECK_FUNCS([ptsname], [HAVE_PTSNAME='have_ptsname'])
689 AC_MSG_CHECKING([whether we use libutil for uum])
690 case "x$HAVE_PTSNAME$HAVE_LIBUTIL" in
691 # 'xhave_ptsnamehave_libutil') ;;
692 # 'xhave_ptsname') ;;
693 'xhave_libutil')
694 AC_MSG_RESULT(yes)
695 UUM_LIBS="$UUM_LIBS -lutil" ;;
696 # 'x') ;;
697 *)
698 AC_MSG_RESULT(no)
699 ;;
700 esac
701 AC_SUBST(UUM_LIBS)
702 fi
703
704 dnl delayed check for --enable-client-set[ug]id
705 if test $client = true; then
706 guess_setuid=
707 guess_setgid=false
708 dnl Note: (HAVE_OPENPTY && defined(TIOCPTMGET)): for recent OpenBSD
709 if test $client_utmp = true; then
710 AC_EGREP_CPP(yes, [
711 #if HAVE_SYS_IOCTL_H
712 # include <sys/ioctl.h>
713 #endif
714 #if HAVE_PTSNAME || (HAVE_OPENPTY && defined(TIOCPTMGET))
715 # if HAVE_PUTUTLINE || HAVE_PUTUTXLINE
716 yes
717 # endif
718 #endif
719 ], [
720 case $host_os in
721 linux*)
722 # On recent Linux, it has both ptsname() and putut*line().
723 # But putut*line() will take effect only if prog is installed
724 # with set-gid to group utmp.
725 guess_setgid=true
726 UUMGROUP=${UUMGROUP:-utmp}
727 ;;
728 esac
729 guess_setuid=false
730 ], guess_setuid=true)
731 else
732 # $client_utmp != true
733 AC_EGREP_CPP(yes, [
734 #if HAVE_SYS_IOCTL_H
735 # include <sys/ioctl.h>
736 #endif
737 #if HAVE_PTSNAME || (HAVE_OPENPTY && defined(TIOCPTMGET))
738 yes
739 #endif
740 ], guess_setuid=false, guess_setuid=true)
741 fi
742 # $client_utmp != true
743
744 if test $client_setuid = auto; then
745 client_setuid=$guess_setuid
746 # UUMOWNER is already set ...
747 fi
748 if test $client_setgid = auto; then
749 client_setgid=$guess_setgid
750 # UUMGROUP is already set (if it needs)
751 fi
752
753 dnl set install flag (at last)
754 if test $client_setuid = true; then
755 INSTUUMFLAGS="-o \$(UUMOWNER)"
756 if test $client_setgid = true; then
757 INSTUUMFLAGS="-m 6711 $INSTUUMFLAGS -g \$(UUMGROUP)"
758 else
759 # client_setuid && !client_setgid
760 INSTUUMFLAGS="-m 4711 $INSTUUMFLAGS"
761 fi
762 else
763 if test $client_setgid = true; then
764 # !client_setuid && client_setgid
765 INSTUUMFLAGS="-m 2711 -g \$(UUMGROUP)"
766 else
767 # !client_setuid && !client_setgid
768 INSTUUMFLAGS="-m 0711"
769 fi
770 fi
771
772 dnl for Debug
773 AC_MSG_CHECKING([whether we need to install uum as setuid program])
774 if test $client_setuid = true; then
775 AC_MSG_RESULT([yes, $UUMOWNER])
776 else
777 AC_MSG_RESULT(no)
778 fi
779 AC_MSG_CHECKING([whether we need to install uum as setgid program])
780 if test $client_setgid = true; then
781 AC_MSG_RESULT([yes, $UUMGROUP])
782 else
783 AC_MSG_RESULT(no)
784 fi
785 else
786 # $client != true
787 INSTUUMFLAGS="-m 4711 -o \$(UUMOWNER)"
788 fi
789 # $client = true
790
791 AC_SUBST(INSTUUMFLAGS)
792 AC_SUBST(UUMOWNER)
793 AC_SUBST(UUMGROUP)
794
795 dnl
796 dnl File Existence
797 dnl Checking file at compile time may bring false result when cross-
798 dnl compiling. So, one have to check generated config.h and edit it
799 dnl if necessary after running configure.
800 dnl
801 dnl AC_CHECK_FILE(/dev/ptmx, AC_DEFINE(HAVE_DEV_PTMX, 1, [/dev/ptmx found]),)
802 AC_CHECK_FILES(/dev/ptmx,,)
803
804
805 dnl
806 dnl FIXME: libspt support
807 dnl for example:
808 dnl
809 dnl --with-libspt[=/path/to/libspt-config]
810 dnl
811 dnl LIBSPT_CFLAGS=`/path/to/libspt-config --cflags`
812 dnl LIBSPT_LIBS=`/path/to/libspt-config --libs`
813 dnl AC_SUBST(LIBSPT_CFLAGS)
814 dnl AC_SUBST(LIBSPT_LIBS)
815 dnl AC_DEFINE(HAVE_LIBSPT, 1, [Define if you have libspt support.])
816
817 dnl
818 dnl TCP Wrapper.
819 dnl
820 WRAPLIB=
821 AC_MSG_CHECKING(whether to use libwrap)
822 AC_ARG_WITH(libwrap,
823 [ --with-libwrap[[=DIR]] Compile in libwrap (tcp_wrappers) support [[default=try to find libwrap]]],
824 [ case "$withval" in
825 no)
826 AC_MSG_RESULT(no)
827 WRAP_TRY=no
828 ;;
829 yes)
830 AC_MSG_RESULT(yes)
831 WRAP_TRY=yes
832 ;;
833 *)
834 AC_MSG_RESULT(yes)
835 WRAP_TRY=yes
836 if test -d "$withval"; then
837 WRAPINCLUDES="-I$withval"
838 if test -d $withval/include; then
839 WRAPINCLUDES="-I$withval/include $WRAPINCLUDES"
840 fi
841 WRAPLIB="-L$withval -lwrap"
842 if test -d $withval/lib; then
843 WRAPLIB="-L$withval/lib $WRAPLIB"
844 fi
845 else
846 WRAPINCLUDES="$withval"
847 fi
848 ;;
849 esac],
850 [AC_MSG_RESULT([try to find])
851 WRAP_TRY=auto]
852 )
853 # Link test for libwrap
854 if test "$WRAP_TRY" = yes -o "$WRAP_TRY" = auto; then
855 OLDCFLAGS="$CFLAGS"
856 CFLAGS="$WRAPINCLUDES $CFLAGS"
857 OLDLIBS="$LIBS"
858 WRAPLIB=${WRAPLIB:-"-lwrap"}
859 LIBS="$WRAPLIB $OLDLIBS"
860 AC_MSG_CHECKING([libwrap is working])
861 AC_TRY_LINK([ int allow_severity; int deny_severity; ],
862 [ hosts_access(); ],
863 [ AC_MSG_RESULT(yes)
864 AC_DEFINE(HAVE_LIBWRAP, 1,
865 [Define if you have libwrap (TCP wrapper) support.])
866 AC_SUBST(WRAPLIB)],
867 [ AC_MSG_RESULT(no)
868 if test "$WRAP_TRY" = yes; then
869 AC_MSG_ERROR([Could not find libwrap. Please check config.log.])
870 else
871 # recover old flag / clear needless WRAPLIB and continue
872 CFLAGS=$OLDCFLAGS
873 WRAPLIB=
874 fi] )
875 # only jserver needs libwrap, recover LIBS also
876 LIBS=$OLDLIBS
877 fi
878
879
880 dnl
881 dnl Creating Makefiles.
882 dnl
883 # mkdir -p Contrib/dic/gerodic in case builddir != srcdir
884 dir=Contrib/dic/gerodic
885 if test ! -d $dir; then
886 echo "creating $dir ..."
887 $ac_install_sh -d $dir
888 fi
889
890 dnl
891 dnl Generate Makefiles
892 dnl
893
894 dnl Generic
895
896 makefiles_generic="makerule.mk Makefile"
897
898 dnl Japanese
899
900 if test "x${Wnn}" = "xWnn"; then
901 makefiles_wnn="Wnn/Makefile Wnn/conv/Makefile Wnn/include/Makefile \
902 Wnn/jd/Makefile Wnn/jd/rk/Makefile Wnn/jd/rk.vi/Makefile \
903 Wnn/jlib/Makefile Wnn/jlib.V3/Makefile Wnn/jserver/Makefile \
904 Wnn/jutil/Makefile Wnn/ld/Makefile Wnn/ld/rk/Makefile \
905 Wnn/romkan/Makefile Wnn/uum/Makefile \
906 Wnn/man/Makefile Wnn/man/2.env/Makefile Wnn/man/3.libwnn/Makefile \
907 Wnn/man/4.cmd/Makefile Wnn/man/6.jutil/Makefile \
908 Wnn/man/2.env/dic/Makefile Wnn/man/2.env/wnn/Makefile \
909 Wnn/man/3.libwnn/jl_lib/Makefile Wnn/man/3.libwnn/js_lib/Makefile \
910 Wnn/man/3.libwnn/misc_lib/Makefile Wnn/man/3.libwnn/rk_lib/Makefile"
911 makefiles_wnn_dic="Contrib/dic/gerodic/Makefile Wnn/pubdicplus/Makefile \
912 Wnn/wnncons/Makefile Wnn/wnncons/dic/Makefile"
913 fi
914
915 dnl Chinese and Taiwanese
916
917 if test "x$cWnn" = "xcWnn"; then
918 makefiles_cwnn="cWnn/Makefile cWnn/conv/Makefile cWnn/etc/Makefile \
919 cWnn/cd/Makefile cWnn/cd/rk/Makefile \
920 cWnn/cd/rk_p/Makefile cWnn/cd/rk_z/Makefile \
921 cWnn/td/Makefile cWnn/td/rk/Makefile \
922 cWnn/td/rk_z/Makefile cWnn/td/rk_p/Makefile \
923 cWnn/include/Makefile cWnn/jlib/Makefile \
924 cWnn/jserver/Makefile cWnn/jutil/Makefile \
925 cWnn/man/Makefile cWnn/man/1.intro/Makefile cWnn/man/2.env/Makefile \
926 cWnn/man/4.cmd/Makefile cWnn/man/6.jutil/Makefile \
927 cWnn/romkan/Makefile cWnn/uum/Makefile"
928 makefiles_cwnn_dic="cWnn/cdic/Makefile cWnn/tdic/Makefile"
929 fi
930
931 dnl Korean
932
933 if test "x$kWnn" = "xkWnn"; then
934 makefiles_kwnn="kWnn/Makefile kWnn/conv/Makefile kWnn/etc/Makefile \
935 kWnn/include/Makefile kWnn/jlib/Makefile kWnn/jutil/Makefile \
936 kWnn/jserver/Makefile kWnn/kd/Makefile kWnn/kd/rk/Makefile \
937 kWnn/romkan/Makefile kWnn/uum/Makefile"
938 makefiles_kwnn_dic="kWnn/kdic/Makefile"
939 fi
940
941 AC_OUTPUT(${makefiles_generic} \
942 ${makefiles_wnn} ${makefiles_wnn_dic} \
943 ${makefiles_cwnn} ${makefiles_cwnn_dic} \
944 ${makefiles_kwnn} ${makefiles_kwnn_dic})

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