Develop and Download Open Source Software

Browse CVS Repository

Annotation of /freewnn/FreeWnn/configure.in

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


Revision 1.48 - (hide annotations) (download)
Mon Sep 25 17:31:35 2006 UTC (17 years, 6 months ago) by aonoto
Branch: MAIN
Changes since 1.47: +7 -8 lines
Use posix_openpt() (if it and ptsname() exists) when opening tty.
Traditional pts system (that doesn't have posix_openpt()) fallback to
dummy function opening /dev/ptmx directly. Getting tty without setting
setuid root works in non-pts systems that have posix-compatible
pty functions (ex. recent FreeBSD).

Other changes to configure.in:
- Remove (already commented out) default case in system specific part.
- Commented out useless AC_DEFINE in term library detection part.

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

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