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.53 - (hide annotations) (download)
Fri Dec 31 14:40:51 2010 UTC (13 years, 3 months ago) by aonoto
Branch: MAIN
Changes since 1.52: +2 -4 lines
We cannot build Xwnmo for now, so we (temporally) disabled AC_PATH_X.
Probably workaround for systems with modern install layout of X11.

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

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