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.44 - (hide annotations) (download)
Tue Mar 7 17:15:33 2006 UTC (18 years, 1 month ago) by aonoto
Branch: MAIN
Changes since 1.43: +6 -3 lines
Modified WNNCNVFILEDIR to install correct cnv_* file
if you're in terminfo environment.

1 ura 1.1 dnl
2 aonoto 1.44 dnl $Id: configure.in,v 1.43 2006/03/04 19:01:45 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 aonoto 1.44 [ AC_MSG_RESULT([no -- we are in termcap land])
444     CNVFILE_SUBDIR=bsd ],
445 aonoto 1.43 [ AC_DEFINE(HAVE_TERMINFO, 1, [terminfo spoken here])
446 aonoto 1.44 AC_MSG_RESULT([yes -- terminfo spoken here])
447     CNVFILE_SUBDIR=sysV ],
448 aonoto 1.43 AC_MSG_ERROR(failed to compile test program.))
449     else
450     AC_MSG_RESULT(none found)
451     fi
452     LIBS=${olibs}
453     AC_SUBST(TERMLIB)
454 aonoto 1.44 AC_SUBST(CNVFILE_SUBDIR)
455 aonoto 1.43
456    
457     dnl
458 ura 1.1 dnl Checks for typedefs, structures, and compiler characteristics.
459     dnl
460     AC_TYPE_MODE_T
461     AC_HEADER_TIME
462 ura 1.13
463 aono 1.38 dnl AC_CHECK_TYPES(time_t,,
464 hiroo 1.37 dnl AC_DEFINE(time_t, long, [Define missing time_t.]),
465     dnl [INCLUDES = time.h])
466 aono 1.38 AC_CHECK_TYPES(socklen_t,,
467 aono 1.39 AC_DEFINE(socklen_t, int, [Define missing socklen_t.]), [
468     #if HAVE_SYS_TYPES_H
469     # include <sys/types.h>
470     #endif
471     #include <sys/socket.h>])
472 ura 1.10
473     dnl
474     dnl Checks for symbol
475     dnl
476    
477 ura 1.1 dnl
478     dnl Checks for library functions.
479     dnl
480     AC_PROG_GCC_TRADITIONAL
481 hiroo 1.28
482     dnl idea borrowed from EB Library http://www.sra.co.jp/people/m-kasahr/eb/
483     AC_TYPE_SIGNAL
484     if test "$ac_cv_type_signal" = void; then
485     AC_DEFINE(RETSIGTYPE_VOID, 1, [Define if the signal function returns void.])
486     fi
487    
488 ura 1.1 AC_FUNC_MEMCMP
489 hiroo 1.37 AC_CHECK_FUNCS(getpgid getpgrp setpgrp wait3)
490     AC_FUNC_GETPGRP
491 hiroo 1.22 AC_FUNC_SETPGRP
492 hiroo 1.28 dnl FreeWnn do not use the 3rd parameter of wait3().
493     dnl AC_FUNC_WAIT3
494    
495 aonoto 1.43 dnl NOTE: FD_SET is defined as macro on many systems. But this check
496     dnl will be done in Wnn/include/wnn_os.h , so don't care...
497 hiroo 1.37 AC_CHECK_FUNCS(random drand48 fchmod getopt killpg \
498     FD_SET \
499 hiroo 1.28 gethostname select socket closesocket setsockopt send recv \
500 aonoto 1.43 getdtablesize getrlimit syslog vsyslog setenv snprintf \
501     ptsname openpty)
502 aono 1.20 dnl for bcopy/index -> memcpy/strchr conversion (preparation):
503 hiroo 1.28 AC_CHECK_FUNCS(bcopy bzero bcmp index rindex \
504     memcpy memmove memset strchr strrchr)
505 ura 1.1
506 aono 1.20 dnl Check fallback functions for jserver (should use AC_REPLACE_FUNCS?)
507     JS_SUPPORTOBJS=
508     AC_CHECK_FUNCS(mkdir vasprintf, ,
509 hiroo 1.28 [JS_SUPPORTOBJS="${JS_SUPPORTOBJS} ${ac_func}.o"])
510 aono 1.20 AC_SUBST(JS_SUPPORTOBJS)
511 hiroo 1.37
512    
513     dnl
514 aonoto 1.43 dnl File Existence
515     dnl Checking file at compile time may bring false result when cross-
516     dnl compiling. So, one have to check generated config.h and edit it
517     dnl if necessary after running configure.
518     dnl
519     dnl AC_CHECK_FILE(/dev/ptmx, AC_DEFINE(HAVE_DEV_PTMX, 1, [/dev/ptmx found]),)
520     AC_CHECK_FILES(/dev/ptmx,,)
521    
522    
523     dnl
524     dnl FIXME: libspt support
525     dnl for example:
526     dnl
527     dnl --with-libspt[=/path/to/libspt-config]
528     dnl
529     dnl LIBSPT_CFLAGS=`/path/to/libspt-config --cflags`
530     dnl LIBSPT_LIBS=`/path/to/libspt-config --libs`
531     dnl AC_SUBST(LIBSPT_CFLAGS)
532     dnl AC_SUBST(LIBSPT_LIBS)
533     dnl AC_DEFINE(HAVE_LIBSPT, 1, [Define if you have libspt support.])
534    
535     dnl
536 hiroo 1.37 dnl TCP Wrapper.
537     dnl
538 aono 1.41 WRAPLIB=
539 hiroo 1.37 AC_MSG_CHECKING(whether to use libwrap)
540     AC_ARG_WITH(libwrap,
541 aono 1.41 [ --with-libwrap[[=DIR]] Compile in libwrap (tcp_wrappers) support [[default=try to find libwrap]]],
542 hiroo 1.37 [ case "$withval" in
543     no)
544     AC_MSG_RESULT(no)
545 aono 1.41 WRAP_TRY=no
546 hiroo 1.37 ;;
547     yes)
548     AC_MSG_RESULT(yes)
549 aono 1.41 WRAP_TRY=yes
550 hiroo 1.37 ;;
551     *)
552     AC_MSG_RESULT(yes)
553 aono 1.41 WRAP_TRY=yes
554 hiroo 1.37 if test -d "$withval"; then
555     WRAPINCLUDES="-I$withval"
556 aono 1.41 if test -d $withval/include; then
557     WRAPINCLUDES="-I$withval/include $WRAPINCLUDES"
558     fi
559     WRAPLIB="-L$withval -lwrap"
560     if test -d $withval/lib; then
561     WRAPLIB="-L$withval/lib $WRAPLIB"
562     fi
563 hiroo 1.37 else
564     WRAPINCLUDES="$withval"
565     fi
566     ;;
567 aonoto 1.42 esac],
568 aono 1.41 [AC_MSG_RESULT([try to find])
569     WRAP_TRY=auto]
570 hiroo 1.37 )
571 aono 1.41 # Link test for libwrap
572     if test "$WRAP_TRY" = yes -o "$WRAP_TRY" = auto; then
573     OLDCFLAGS="$CFLAGS"
574     CFLAGS="$WRAPINCLUDES $CFLAGS"
575     OLDLIBS="$LIBS"
576     WRAPLIB=${WRAPLIB:-"-lwrap"}
577     LIBS="$WRAPLIB $OLDLIBS"
578     AC_MSG_CHECKING([libwrap is working])
579     AC_TRY_LINK([ int allow_severity; int deny_severity; ],
580     [ hosts_access(); ],
581     [ AC_MSG_RESULT(yes)
582     AC_DEFINE(HAVE_LIBWRAP, 1,
583     [Define if you have libwrap (TCP wrapper) support.])
584     AC_SUBST(WRAPLIB)],
585     [ AC_MSG_RESULT(no)
586     if test "$WRAP_TRY" = yes; then
587     AC_MSG_ERROR([Could not find libwrap. Please check config.log.])
588     else
589     # recover old flag / clear needless WRAPLIB and continue
590     CFLAGS=$OLDCFLAGS
591     WRAPLIB=
592     fi] )
593     # only jserver needs libwrap, recover LIBS also
594     LIBS=$OLDLIBS
595     fi
596 aono 1.20
597 ura 1.5
598     dnl
599 ura 1.1 dnl Creating Makefiles.
600     dnl
601 aono 1.20 # mkdir -p Contrib/dic/gerodic in case builddir != srcdir
602 aono 1.41 dir=Contrib/dic/gerodic
603 aonoto 1.42 if test ! -d $dir; then
604     echo "creating $dir ..."
605 aono 1.41 $ac_install_sh -d $dir
606 aonoto 1.42 fi
607 aono 1.20
608 hiroo 1.28 dnl
609     dnl Generate Makefiles
610     dnl
611    
612     dnl Generic
613    
614     makefiles_generic="makerule.mk Makefile"
615    
616     dnl Japanese
617    
618     if test "x${Wnn}" = "xWnn"; then
619     makefiles_wnn="Wnn/Makefile Wnn/conv/Makefile Wnn/include/Makefile \
620     Wnn/jd/Makefile Wnn/jd/rk/Makefile Wnn/jd/rk.vi/Makefile \
621     Wnn/jlib/Makefile Wnn/jlib.V3/Makefile Wnn/jserver/Makefile \
622     Wnn/jutil/Makefile Wnn/ld/Makefile Wnn/ld/rk/Makefile \
623     Wnn/romkan/Makefile Wnn/uum/Makefile \
624     Wnn/man/Makefile Wnn/man/2.env/Makefile Wnn/man/3.libwnn/Makefile \
625     Wnn/man/4.cmd/Makefile Wnn/man/6.jutil/Makefile \
626     Wnn/man/2.env/dic/Makefile Wnn/man/2.env/wnn/Makefile \
627     Wnn/man/3.libwnn/jl_lib/Makefile Wnn/man/3.libwnn/js_lib/Makefile \
628     Wnn/man/3.libwnn/misc_lib/Makefile Wnn/man/3.libwnn/rk_lib/Makefile"
629     makefiles_wnn_dic="Contrib/dic/gerodic/Makefile Wnn/pubdicplus/Makefile \
630     Wnn/wnncons/Makefile Wnn/wnncons/dic/Makefile"
631     fi
632    
633     dnl Chinese and Taiwanese
634    
635 aono 1.20 if test "x$cWnn" = "xcWnn"; then
636 hiroo 1.28 makefiles_cwnn="cWnn/Makefile cWnn/conv/Makefile cWnn/etc/Makefile \
637     cWnn/cd/Makefile cWnn/cd/rk/Makefile \
638     cWnn/cd/rk_p/Makefile cWnn/cd/rk_z/Makefile \
639     cWnn/td/Makefile cWnn/td/rk/Makefile \
640     cWnn/td/rk_z/Makefile cWnn/td/rk_p/Makefile \
641     cWnn/include/Makefile cWnn/jlib/Makefile \
642     cWnn/jserver/Makefile cWnn/jutil/Makefile \
643     cWnn/man/Makefile cWnn/man/1.intro/Makefile cWnn/man/2.env/Makefile \
644     cWnn/man/4.cmd/Makefile cWnn/man/6.jutil/Makefile \
645     cWnn/romkan/Makefile cWnn/uum/Makefile"
646     makefiles_cwnn_dic="cWnn/cdic/Makefile cWnn/tdic/Makefile"
647     fi
648    
649     dnl Korean
650    
651     if test "x$kWnn" = "xkWnn"; then
652     makefiles_kwnn="kWnn/Makefile kWnn/conv/Makefile kWnn/etc/Makefile \
653     kWnn/include/Makefile kWnn/jlib/Makefile kWnn/jutil/Makefile \
654     kWnn/jserver/Makefile kWnn/kd/Makefile kWnn/kd/rk/Makefile \
655     kWnn/romkan/Makefile kWnn/uum/Makefile"
656     makefiles_kwnn_dic="kWnn/kdic/Makefile"
657 aono 1.20 fi
658    
659 hiroo 1.28 AC_OUTPUT(${makefiles_generic} \
660     ${makefiles_wnn} ${makefiles_wnn_dic} \
661     ${makefiles_cwnn} ${makefiles_cwnn_dic} \
662     ${makefiles_kwnn} ${makefiles_kwnn_dic})

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