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.43 - (show annotations) (download)
Sat Mar 4 19:01:45 2006 UTC (18 years, 1 month ago) by aonoto
Branch: MAIN
Changes since 1.42: +103 -3 lines
Long awaited merge of uum-related patch (based on hiroo's work
in November, 2003)

- Detect termcap / terminfo, curses etc. automatically (from canuum)
  But, configure support of libspt does not implemented / does not
  include Canna support / utmp implementation does not work correctly.
- pty / pts processing (from Kabe). Auto detection in configure by hiroo.
- Some modification due to build error in my environment.
- (As usual) stripping old address / adding lines in case
  if builddir != srcdir .

Many thanks to AIDA shinra, Taketo Kabe @ SRA Tohoku, hiroo,
kouji at hiroshima-u.ac.jp (original author of Kabe's patch).

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

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