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.51 - (hide annotations) (download)
Sun Apr 25 10:38:55 2010 UTC (13 years, 11 months ago) by aonoto
Branch: MAIN
Changes since 1.50: +6 -3 lines
configure.in, configure:
  - Added -D_GNU_SOURCE for architecture with GNU libc and non-Linux kernel
    (especially for Debian). Possible fix for Debian Bug #577097.
  - Cosmetic fix (for configure.in).

config.h.in:
  - Forgot to autoheader on last commit of configure.in.

1 ura 1.1 dnl
2 aonoto 1.51 dnl $Id: configure.in,v 1.50 2010/02/22 17:06:54 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 aonoto 1.51 *-*-*-gnu)
318     # Non-Linux kernel with GNU libc.
319     CCOPTIONS="-D_GNU_SOURCE"
320     ;;
321 hiroo 1.16 *-*-sunos*)
322 hiroo 1.19 if test $GCC = yes; then
323 ura 1.2 CCOPTIONS="-Dsun -Dsparc"
324     else
325 hiroo 1.17 CCOPTIONS=""
326 ura 1.2 fi
327     ;;
328 hiroo 1.16 *-*-solaris2.*)
329     # Will 'solaris*' be OK?
330 hiroo 1.19 if test $GCC = yes; then
331 hiroo 1.17 CCOPTIONS="-Dsun -D`uname -p` -DSVR4 -DSYSV"
332 ura 1.2 else
333 aonoto 1.50 # TODO: need change for sparcv9 / x64 architecture ...
334 hiroo 1.17 CCOPTIONS="-Xc -xF -xcg92 -Dsun -D`uname -p` -DSVR4 -DSYSV"
335 ura 1.2 fi
336 ura 1.4 ;;
337 hiroo 1.16 *-*-hpux*)
338 hiroo 1.19 if test $GCC = yes; then
339 ura 1.4 CCOPTIONS="-Dhpux -DSYSV"
340     else
341     CCOPTIONS="-Ae -Dhpux -DSYSV"
342     fi
343 ura 1.2 ;;
344 hiroo 1.16 i[[34567]]86-pc-beos*)
345 hiroo 1.17 CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE"
346 ura 1.5 ;;
347 hiroo 1.16 powerpc-*-beos*)
348 hiroo 1.17 CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE"
349 ura 1.5 ;;
350 hiroo 1.16 *-*-aix*)
351 ura 1.6 CCOPTIONS="-DSYSV"
352     ;;
353 ura 1.1 esac
354 hiroo 1.19
355     dnl Checking if we use gcc or not
356     if test $debug = true; then
357     if test $GCC = yes; then
358 aonoto 1.45 # FIXME: gcc -fstack-check doesn't work well on Linux/i386 ...
359     CDEBUGFLAGS=${CDEBUGFLAGS:-"-g2 -O2 -Wall"}
360 hiroo 1.33 else
361     CDEBUGFLAGS=${CDEBUGFLAGS:-""}
362 hiroo 1.19 fi
363 hiroo 1.28 INSTPGMFLAGS=
364 hiroo 1.17 else
365 aono 1.38 CDEBUGFLAGS=${CDEBUGFLAGS:-""}
366 hiroo 1.28 INSTPGMFLAGS="-s"
367 hiroo 1.17 fi
368 hiroo 1.33 AC_SUBST(CCOPTIONS)
369     AC_SUBST(CDEBUGFLAGS)
370 hiroo 1.17 AC_SUBST(INSTPGMFLAGS)
371 hiroo 1.16
372     echo "Set CDEBUGFLAGS and CCOPTIONS to following:"
373     echo ' CDEBUGFLAGS="'"$CDEBUGFLAGS"'"'
374     echo ' CCOPTIONS="'"$CCOPTIONS"'"'
375    
376     dnl ��������������������������������configure������������CPP������������
377     dnl ������������������������������������CPP������������������������
378     dnl ��CPP=${CPP:-"/usr/ccs/lib/cpp"}������������������������������������
379     dnl ����������������
380 ura 1.1 AC_PROG_CPP
381    
382 aonoto 1.50 dnl Define cpp for text processing.
383     AC_MSG_CHECKING([cpp for text processing])
384     if test "$GCC" = "yes" -a "$CPP" = "$CC -E"; then
385     # Need checking your gcc accepts '-traditional-cpp' option?
386     FZK_PP=${FZK_PP:-"$CPP -traditional-cpp"}
387     else
388     FZK_PP=${FZK_PP:-"$CPP"}
389     fi
390     AC_MSG_RESULT($FZK_PP)
391     AC_SUBST(FZK_PP)
392    
393 ura 1.1 dnl
394     dnl Checks for programs.
395     dnl
396 ura 1.7 dnl ### AC_PROG_YACC
397     dnl ### AC_PROG_LEX
398 ura 1.5 AC_PROG_INSTALL
399 ura 1.1 AC_PROG_LN_S
400     AC_PROG_MAKE_SET
401 hiroo 1.16 AC_PROG_LIBTOOL
402     AC_SUBST(LIBTOOL_DEPS)
403 ura 1.1
404     dnl Checks for libraries.
405 ura 1.7 dnl ### dnl Replace `main' with a function in -lX11:
406     dnl ### AC_CHECK_LIB(X11, main)
407     dnl ### dnl Replace `main' with a function in -lcurses:
408     dnl ### AC_CHECK_LIB(curses, main)
409 ura 1.1
410 aonoto 1.42 AC_SEARCH_LIBS(crypt, crypt)
411 ura 1.9 AC_CHECK_LIB(socket, connect)
412 h-abe 1.27 AC_CHECK_LIB(bind, getservbyname)
413 aonoto 1.50 AC_SEARCH_LIBS(gethostbyname, nsl)
414 aonoto 1.43 dnl libutil only needed by uum w/openpty...
415     dnl FIXME: deals with Linux that have both ptsname & openpty
416     AC_CHECK_LIB(util, openpty)
417 ura 1.1
418     dnl
419     dnl Checks for header files.
420     dnl
421     AC_PATH_X
422     AC_HEADER_STDC
423     AC_HEADER_SYS_WAIT
424 hiroo 1.32 AC_HEADER_TIME
425 hiroo 1.37 AC_CHECK_HEADERS(fcntl.h syslog.h unistd.h utmp.h utmpx.h \
426 hiroo 1.28 sys/file.h sys/ioctl.h sys/time.h sys/types.h sys/param.h \
427     malloc.h strings.h memory.h \
428 hiroo 1.35 curses.h ncurses.h sgtty.h term.h termio.h termios.h \
429 aonoto 1.43 termcap.h sys/termio.h libutil.h\
430 hiroo 1.28 )
431 ura 1.1
432     dnl
433 aonoto 1.43 dnl Terminal library selection.
434     dnl ported from vim6.1 via canuum (Canna 3.6p3) for uum.
435     dnl FIXME: cross compilation
436     dnl
437     olibs="$LIBS"
438 aonoto 1.45 CNVFILE_SUBDIR=bsd
439 aonoto 1.43 AC_MSG_CHECKING(--with-term-libs argument)
440     AC_ARG_WITH(tlib,
441     [ --with-term-libs=-lLIB terminal library to be used ],)
442     if test -n "$with_term_libs"; then
443     AC_MSG_RESULT($with_term_libs)
444     dnl LIBS="$LIBS $with_term_libs"
445     TERMLIB=$with_term_libs
446     else
447     AC_MSG_RESULT([automatic terminal library selection])
448     dnl On HP-UX 10.10 termcap or termlib should be used instead of
449     dnl curses, because curses is much slower.
450     dnl Newer versions of ncurses are preferred over anything.
451     dnl Older versions of ncurses have bugs, get a new one!
452     dnl Digital Unix (OSF1) should use curses (Ronald Schild).
453     case "`uname -s 2>/dev/null`" in
454     OSF1) tlibs="ncurses curses termlib termcap";;
455     *) tlibs="ncurses termlib termcap curses";;
456     esac
457     for libname in $tlibs; do
458     AC_CHECK_LIB(${libname}, tgetent, [
459     dnl It's possible that a library is found but it doesn't work
460     dnl e.g., shared library that cannot be found.
461     dnl compile and run a test program to be sure
462     LIBS="${LIBS} -l${libname}"
463     AC_TRY_RUN([
464     #ifdef HAVE_TERMCAP_H
465     # include <termcap.h>
466     #endif
467     main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }],
468     res="OK", res="FAIL", res="FAIL")
469     if test "$res" = "OK"; then
470     TERMLIB="${TERMLIB} -l${libname}"
471 aonoto 1.48 dnl lname=`echo ${libname} | sed 'y/termcaplibnus/TERMCAPLIBNUS/'`
472     dnl AC_DEFINE_UNQUOTED(HAVE_${lname}, 1, [use ${libname} for terminal control])
473     dnl We need to define AH_TEMPLATE (if we really need this)
474     dnl ex. AH_TEMPLATE(HAVE_NCURSES, [use ncurses for terminal control])
475 aonoto 1.43 break
476     fi
477     AC_MSG_RESULT($libname library is not usable)
478     ],)
479     LIBS=${olibs}
480     done
481     fi
482     if test "x$TERMLIB" != "x"; then
483     LIBS="${LIBS} ${TERMLIB}"
484     AC_MSG_CHECKING(whether we talk terminfo)
485     AC_TRY_RUN([
486     #ifdef HAVE_TERMCAP_H
487     # include <termcap.h>
488     #endif
489     main()
490     {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }],
491 aonoto 1.44 [ AC_MSG_RESULT([no -- we are in termcap land])
492     CNVFILE_SUBDIR=bsd ],
493 aonoto 1.43 [ AC_DEFINE(HAVE_TERMINFO, 1, [terminfo spoken here])
494 aonoto 1.44 AC_MSG_RESULT([yes -- terminfo spoken here])
495     CNVFILE_SUBDIR=sysV ],
496 aonoto 1.43 AC_MSG_ERROR(failed to compile test program.))
497     else
498     AC_MSG_RESULT(none found)
499     fi
500     LIBS=${olibs}
501     AC_SUBST(TERMLIB)
502 aonoto 1.44 AC_SUBST(CNVFILE_SUBDIR)
503 aonoto 1.43
504 aonoto 1.51 dnl
505 ura 1.1 dnl Checks for typedefs, structures, and compiler characteristics.
506     dnl
507     AC_TYPE_MODE_T
508     AC_HEADER_TIME
509 ura 1.13
510 aono 1.38 dnl AC_CHECK_TYPES(time_t,,
511 hiroo 1.37 dnl AC_DEFINE(time_t, long, [Define missing time_t.]),
512     dnl [INCLUDES = time.h])
513 aono 1.38 AC_CHECK_TYPES(socklen_t,,
514 aono 1.39 AC_DEFINE(socklen_t, int, [Define missing socklen_t.]), [
515     #if HAVE_SYS_TYPES_H
516     # include <sys/types.h>
517     #endif
518     #include <sys/socket.h>])
519 ura 1.10
520 aonoto 1.46 AC_CHECK_MEMBERS([struct utmp.ut_user, struct utmp.ut_name, struct utmp.ut_id],,,[
521 aonoto 1.45 #include <sys/types.h>
522     #if HAVE_UTMPX_H
523     # include <utmpx.h>
524     #endif
525     #if HAVE_UTMP_H
526     # include <utmp.h>
527     #endif])
528    
529 ura 1.10 dnl
530     dnl Checks for symbol
531     dnl
532    
533 ura 1.1 dnl
534     dnl Checks for library functions.
535     dnl
536     AC_PROG_GCC_TRADITIONAL
537 hiroo 1.28
538     dnl idea borrowed from EB Library http://www.sra.co.jp/people/m-kasahr/eb/
539     AC_TYPE_SIGNAL
540     if test "$ac_cv_type_signal" = void; then
541     AC_DEFINE(RETSIGTYPE_VOID, 1, [Define if the signal function returns void.])
542     fi
543    
544 ura 1.1 AC_FUNC_MEMCMP
545 hiroo 1.37 AC_CHECK_FUNCS(getpgid getpgrp setpgrp wait3)
546     AC_FUNC_GETPGRP
547 hiroo 1.22 AC_FUNC_SETPGRP
548 hiroo 1.28 dnl FreeWnn do not use the 3rd parameter of wait3().
549     dnl AC_FUNC_WAIT3
550    
551 aonoto 1.43 dnl NOTE: FD_SET is defined as macro on many systems. But this check
552     dnl will be done in Wnn/include/wnn_os.h , so don't care...
553 hiroo 1.37 AC_CHECK_FUNCS(random drand48 fchmod getopt killpg \
554     FD_SET \
555 hiroo 1.28 gethostname select socket closesocket setsockopt send recv \
556 aonoto 1.43 getdtablesize getrlimit syslog vsyslog setenv snprintf \
557 aonoto 1.48 ptsname posix_openpt openpty pututxline pututline setsid)
558 aono 1.20 dnl for bcopy/index -> memcpy/strchr conversion (preparation):
559 hiroo 1.28 AC_CHECK_FUNCS(bcopy bzero bcmp index rindex \
560     memcpy memmove memset strchr strrchr)
561 ura 1.1
562 aono 1.20 dnl Check fallback functions for jserver (should use AC_REPLACE_FUNCS?)
563     JS_SUPPORTOBJS=
564     AC_CHECK_FUNCS(mkdir vasprintf, ,
565 hiroo 1.28 [JS_SUPPORTOBJS="${JS_SUPPORTOBJS} ${ac_func}.o"])
566 aono 1.20 AC_SUBST(JS_SUPPORTOBJS)
567 hiroo 1.37
568 aonoto 1.49 dnl delayed check for --enable-client-utmp
569     if test $client = true; then
570     if test $client_utmp = auto; then
571     AC_EGREP_CPP(yes, [
572     #if HAVE_SYS_PARAM_H
573     # include <sys/param.h>
574     #endif
575     #if defined(BSD) && (BSD >= 199306) && !defined(HAVE_PUTUTXLINE) && !defined(HAVE_PUTUTLINE)
576     yes
577     #endif
578     ], client_utmp=false, client_utmp=true)
579     fi
580    
581     dnl for Debug
582     AC_MSG_CHECKING([whether we're using utmp with uum])
583     if test $client_utmp = true; then
584     dnl We need to look again if we introduce libspt check
585     AC_DEFINE(USE_UTMP, 1, [Define to 1 if uum writes utmp entry])
586     AC_MSG_RESULT(yes)
587     else
588     AC_MSG_RESULT(no)
589     fi
590     fi
591    
592     dnl delayed check for --enable-client-set[ug]id
593     if test $client = true; then
594     guess_setuid=
595     guess_setgid=false
596     dnl Note: (HAVE_OPENPTY && defined(TIOCPTMGET)): for recent OpenBSD
597     if test $client_utmp = true; then
598     AC_EGREP_CPP(yes, [
599     #if HAVE_SYS_IOCTL_H
600     # include <sys/ioctl.h>
601     #endif
602     #if HAVE_PTSNAME || (HAVE_OPENPTY && defined(TIOCPTMGET))
603     # if HAVE_PUTUTLINE || HAVE_PUTUTXLINE
604     yes
605     # endif
606     #endif
607     ], [
608     case $host_os in
609     linux*)
610     # On recent Linux, it has both ptsname() and putut*line().
611     # But putut*line() will take effect only if prog is installed
612     # with set-gid to group utmp.
613     guess_setgid=true
614     UUMGROUP=${UUMGROUP:-utmp}
615     ;;
616     esac
617     guess_setuid=false
618     ], guess_setuid=true)
619     else
620     # $client_utmp != true
621     AC_EGREP_CPP(yes, [
622     #if HAVE_SYS_IOCTL_H
623     # include <sys/ioctl.h>
624     #endif
625     #if HAVE_PTSNAME || (HAVE_OPENPTY && defined(TIOCPTMGET))
626     yes
627     #endif
628     ], guess_setuid=false, guess_setuid=true)
629     fi
630     # $client_utmp != true
631    
632     if test $client_setuid = auto; then
633     client_setuid=$guess_setuid
634     # UUMOWNER is already set ...
635     fi
636     if test $client_setgid = auto; then
637     client_setgid=$guess_setgid
638     # UUMGROUP is already set (if it needs)
639     fi
640    
641     dnl set install flag (at last)
642     if test $client_setuid = true; then
643     INSTUUMFLAGS="-o \$(UUMOWNER)"
644     if test $client_setgid = true; then
645     INSTUUMFLAGS="-m 6711 $INSTUUMFLAGS -g \$(UUMGROUP)"
646     else
647     # client_setuid && !client_setgid
648     INSTUUMFLAGS="-m 4711 $INSTUUMFLAGS"
649     fi
650     else
651     if test $client_setgid = true; then
652     # !client_setuid && client_setgid
653     INSTUUMFLAGS="-m 2711 -g \$(UUMGROUP)"
654     else
655     # !client_setuid && !client_setgid
656     INSTUUMFLAGS="-m 0711"
657     fi
658     fi
659    
660     dnl for Debug
661     AC_MSG_CHECKING([whether we need to install uum as setuid program])
662     if test $client_setuid = true; then
663     AC_MSG_RESULT([yes, $UUMOWNER])
664     else
665     AC_MSG_RESULT(no)
666     fi
667     AC_MSG_CHECKING([whether we need to install uum as setgid program])
668     if test $client_setgid = true; then
669     AC_MSG_RESULT([yes, $UUMGROUP])
670     else
671     AC_MSG_RESULT(no)
672     fi
673     else
674     # $client != true
675     INSTUUMFLAGS="-m 4711 -o \$(UUMOWNER)"
676     fi
677     # $client = true
678    
679     AC_SUBST(INSTUUMFLAGS)
680     AC_SUBST(UUMOWNER)
681     AC_SUBST(UUMGROUP)
682    
683     dnl
684 aonoto 1.43 dnl File Existence
685     dnl Checking file at compile time may bring false result when cross-
686     dnl compiling. So, one have to check generated config.h and edit it
687     dnl if necessary after running configure.
688     dnl
689     dnl AC_CHECK_FILE(/dev/ptmx, AC_DEFINE(HAVE_DEV_PTMX, 1, [/dev/ptmx found]),)
690     AC_CHECK_FILES(/dev/ptmx,,)
691    
692    
693     dnl
694     dnl FIXME: libspt support
695     dnl for example:
696     dnl
697     dnl --with-libspt[=/path/to/libspt-config]
698     dnl
699     dnl LIBSPT_CFLAGS=`/path/to/libspt-config --cflags`
700     dnl LIBSPT_LIBS=`/path/to/libspt-config --libs`
701     dnl AC_SUBST(LIBSPT_CFLAGS)
702     dnl AC_SUBST(LIBSPT_LIBS)
703     dnl AC_DEFINE(HAVE_LIBSPT, 1, [Define if you have libspt support.])
704    
705     dnl
706 hiroo 1.37 dnl TCP Wrapper.
707     dnl
708 aono 1.41 WRAPLIB=
709 hiroo 1.37 AC_MSG_CHECKING(whether to use libwrap)
710     AC_ARG_WITH(libwrap,
711 aono 1.41 [ --with-libwrap[[=DIR]] Compile in libwrap (tcp_wrappers) support [[default=try to find libwrap]]],
712 hiroo 1.37 [ case "$withval" in
713     no)
714     AC_MSG_RESULT(no)
715 aono 1.41 WRAP_TRY=no
716 hiroo 1.37 ;;
717     yes)
718     AC_MSG_RESULT(yes)
719 aono 1.41 WRAP_TRY=yes
720 hiroo 1.37 ;;
721     *)
722     AC_MSG_RESULT(yes)
723 aono 1.41 WRAP_TRY=yes
724 hiroo 1.37 if test -d "$withval"; then
725     WRAPINCLUDES="-I$withval"
726 aono 1.41 if test -d $withval/include; then
727     WRAPINCLUDES="-I$withval/include $WRAPINCLUDES"
728     fi
729     WRAPLIB="-L$withval -lwrap"
730     if test -d $withval/lib; then
731     WRAPLIB="-L$withval/lib $WRAPLIB"
732     fi
733 hiroo 1.37 else
734     WRAPINCLUDES="$withval"
735     fi
736     ;;
737 aonoto 1.42 esac],
738 aono 1.41 [AC_MSG_RESULT([try to find])
739     WRAP_TRY=auto]
740 hiroo 1.37 )
741 aono 1.41 # Link test for libwrap
742     if test "$WRAP_TRY" = yes -o "$WRAP_TRY" = auto; then
743     OLDCFLAGS="$CFLAGS"
744     CFLAGS="$WRAPINCLUDES $CFLAGS"
745     OLDLIBS="$LIBS"
746     WRAPLIB=${WRAPLIB:-"-lwrap"}
747     LIBS="$WRAPLIB $OLDLIBS"
748     AC_MSG_CHECKING([libwrap is working])
749     AC_TRY_LINK([ int allow_severity; int deny_severity; ],
750     [ hosts_access(); ],
751     [ AC_MSG_RESULT(yes)
752     AC_DEFINE(HAVE_LIBWRAP, 1,
753     [Define if you have libwrap (TCP wrapper) support.])
754     AC_SUBST(WRAPLIB)],
755     [ AC_MSG_RESULT(no)
756     if test "$WRAP_TRY" = yes; then
757     AC_MSG_ERROR([Could not find libwrap. Please check config.log.])
758     else
759     # recover old flag / clear needless WRAPLIB and continue
760     CFLAGS=$OLDCFLAGS
761     WRAPLIB=
762     fi] )
763     # only jserver needs libwrap, recover LIBS also
764     LIBS=$OLDLIBS
765     fi
766 aono 1.20
767 ura 1.5
768     dnl
769 ura 1.1 dnl Creating Makefiles.
770     dnl
771 aono 1.20 # mkdir -p Contrib/dic/gerodic in case builddir != srcdir
772 aono 1.41 dir=Contrib/dic/gerodic
773 aonoto 1.42 if test ! -d $dir; then
774     echo "creating $dir ..."
775 aono 1.41 $ac_install_sh -d $dir
776 aonoto 1.42 fi
777 aono 1.20
778 hiroo 1.28 dnl
779     dnl Generate Makefiles
780     dnl
781    
782     dnl Generic
783    
784     makefiles_generic="makerule.mk Makefile"
785    
786     dnl Japanese
787    
788     if test "x${Wnn}" = "xWnn"; then
789     makefiles_wnn="Wnn/Makefile Wnn/conv/Makefile Wnn/include/Makefile \
790     Wnn/jd/Makefile Wnn/jd/rk/Makefile Wnn/jd/rk.vi/Makefile \
791     Wnn/jlib/Makefile Wnn/jlib.V3/Makefile Wnn/jserver/Makefile \
792     Wnn/jutil/Makefile Wnn/ld/Makefile Wnn/ld/rk/Makefile \
793     Wnn/romkan/Makefile Wnn/uum/Makefile \
794     Wnn/man/Makefile Wnn/man/2.env/Makefile Wnn/man/3.libwnn/Makefile \
795     Wnn/man/4.cmd/Makefile Wnn/man/6.jutil/Makefile \
796     Wnn/man/2.env/dic/Makefile Wnn/man/2.env/wnn/Makefile \
797     Wnn/man/3.libwnn/jl_lib/Makefile Wnn/man/3.libwnn/js_lib/Makefile \
798     Wnn/man/3.libwnn/misc_lib/Makefile Wnn/man/3.libwnn/rk_lib/Makefile"
799     makefiles_wnn_dic="Contrib/dic/gerodic/Makefile Wnn/pubdicplus/Makefile \
800     Wnn/wnncons/Makefile Wnn/wnncons/dic/Makefile"
801     fi
802    
803     dnl Chinese and Taiwanese
804    
805 aono 1.20 if test "x$cWnn" = "xcWnn"; then
806 hiroo 1.28 makefiles_cwnn="cWnn/Makefile cWnn/conv/Makefile cWnn/etc/Makefile \
807     cWnn/cd/Makefile cWnn/cd/rk/Makefile \
808     cWnn/cd/rk_p/Makefile cWnn/cd/rk_z/Makefile \
809     cWnn/td/Makefile cWnn/td/rk/Makefile \
810     cWnn/td/rk_z/Makefile cWnn/td/rk_p/Makefile \
811     cWnn/include/Makefile cWnn/jlib/Makefile \
812     cWnn/jserver/Makefile cWnn/jutil/Makefile \
813     cWnn/man/Makefile cWnn/man/1.intro/Makefile cWnn/man/2.env/Makefile \
814     cWnn/man/4.cmd/Makefile cWnn/man/6.jutil/Makefile \
815     cWnn/romkan/Makefile cWnn/uum/Makefile"
816     makefiles_cwnn_dic="cWnn/cdic/Makefile cWnn/tdic/Makefile"
817     fi
818    
819     dnl Korean
820    
821     if test "x$kWnn" = "xkWnn"; then
822     makefiles_kwnn="kWnn/Makefile kWnn/conv/Makefile kWnn/etc/Makefile \
823     kWnn/include/Makefile kWnn/jlib/Makefile kWnn/jutil/Makefile \
824     kWnn/jserver/Makefile kWnn/kd/Makefile kWnn/kd/rk/Makefile \
825     kWnn/romkan/Makefile kWnn/uum/Makefile"
826     makefiles_kwnn_dic="kWnn/kdic/Makefile"
827 aono 1.20 fi
828    
829 hiroo 1.28 AC_OUTPUT(${makefiles_generic} \
830     ${makefiles_wnn} ${makefiles_wnn_dic} \
831     ${makefiles_cwnn} ${makefiles_cwnn_dic} \
832     ${makefiles_kwnn} ${makefiles_kwnn_dic})

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