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.56 - (hide annotations) (download)
Thu Aug 1 18:43:07 2013 UTC (10 years, 8 months ago) by aonoto
Branch: MAIN
Changes since 1.55: +6 -4 lines
- libutil is (may be) used only in uum, so separate this library
  (if exists) from normal LIBS.
  Patch by 1xx (itsango at gmail.com) ([freewnn-users 126]) with some modification.

- Fixed spelling in configure.in .

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

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