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.50 - (hide annotations) (download)
Mon Feb 22 17:06:54 2010 UTC (14 years, 1 month ago) by aonoto
Branch: MAIN
Changes since 1.49: +16 -13 lines
Recent cpp of gcc (at least 4.4) splits line that has many characters
per line (in C language manner). This is problem on *.fzk (pubdic etc.)
file processing. So adds -traditional-cpp parameter to cpp (at least
gcc-2.95 passes this parameter). Simply adding it to CPPFLAGS may break
other build, so split FZK_PP (cpp for text processing) from normal CPP.
Spotted by some posters of FreeWnn thread in 2ch.net .

(Other changes)
- Use AC_SEARCH_LIBS for libnsl checking (Linux (for example) does not
  need it).
- Strip old mail address (as usual).
- Modified to build correctly if builddir != srcdir (as usual).

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

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