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.43 - (hide 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 ura 1.1 dnl
2 aonoto 1.43 dnl $Id: configure.in,v 1.42 2005/11/27 17:30:23 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     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 hiroo 1.17 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 ura 1.15
101     AC_SUBST(SUBDIRS)
102     AC_SUBST(WNNMANDIR)
103    
104     dnl For Severs
105    
106     AC_ARG_ENABLE(Wnn,
107 aono 1.40 [ --enable-Wnn build and install Wnn [[default=yes]]],
108 ura 1.15 [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 hiroo 1.16 # JSERVER_SUBDIRS1="\$(JSERVER_SUBDIRS1)"
117 ura 1.15 JSERVER_SUBDIRS2="\$(JSERVER_SUBDIRS2)"
118     else
119 hiroo 1.16 # JSERVER_SUBDIRS1=""
120 ura 1.15 JSERVER_SUBDIRS2=""
121     fi
122 hiroo 1.16 dnl AC_SUBST(JSERVER_SUBDIRS1)
123 ura 1.15 AC_SUBST(JSERVER_SUBDIRS2)
124    
125     AC_ARG_ENABLE(cWnn,
126 aono 1.40 [ --enable-cWnn build and install cWnn [[default=yes]]],
127 ura 1.15 [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 aono 1.40 [ --enable-kWnn build and install kWnn [[default=yes]]],
136 ura 1.15 [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 aono 1.40 [ --with-libwnn use installed Wnn library [[default=no]]],
155 ura 1.15 [ with_libwnn="${withval}"
156     AC_ARG_WITH(wnn-includes,
157 aono 1.40 [ --with-wnn-includes=DIR WNN include files are in DIR],
158 ura 1.15 [wnnincludedir="-I${withval}"], [wnnincludedir=''])
159     AC_ARG_WITH(wnn-libraries,
160 aono 1.40 [ --with-wnn-libraries=DIR Search for WNN libraries in DIR [[default=/usr/local/lib]]],
161 ura 1.15 [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 aonoto 1.42 [ WNNJLIB="\$(top_builddir)/Wnn/jlib/libwnn.la"
173 ura 1.15 DEPWNNJLIB="\$(WNNJLIB)"
174 aonoto 1.42 HINSI_DATA="\$(top_builddir)/Wnn/jd/hinsi.data"
175 ura 1.15 ])
176     AC_SUBST(WNNJLIB)
177     AC_SUBST(DEPWNNJLIB)
178     AC_SUBST(HINSI_DATA)
179    
180     AC_ARG_WITH(libcwnn,
181 aono 1.40 [ --with-libcwnn use installed cWnn library [[default=no]]],
182 ura 1.15 [
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 aono 1.40 [ --with-cwnn-libraries=DIR Search for CWNN libraries in DIR [[default=/usr/local/lib]]],
188 ura 1.15 [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 aonoto 1.42 [ CWNNJLIB="\$(top_builddir)/cWnn/jlib/libcwnn.la"
201 ura 1.15 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 aono 1.40 [ --with-libkwnn use installed kWnn library [[default=no]]],
212 ura 1.15 [
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 aono 1.40 [ --with-kwnn-libraries=DIR Search for KWNN libraries in DIR [[default=/usr/local/lib]]],
218 ura 1.15 [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 aonoto 1.42 [ KWNNJLIB="\$(top_builddir)/kWnn/jlib/libkwnn.la"
230 ura 1.15 DEPKWNNJLIB="\$(KWNNJLIB)"
231     KHINSI_DATA="\$(KWNNKDSRC)/hinsi.data"
232     ])
233     AC_SUBST(KWNNJLIB)
234     AC_SUBST(DEPKWNNJLIB)
235     AC_SUBST(KHINSI_DATA)
236 ura 1.5
237 hiroo 1.21 dnl
238     dnl Build Options
239     dnl
240    
241 hiroo 1.17 AC_ARG_ENABLE(ipv6,
242 aono 1.40 [ --enable-ipv6 build and install IPv6 [[default=no]]],
243 hiroo 1.16 [case "${enableval}" in
244 hiroo 1.17 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 aono 1.40 [ --enable-unsafe-path allow creating files in an arbitrary path [[default=no]]],
252 hiroo 1.17 [case "${enableval}" in
253 hiroo 1.19 yes) unsafe_path=true;;
254     no) unsafe_path=false;;
255 hiroo 1.17 *) 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 hiroo 1.34 AC_DEFINE(WNN_ALLOW_UNSAFE_PATH, 1,
261     [Define to allow writing to other than JSERVERDIR.])
262 hiroo 1.17 fi
263 hiroo 1.16
264 ura 1.5 dnl
265 ura 1.1 dnl Checks for cc and cpp.
266     dnl
267     AC_PROG_CC
268 hiroo 1.16
269 hiroo 1.33 dnl System specific options
270     dnl Now that we are using autoconf, CCOPTIONS should be nuked...
271 hiroo 1.16 case $host in
272     *-*-linux*)
273 aonoto 1.42 CCOPTIONS="-Dlinux -D_GNU_SOURCE -D_POSIX_SOURCE -D_BSD_SOURCE"
274 ura 1.1 ;;
275 hiroo 1.34 *-*-darwin*)
276 aono 1.41 if test $GCC = yes; then
277 aonoto 1.42 # 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 aono 1.41 # 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 hiroo 1.34 ;;
285 hiroo 1.16 *-*-sunos*)
286 hiroo 1.19 if test $GCC = yes; then
287 ura 1.2 CCOPTIONS="-Dsun -Dsparc"
288     else
289 hiroo 1.17 CCOPTIONS=""
290 ura 1.2 fi
291     ;;
292 hiroo 1.16 *-*-solaris2.*)
293     # Will 'solaris*' be OK?
294 hiroo 1.19 if test $GCC = yes; then
295 hiroo 1.17 CCOPTIONS="-Dsun -D`uname -p` -DSVR4 -DSYSV"
296 ura 1.2 else
297 hiroo 1.17 CCOPTIONS="-Xc -xF -xcg92 -Dsun -D`uname -p` -DSVR4 -DSYSV"
298 ura 1.2 fi
299 ura 1.4 ;;
300 hiroo 1.16 *-*-hpux*)
301 hiroo 1.19 if test $GCC = yes; then
302 ura 1.4 CCOPTIONS="-Dhpux -DSYSV"
303     else
304     CCOPTIONS="-Ae -Dhpux -DSYSV"
305     fi
306 ura 1.2 ;;
307 hiroo 1.16 i[[34567]]86-pc-beos*)
308 hiroo 1.17 CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE"
309 ura 1.5 ;;
310 hiroo 1.16 powerpc-*-beos*)
311 hiroo 1.17 CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE"
312 ura 1.5 ;;
313 hiroo 1.16 *-*-aix*)
314 ura 1.6 CCOPTIONS="-DSYSV"
315     ;;
316 ura 1.1 *)
317 hiroo 1.33 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 ura 1.1 ;;
320     esac
321 hiroo 1.19
322     dnl Checking if we use gcc or not
323     if test $debug = true; then
324     if test $GCC = yes; then
325 hiroo 1.33 CDEBUGFLAGS=${CDEBUGFLAGS:-"-g2 -O2 -Wall -fstack-check"}
326     else
327     CDEBUGFLAGS=${CDEBUGFLAGS:-""}
328 hiroo 1.19 fi
329 hiroo 1.28 INSTPGMFLAGS=
330 hiroo 1.17 else
331 aono 1.38 CDEBUGFLAGS=${CDEBUGFLAGS:-""}
332 hiroo 1.28 INSTPGMFLAGS="-s"
333 hiroo 1.17 fi
334 hiroo 1.33 AC_SUBST(CCOPTIONS)
335     AC_SUBST(CDEBUGFLAGS)
336 hiroo 1.17 AC_SUBST(INSTPGMFLAGS)
337 hiroo 1.16
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 ura 1.1 AC_PROG_CPP
347    
348     dnl
349     dnl Checks for programs.
350     dnl
351 ura 1.7 dnl ### AC_PROG_YACC
352     dnl ### AC_PROG_LEX
353 ura 1.5 AC_PROG_INSTALL
354 ura 1.1 AC_PROG_LN_S
355     AC_PROG_MAKE_SET
356 hiroo 1.16 AC_PROG_LIBTOOL
357     AC_SUBST(LIBTOOL_DEPS)
358 ura 1.1
359     dnl Checks for libraries.
360 ura 1.7 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 ura 1.1
365 aonoto 1.42 AC_SEARCH_LIBS(crypt, crypt)
366 ura 1.9 AC_CHECK_LIB(socket, connect)
367 h-abe 1.27 AC_CHECK_LIB(bind, getservbyname)
368 ura 1.9 AC_CHECK_LIB(nsl, gethostbyname)
369 aonoto 1.43 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 ura 1.1
373     dnl
374     dnl Checks for header files.
375     dnl
376     AC_PATH_X
377     AC_HEADER_STDC
378     AC_HEADER_SYS_WAIT
379 hiroo 1.32 AC_HEADER_TIME
380 hiroo 1.37 AC_CHECK_HEADERS(fcntl.h syslog.h unistd.h utmp.h utmpx.h \
381 hiroo 1.28 sys/file.h sys/ioctl.h sys/time.h sys/types.h sys/param.h \
382     malloc.h strings.h memory.h \
383 hiroo 1.35 curses.h ncurses.h sgtty.h term.h termio.h termios.h \
384 aonoto 1.43 termcap.h sys/termio.h libutil.h\
385 hiroo 1.28 )
386 ura 1.1
387     dnl
388 aonoto 1.43 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 ura 1.1 dnl Checks for typedefs, structures, and compiler characteristics.
456     dnl
457     AC_TYPE_MODE_T
458     AC_HEADER_TIME
459 ura 1.13
460 aono 1.38 dnl AC_CHECK_TYPES(time_t,,
461 hiroo 1.37 dnl AC_DEFINE(time_t, long, [Define missing time_t.]),
462     dnl [INCLUDES = time.h])
463 aono 1.38 AC_CHECK_TYPES(socklen_t,,
464 aono 1.39 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 ura 1.10
470     dnl
471     dnl Checks for symbol
472     dnl
473    
474 ura 1.1 dnl
475     dnl Checks for library functions.
476     dnl
477     AC_PROG_GCC_TRADITIONAL
478 hiroo 1.28
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 ura 1.1 AC_FUNC_MEMCMP
486 hiroo 1.37 AC_CHECK_FUNCS(getpgid getpgrp setpgrp wait3)
487     AC_FUNC_GETPGRP
488 hiroo 1.22 AC_FUNC_SETPGRP
489 hiroo 1.28 dnl FreeWnn do not use the 3rd parameter of wait3().
490     dnl AC_FUNC_WAIT3
491    
492 aonoto 1.43 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 hiroo 1.37 AC_CHECK_FUNCS(random drand48 fchmod getopt killpg \
495     FD_SET \
496 hiroo 1.28 gethostname select socket closesocket setsockopt send recv \
497 aonoto 1.43 getdtablesize getrlimit syslog vsyslog setenv snprintf \
498     ptsname openpty)
499 aono 1.20 dnl for bcopy/index -> memcpy/strchr conversion (preparation):
500 hiroo 1.28 AC_CHECK_FUNCS(bcopy bzero bcmp index rindex \
501     memcpy memmove memset strchr strrchr)
502 ura 1.1
503 aono 1.20 dnl Check fallback functions for jserver (should use AC_REPLACE_FUNCS?)
504     JS_SUPPORTOBJS=
505     AC_CHECK_FUNCS(mkdir vasprintf, ,
506 hiroo 1.28 [JS_SUPPORTOBJS="${JS_SUPPORTOBJS} ${ac_func}.o"])
507 aono 1.20 AC_SUBST(JS_SUPPORTOBJS)
508 hiroo 1.37
509    
510     dnl
511 aonoto 1.43 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 hiroo 1.37 dnl TCP Wrapper.
534     dnl
535 aono 1.41 WRAPLIB=
536 hiroo 1.37 AC_MSG_CHECKING(whether to use libwrap)
537     AC_ARG_WITH(libwrap,
538 aono 1.41 [ --with-libwrap[[=DIR]] Compile in libwrap (tcp_wrappers) support [[default=try to find libwrap]]],
539 hiroo 1.37 [ case "$withval" in
540     no)
541     AC_MSG_RESULT(no)
542 aono 1.41 WRAP_TRY=no
543 hiroo 1.37 ;;
544     yes)
545     AC_MSG_RESULT(yes)
546 aono 1.41 WRAP_TRY=yes
547 hiroo 1.37 ;;
548     *)
549     AC_MSG_RESULT(yes)
550 aono 1.41 WRAP_TRY=yes
551 hiroo 1.37 if test -d "$withval"; then
552     WRAPINCLUDES="-I$withval"
553 aono 1.41 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 hiroo 1.37 else
561     WRAPINCLUDES="$withval"
562     fi
563     ;;
564 aonoto 1.42 esac],
565 aono 1.41 [AC_MSG_RESULT([try to find])
566     WRAP_TRY=auto]
567 hiroo 1.37 )
568 aono 1.41 # 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 aono 1.20
594 ura 1.5
595     dnl
596 ura 1.1 dnl Creating Makefiles.
597     dnl
598 aono 1.20 # mkdir -p Contrib/dic/gerodic in case builddir != srcdir
599 aono 1.41 dir=Contrib/dic/gerodic
600 aonoto 1.42 if test ! -d $dir; then
601     echo "creating $dir ..."
602 aono 1.41 $ac_install_sh -d $dir
603 aonoto 1.42 fi
604 aono 1.20
605 hiroo 1.28 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 aono 1.20 if test "x$cWnn" = "xcWnn"; then
633 hiroo 1.28 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 aono 1.20 fi
655    
656 hiroo 1.28 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