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.50 - (show annotations) (download)
Mon Feb 22 17:06:54 2010 UTC (14 years, 1 month ago) by aonoto
Branch: MAIN
Changes since 1.49: +16 -13 lines
Recent cpp of gcc (at least 4.4) splits line that has many characters
per line (in C language manner). This is problem on *.fzk (pubdic etc.)
file processing. So adds -traditional-cpp parameter to cpp (at least
gcc-2.95 passes this parameter). Simply adding it to CPPFLAGS may break
other build, so split FZK_PP (cpp for text processing) from normal CPP.
Spotted by some posters of FreeWnn thread in 2ch.net .

(Other changes)
- Use AC_SEARCH_LIBS for libnsl checking (Linux (for example) does not
  need it).
- Strip old mail address (as usual).
- Modified to build correctly if builddir != srcdir (as usual).

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

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