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.46 - (hide annotations) (download)
Sun Jul 23 17:30:33 2006 UTC (17 years, 8 months ago) by aonoto
Branch: MAIN
Changes since 1.45: +2 -2 lines
More utmp fix:

- Fix build (more) correctly on recent NetBSD (that both have utmpx &
  traditional utmp)
- Moved setutmp() call from child to parent process (not sure if this is
  right thing)

1 ura 1.1 dnl
2 aonoto 1.46 dnl $Id: configure.in,v 1.45 2006/06/18 16:49:41 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 hiroo 1.16 case $host in
282     *-*-linux*)
283 aonoto 1.42 CCOPTIONS="-Dlinux -D_GNU_SOURCE -D_POSIX_SOURCE -D_BSD_SOURCE"
284 ura 1.1 ;;
285 hiroo 1.34 *-*-darwin*)
286 aono 1.41 if test $GCC = yes; then
287 aonoto 1.42 # Unfortunately, autoconf (at least 2.57) does not recognize
288     # proper CPP. (Normal cpp-precomp nor auto-retrying in basic mode does
289     # not work with pubdic+ processing.) So define here ....
290 aono 1.41 # Note: It seems gcc-3.3 (or (probably) later) does not need this.
291     CPP=${CPP:-"$CC -E -no-cpp-precomp"}
292     fi
293     # Don't care other CC-s.
294 hiroo 1.34 ;;
295 hiroo 1.16 *-*-sunos*)
296 hiroo 1.19 if test $GCC = yes; then
297 ura 1.2 CCOPTIONS="-Dsun -Dsparc"
298     else
299 hiroo 1.17 CCOPTIONS=""
300 ura 1.2 fi
301     ;;
302 hiroo 1.16 *-*-solaris2.*)
303     # Will 'solaris*' be OK?
304 hiroo 1.19 if test $GCC = yes; then
305 hiroo 1.17 CCOPTIONS="-Dsun -D`uname -p` -DSVR4 -DSYSV"
306 ura 1.2 else
307 hiroo 1.17 CCOPTIONS="-Xc -xF -xcg92 -Dsun -D`uname -p` -DSVR4 -DSYSV"
308 ura 1.2 fi
309 ura 1.4 ;;
310 hiroo 1.16 *-*-hpux*)
311 hiroo 1.19 if test $GCC = yes; then
312 ura 1.4 CCOPTIONS="-Dhpux -DSYSV"
313     else
314     CCOPTIONS="-Ae -Dhpux -DSYSV"
315     fi
316 ura 1.2 ;;
317 hiroo 1.16 i[[34567]]86-pc-beos*)
318 hiroo 1.17 CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE"
319 ura 1.5 ;;
320 hiroo 1.16 powerpc-*-beos*)
321 hiroo 1.17 CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE"
322 ura 1.5 ;;
323 hiroo 1.16 *-*-aix*)
324 ura 1.6 CCOPTIONS="-DSYSV"
325     ;;
326 ura 1.1 *)
327 hiroo 1.33 dnl AC_MSG_WARN("It is not reported if FreeWnn works on this system. But continuing...")
328     dnl AC_MSG_WARN([(It may or may not work if you set CCOPTIONS properly.)])
329 ura 1.1 ;;
330     esac
331 hiroo 1.19
332     dnl Checking if we use gcc or not
333     if test $debug = true; then
334     if test $GCC = yes; then
335 aonoto 1.45 # FIXME: gcc -fstack-check doesn't work well on Linux/i386 ...
336     CDEBUGFLAGS=${CDEBUGFLAGS:-"-g2 -O2 -Wall"}
337 hiroo 1.33 else
338     CDEBUGFLAGS=${CDEBUGFLAGS:-""}
339 hiroo 1.19 fi
340 hiroo 1.28 INSTPGMFLAGS=
341 hiroo 1.17 else
342 aono 1.38 CDEBUGFLAGS=${CDEBUGFLAGS:-""}
343 hiroo 1.28 INSTPGMFLAGS="-s"
344 hiroo 1.17 fi
345 hiroo 1.33 AC_SUBST(CCOPTIONS)
346     AC_SUBST(CDEBUGFLAGS)
347 hiroo 1.17 AC_SUBST(INSTPGMFLAGS)
348 hiroo 1.16
349     echo "Set CDEBUGFLAGS and CCOPTIONS to following:"
350     echo ' CDEBUGFLAGS="'"$CDEBUGFLAGS"'"'
351     echo ' CCOPTIONS="'"$CCOPTIONS"'"'
352    
353     dnl ��������������������������������configure������������CPP������������
354     dnl ������������������������������������CPP������������������������
355     dnl ��CPP=${CPP:-"/usr/ccs/lib/cpp"}������������������������������������
356     dnl ����������������
357 ura 1.1 AC_PROG_CPP
358    
359     dnl
360     dnl Checks for programs.
361     dnl
362 ura 1.7 dnl ### AC_PROG_YACC
363     dnl ### AC_PROG_LEX
364 ura 1.5 AC_PROG_INSTALL
365 ura 1.1 AC_PROG_LN_S
366     AC_PROG_MAKE_SET
367 hiroo 1.16 AC_PROG_LIBTOOL
368     AC_SUBST(LIBTOOL_DEPS)
369 ura 1.1
370     dnl Checks for libraries.
371 ura 1.7 dnl ### dnl Replace `main' with a function in -lX11:
372     dnl ### AC_CHECK_LIB(X11, main)
373     dnl ### dnl Replace `main' with a function in -lcurses:
374     dnl ### AC_CHECK_LIB(curses, main)
375 ura 1.1
376 aonoto 1.42 AC_SEARCH_LIBS(crypt, crypt)
377 ura 1.9 AC_CHECK_LIB(socket, connect)
378 h-abe 1.27 AC_CHECK_LIB(bind, getservbyname)
379 ura 1.9 AC_CHECK_LIB(nsl, gethostbyname)
380 aonoto 1.43 dnl libutil only needed by uum w/openpty...
381     dnl FIXME: deals with Linux that have both ptsname & openpty
382     AC_CHECK_LIB(util, openpty)
383 ura 1.1
384     dnl
385     dnl Checks for header files.
386     dnl
387     AC_PATH_X
388     AC_HEADER_STDC
389     AC_HEADER_SYS_WAIT
390 hiroo 1.32 AC_HEADER_TIME
391 hiroo 1.37 AC_CHECK_HEADERS(fcntl.h syslog.h unistd.h utmp.h utmpx.h \
392 hiroo 1.28 sys/file.h sys/ioctl.h sys/time.h sys/types.h sys/param.h \
393     malloc.h strings.h memory.h \
394 hiroo 1.35 curses.h ncurses.h sgtty.h term.h termio.h termios.h \
395 aonoto 1.43 termcap.h sys/termio.h libutil.h\
396 hiroo 1.28 )
397 ura 1.1
398     dnl
399 aonoto 1.43 dnl Terminal library selection.
400     dnl ported from vim6.1 via canuum (Canna 3.6p3) for uum.
401     dnl FIXME: cross compilation
402     dnl
403     olibs="$LIBS"
404 aonoto 1.45 CNVFILE_SUBDIR=bsd
405 aonoto 1.43 AC_MSG_CHECKING(--with-term-libs argument)
406     AC_ARG_WITH(tlib,
407     [ --with-term-libs=-lLIB terminal library to be used ],)
408     if test -n "$with_term_libs"; then
409     AC_MSG_RESULT($with_term_libs)
410     dnl LIBS="$LIBS $with_term_libs"
411     TERMLIB=$with_term_libs
412     else
413     AC_MSG_RESULT([automatic terminal library selection])
414     dnl On HP-UX 10.10 termcap or termlib should be used instead of
415     dnl curses, because curses is much slower.
416     dnl Newer versions of ncurses are preferred over anything.
417     dnl Older versions of ncurses have bugs, get a new one!
418     dnl Digital Unix (OSF1) should use curses (Ronald Schild).
419     case "`uname -s 2>/dev/null`" in
420     OSF1) tlibs="ncurses curses termlib termcap";;
421     *) tlibs="ncurses termlib termcap curses";;
422     esac
423     for libname in $tlibs; do
424     AC_CHECK_LIB(${libname}, tgetent, [
425     dnl It's possible that a library is found but it doesn't work
426     dnl e.g., shared library that cannot be found.
427     dnl compile and run a test program to be sure
428     LIBS="${LIBS} -l${libname}"
429     AC_TRY_RUN([
430     #ifdef HAVE_TERMCAP_H
431     # include <termcap.h>
432     #endif
433     main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }],
434     res="OK", res="FAIL", res="FAIL")
435     if test "$res" = "OK"; then
436     TERMLIB="${TERMLIB} -l${libname}"
437     lname=translit(${libname}, 'a-z', 'A-Z')
438     AC_DEFINE(HAVE_${lname}, 1, [use ${libname} for terminal control])
439     break
440     fi
441     AC_MSG_RESULT($libname library is not usable)
442     ],)
443     LIBS=${olibs}
444     done
445     fi
446     if test "x$TERMLIB" != "x"; then
447     LIBS="${LIBS} ${TERMLIB}"
448     AC_MSG_CHECKING(whether we talk terminfo)
449     AC_TRY_RUN([
450     #ifdef HAVE_TERMCAP_H
451     # include <termcap.h>
452     #endif
453     main()
454     {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }],
455 aonoto 1.44 [ AC_MSG_RESULT([no -- we are in termcap land])
456     CNVFILE_SUBDIR=bsd ],
457 aonoto 1.43 [ AC_DEFINE(HAVE_TERMINFO, 1, [terminfo spoken here])
458 aonoto 1.44 AC_MSG_RESULT([yes -- terminfo spoken here])
459     CNVFILE_SUBDIR=sysV ],
460 aonoto 1.43 AC_MSG_ERROR(failed to compile test program.))
461     else
462     AC_MSG_RESULT(none found)
463     fi
464     LIBS=${olibs}
465     AC_SUBST(TERMLIB)
466 aonoto 1.44 AC_SUBST(CNVFILE_SUBDIR)
467 aonoto 1.43
468 aonoto 1.45 dnl delayed check for --enable-client-utmp
469     if test $client = true; then
470     if test $client_utmp = auto; then
471     AC_EGREP_CPP(yes, [
472     #if HAVE_SYS_PARAM_H
473     # include <sys/param.h>
474     #endif
475     #if defined(BSD) && (BSD >= 199306)
476     yes
477     #endif
478     ], client_utmp=false, client_utmp=true)
479     fi
480    
481     dnl for Debug
482     AC_MSG_CHECKING([whether we're using utmp with uum])
483     if test $client_utmp = true; then
484     dnl We need to look again if we introduce libspt check
485     AC_DEFINE(USE_UTMP, 1, [Define to 1 if uum writes utmp entry])
486     AC_MSG_RESULT(yes)
487     else
488     AC_MSG_RESULT(no)
489     fi
490     fi
491 aonoto 1.43
492     dnl
493 ura 1.1 dnl Checks for typedefs, structures, and compiler characteristics.
494     dnl
495     AC_TYPE_MODE_T
496     AC_HEADER_TIME
497 ura 1.13
498 aono 1.38 dnl AC_CHECK_TYPES(time_t,,
499 hiroo 1.37 dnl AC_DEFINE(time_t, long, [Define missing time_t.]),
500     dnl [INCLUDES = time.h])
501 aono 1.38 AC_CHECK_TYPES(socklen_t,,
502 aono 1.39 AC_DEFINE(socklen_t, int, [Define missing socklen_t.]), [
503     #if HAVE_SYS_TYPES_H
504     # include <sys/types.h>
505     #endif
506     #include <sys/socket.h>])
507 ura 1.10
508 aonoto 1.46 AC_CHECK_MEMBERS([struct utmp.ut_user, struct utmp.ut_name, struct utmp.ut_id],,,[
509 aonoto 1.45 #include <sys/types.h>
510     #if HAVE_UTMPX_H
511     # include <utmpx.h>
512     #endif
513     #if HAVE_UTMP_H
514     # include <utmp.h>
515     #endif])
516    
517 ura 1.10 dnl
518     dnl Checks for symbol
519     dnl
520    
521 ura 1.1 dnl
522     dnl Checks for library functions.
523     dnl
524     AC_PROG_GCC_TRADITIONAL
525 hiroo 1.28
526     dnl idea borrowed from EB Library http://www.sra.co.jp/people/m-kasahr/eb/
527     AC_TYPE_SIGNAL
528     if test "$ac_cv_type_signal" = void; then
529     AC_DEFINE(RETSIGTYPE_VOID, 1, [Define if the signal function returns void.])
530     fi
531    
532 ura 1.1 AC_FUNC_MEMCMP
533 hiroo 1.37 AC_CHECK_FUNCS(getpgid getpgrp setpgrp wait3)
534     AC_FUNC_GETPGRP
535 hiroo 1.22 AC_FUNC_SETPGRP
536 hiroo 1.28 dnl FreeWnn do not use the 3rd parameter of wait3().
537     dnl AC_FUNC_WAIT3
538    
539 aonoto 1.43 dnl NOTE: FD_SET is defined as macro on many systems. But this check
540     dnl will be done in Wnn/include/wnn_os.h , so don't care...
541 hiroo 1.37 AC_CHECK_FUNCS(random drand48 fchmod getopt killpg \
542     FD_SET \
543 hiroo 1.28 gethostname select socket closesocket setsockopt send recv \
544 aonoto 1.43 getdtablesize getrlimit syslog vsyslog setenv snprintf \
545 aonoto 1.45 ptsname openpty pututxline pututline)
546 aono 1.20 dnl for bcopy/index -> memcpy/strchr conversion (preparation):
547 hiroo 1.28 AC_CHECK_FUNCS(bcopy bzero bcmp index rindex \
548     memcpy memmove memset strchr strrchr)
549 ura 1.1
550 aono 1.20 dnl Check fallback functions for jserver (should use AC_REPLACE_FUNCS?)
551     JS_SUPPORTOBJS=
552     AC_CHECK_FUNCS(mkdir vasprintf, ,
553 hiroo 1.28 [JS_SUPPORTOBJS="${JS_SUPPORTOBJS} ${ac_func}.o"])
554 aono 1.20 AC_SUBST(JS_SUPPORTOBJS)
555 hiroo 1.37
556    
557     dnl
558 aonoto 1.43 dnl File Existence
559     dnl Checking file at compile time may bring false result when cross-
560     dnl compiling. So, one have to check generated config.h and edit it
561     dnl if necessary after running configure.
562     dnl
563     dnl AC_CHECK_FILE(/dev/ptmx, AC_DEFINE(HAVE_DEV_PTMX, 1, [/dev/ptmx found]),)
564     AC_CHECK_FILES(/dev/ptmx,,)
565    
566    
567     dnl
568     dnl FIXME: libspt support
569     dnl for example:
570     dnl
571     dnl --with-libspt[=/path/to/libspt-config]
572     dnl
573     dnl LIBSPT_CFLAGS=`/path/to/libspt-config --cflags`
574     dnl LIBSPT_LIBS=`/path/to/libspt-config --libs`
575     dnl AC_SUBST(LIBSPT_CFLAGS)
576     dnl AC_SUBST(LIBSPT_LIBS)
577     dnl AC_DEFINE(HAVE_LIBSPT, 1, [Define if you have libspt support.])
578    
579     dnl
580 hiroo 1.37 dnl TCP Wrapper.
581     dnl
582 aono 1.41 WRAPLIB=
583 hiroo 1.37 AC_MSG_CHECKING(whether to use libwrap)
584     AC_ARG_WITH(libwrap,
585 aono 1.41 [ --with-libwrap[[=DIR]] Compile in libwrap (tcp_wrappers) support [[default=try to find libwrap]]],
586 hiroo 1.37 [ case "$withval" in
587     no)
588     AC_MSG_RESULT(no)
589 aono 1.41 WRAP_TRY=no
590 hiroo 1.37 ;;
591     yes)
592     AC_MSG_RESULT(yes)
593 aono 1.41 WRAP_TRY=yes
594 hiroo 1.37 ;;
595     *)
596     AC_MSG_RESULT(yes)
597 aono 1.41 WRAP_TRY=yes
598 hiroo 1.37 if test -d "$withval"; then
599     WRAPINCLUDES="-I$withval"
600 aono 1.41 if test -d $withval/include; then
601     WRAPINCLUDES="-I$withval/include $WRAPINCLUDES"
602     fi
603     WRAPLIB="-L$withval -lwrap"
604     if test -d $withval/lib; then
605     WRAPLIB="-L$withval/lib $WRAPLIB"
606     fi
607 hiroo 1.37 else
608     WRAPINCLUDES="$withval"
609     fi
610     ;;
611 aonoto 1.42 esac],
612 aono 1.41 [AC_MSG_RESULT([try to find])
613     WRAP_TRY=auto]
614 hiroo 1.37 )
615 aono 1.41 # Link test for libwrap
616     if test "$WRAP_TRY" = yes -o "$WRAP_TRY" = auto; then
617     OLDCFLAGS="$CFLAGS"
618     CFLAGS="$WRAPINCLUDES $CFLAGS"
619     OLDLIBS="$LIBS"
620     WRAPLIB=${WRAPLIB:-"-lwrap"}
621     LIBS="$WRAPLIB $OLDLIBS"
622     AC_MSG_CHECKING([libwrap is working])
623     AC_TRY_LINK([ int allow_severity; int deny_severity; ],
624     [ hosts_access(); ],
625     [ AC_MSG_RESULT(yes)
626     AC_DEFINE(HAVE_LIBWRAP, 1,
627     [Define if you have libwrap (TCP wrapper) support.])
628     AC_SUBST(WRAPLIB)],
629     [ AC_MSG_RESULT(no)
630     if test "$WRAP_TRY" = yes; then
631     AC_MSG_ERROR([Could not find libwrap. Please check config.log.])
632     else
633     # recover old flag / clear needless WRAPLIB and continue
634     CFLAGS=$OLDCFLAGS
635     WRAPLIB=
636     fi] )
637     # only jserver needs libwrap, recover LIBS also
638     LIBS=$OLDLIBS
639     fi
640 aono 1.20
641 ura 1.5
642     dnl
643 ura 1.1 dnl Creating Makefiles.
644     dnl
645 aono 1.20 # mkdir -p Contrib/dic/gerodic in case builddir != srcdir
646 aono 1.41 dir=Contrib/dic/gerodic
647 aonoto 1.42 if test ! -d $dir; then
648     echo "creating $dir ..."
649 aono 1.41 $ac_install_sh -d $dir
650 aonoto 1.42 fi
651 aono 1.20
652 hiroo 1.28 dnl
653     dnl Generate Makefiles
654     dnl
655    
656     dnl Generic
657    
658     makefiles_generic="makerule.mk Makefile"
659    
660     dnl Japanese
661    
662     if test "x${Wnn}" = "xWnn"; then
663     makefiles_wnn="Wnn/Makefile Wnn/conv/Makefile Wnn/include/Makefile \
664     Wnn/jd/Makefile Wnn/jd/rk/Makefile Wnn/jd/rk.vi/Makefile \
665     Wnn/jlib/Makefile Wnn/jlib.V3/Makefile Wnn/jserver/Makefile \
666     Wnn/jutil/Makefile Wnn/ld/Makefile Wnn/ld/rk/Makefile \
667     Wnn/romkan/Makefile Wnn/uum/Makefile \
668     Wnn/man/Makefile Wnn/man/2.env/Makefile Wnn/man/3.libwnn/Makefile \
669     Wnn/man/4.cmd/Makefile Wnn/man/6.jutil/Makefile \
670     Wnn/man/2.env/dic/Makefile Wnn/man/2.env/wnn/Makefile \
671     Wnn/man/3.libwnn/jl_lib/Makefile Wnn/man/3.libwnn/js_lib/Makefile \
672     Wnn/man/3.libwnn/misc_lib/Makefile Wnn/man/3.libwnn/rk_lib/Makefile"
673     makefiles_wnn_dic="Contrib/dic/gerodic/Makefile Wnn/pubdicplus/Makefile \
674     Wnn/wnncons/Makefile Wnn/wnncons/dic/Makefile"
675     fi
676    
677     dnl Chinese and Taiwanese
678    
679 aono 1.20 if test "x$cWnn" = "xcWnn"; then
680 hiroo 1.28 makefiles_cwnn="cWnn/Makefile cWnn/conv/Makefile cWnn/etc/Makefile \
681     cWnn/cd/Makefile cWnn/cd/rk/Makefile \
682     cWnn/cd/rk_p/Makefile cWnn/cd/rk_z/Makefile \
683     cWnn/td/Makefile cWnn/td/rk/Makefile \
684     cWnn/td/rk_z/Makefile cWnn/td/rk_p/Makefile \
685     cWnn/include/Makefile cWnn/jlib/Makefile \
686     cWnn/jserver/Makefile cWnn/jutil/Makefile \
687     cWnn/man/Makefile cWnn/man/1.intro/Makefile cWnn/man/2.env/Makefile \
688     cWnn/man/4.cmd/Makefile cWnn/man/6.jutil/Makefile \
689     cWnn/romkan/Makefile cWnn/uum/Makefile"
690     makefiles_cwnn_dic="cWnn/cdic/Makefile cWnn/tdic/Makefile"
691     fi
692    
693     dnl Korean
694    
695     if test "x$kWnn" = "xkWnn"; then
696     makefiles_kwnn="kWnn/Makefile kWnn/conv/Makefile kWnn/etc/Makefile \
697     kWnn/include/Makefile kWnn/jlib/Makefile kWnn/jutil/Makefile \
698     kWnn/jserver/Makefile kWnn/kd/Makefile kWnn/kd/rk/Makefile \
699     kWnn/romkan/Makefile kWnn/uum/Makefile"
700     makefiles_kwnn_dic="kWnn/kdic/Makefile"
701 aono 1.20 fi
702    
703 hiroo 1.28 AC_OUTPUT(${makefiles_generic} \
704     ${makefiles_wnn} ${makefiles_wnn_dic} \
705     ${makefiles_cwnn} ${makefiles_cwnn_dic} \
706     ${makefiles_kwnn} ${makefiles_kwnn_dic})

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