Develop and Download Open Source Software

Browse CVS Repository

Contents of /freewnn/FreeWnn/configure.in

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.21 - (show annotations) (download)
Thu Mar 21 01:19:50 2002 UTC (22 years ago) by hiroo
Branch: MAIN
Changes since 1.20: +6 -57 lines
comment cleanup.

1 dnl
2 dnl $Id: configure.in,v 1.20 2002/03/09 16:50:31 aono Exp $
3 dnl
4
5 dnl
6 dnl FreeWnn is a network-extensible Kana-to-Kanji conversion system.
7 dnl This file is part of FreeWnn.
8 dnl
9 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 dnl Copyright FreeWnn Project 1999, 2000, 2001, 2002
14 dnl
15 dnl Maintainer: FreeWnn Project <freewnn@tomo.gr.jp>
16 dnl
17 dnl This program is free software; you can redistribute it and/or modify
18 dnl it under the terms of the GNU General Public License as published by
19 dnl the Free Software Foundation; either version 2 of the License, or
20 dnl (at your option) any later version.
21 dnl
22 dnl This program is distributed in the hope that it will be useful,
23 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
24 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 dnl GNU General Public License for more details.
26 dnl
27 dnl You should have received a copy of the GNU General Public License
28 dnl along with this program; if not, write to the Free Software
29 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 dnl
31
32 dnl
33 dnl Process this file with autoconf to produce a configure script.
34 dnl
35 AC_INIT(Wnn/conv/cvt_head.h)
36 AC_CONFIG_HEADER(config.h)
37
38 dnl ====================================================================
39 dnl Check optional features
40 dnl ====================================================================
41
42 AC_CANONICAL_HOST
43
44 dnl build and install libraries, server or client
45
46 AC_ARG_ENABLE(debug,
47 [ --enable-debug enable debug options [default=no]],
48 [case "${enableval}" in
49 yes) debug=true ;;
50 no) debug=false ;;
51 *) AC_MSG_ERROR(bad value for --enable-debug)
52 esac], debug=false)
53
54 AC_ARG_ENABLE(libraries,
55 [ --enable-libraries build and install libraries [default=yes]],
56 [case "${enableval}" in
57 yes) libraries=true ;;
58 no) libraries=false ;;
59 *) AC_MSG_ERROR(bad value for --enable-libraries) ;;
60 esac], libraries=true)
61
62 AC_ARG_ENABLE(server,
63 [ --enable-server build and install server [default=yes]],
64 [case "${enableval}" in
65 yes) server=true ;;
66 no) server=false ;;
67 *) AC_MSG_ERROR(bad value for --enable-server) ;;
68 esac], server=true)
69
70 AC_ARG_ENABLE(client,
71 [ --enable-client build and install clients [default=no]],
72 [case "${enableval}" in
73 yes) client=true ;;
74 no) client=false ;;
75 *) AC_MSG_ERROR(bad value for --enable-client) ;;
76 esac], client=false)
77
78 if test $libraries = true; then
79 SUBDIRS="\$(LIB_SUBDIRS)"
80 WNNMANDIR="\$(LIB_WNNMANDIR)"
81 fi
82 if test $server = true; then
83 SUBDIRS="$SUBDIRS \$(SERVER_SUBDIRS)"
84 WNNMANDIR="$WNNMANDIR \$(SERVER_WNNMANDIR)"
85 fi
86 if test $client = true; then
87 SUBDIRS="$SUBDIRS \$(CLIENT_SUBDIRS)"
88 dnl currently client is only uum and its man is in SERVER_WNNMANDIR
89 dnl WNNMANDIR=$WNNMANDIR \$(CLIENT_WNNMANDIR)"
90 fi
91
92 AC_SUBST(SUBDIRS)
93 AC_SUBST(WNNMANDIR)
94
95 dnl For Severs
96
97 AC_ARG_ENABLE(Wnn,
98 [ --enable-Wnn build and install Wnn [default=yes]],
99 [case "${enableval}" in
100 yes) Wnn="Wnn";;
101 no) Wnn="" ;;
102 *) AC_MSG_ERROR(bad value for --enable-Wnn) ;;
103 esac], Wnn="Wnn")
104 AC_SUBST(Wnn)
105
106 if test "$server" = true -a "$Wnn" = Wnn; then
107 # JSERVER_SUBDIRS1="\$(JSERVER_SUBDIRS1)"
108 JSERVER_SUBDIRS2="\$(JSERVER_SUBDIRS2)"
109 else
110 # JSERVER_SUBDIRS1=""
111 JSERVER_SUBDIRS2=""
112 fi
113 dnl AC_SUBST(JSERVER_SUBDIRS1)
114 AC_SUBST(JSERVER_SUBDIRS2)
115
116 AC_ARG_ENABLE(cWnn,
117 [ --enable-cWnn build and install cWnn [default=yes]],
118 [case "${enableval}" in
119 yes) cWnn="cWnn" ;;
120 no) cWnn="" ;;
121 *) AC_MSG_ERROR(bad value for --enable-cWnn) ;;
122 esac], cWnn="cWnn")
123 AC_SUBST(cWnn)
124
125 AC_ARG_ENABLE(kWnn,
126 [ --enable-kWnn build and install kWnn [default=yes]],
127 [case "${enableval}" in
128 yes) kWnn="kWnn" ;;
129 no) kWnn="" ;;
130 *) AC_MSG_ERROR(bad value for --enable-kWnn) ;;
131 esac], kWnn="kWnn")
132 AC_SUBST(kWnn)
133
134 dnl For a library libwnn
135
136 dnl AC_ARG_WITH(libwnn,
137 dnl [ --with-libwnn use installed Wnn library [default=no]],
138 dnl [case "${withval}" in
139 dnl yes|no) with_libwnn=${withval};;
140 dnl *) AC_MSG_ERROR(invalid argument to --with-libwnn) ;;
141 dnl esac], with_libwnn=no)
142 dnl
143
144 AC_ARG_WITH(libwnn,
145 [ --with-libwnn use installed Wnn library [default=no]],
146 [ with_libwnn="${withval}"
147 AC_ARG_WITH(wnn-includes,
148 [ --with-wnn-includes=DIR WNN include files are in DIR],
149 [wnnincludedir="-I${withval}"], [wnnincludedir=''])
150 AC_ARG_WITH(wnn-libraries,
151 [ --with-wnn-libraries=DIR Search for WNN libraries in DIR[default=/usr/local/lib]],
152 [wnnlibdir="${withval}"], [wnnlibdir='/usr/local/lib'])
153 if test "X${with_libwnn}" = X-lwnn; then
154 WNNJLIB="-L${wnnlibdir} -lwnn"
155 elif test X"`echo ${with_libwnn} | grep '^/.*'`" != X ; then
156 WNNJLIB="${with_libwnn}"
157 else
158 WNNJLIB="${wnnlibdir}/libwnn.a"
159 fi
160 DEPWNNJLIB=""
161 HINSI_DATA="\$(JWNNWNNDIR)/hinsi.data"
162 ],
163 [ WNNJLIB="\$(WNNJLIBSRC)/libwnn.la"
164 DEPWNNJLIB="\$(WNNJLIB)"
165 HINSI_DATA="\$(WNNJDSRC)/hinsi.data"
166 ])
167 AC_SUBST(WNNJLIB)
168 AC_SUBST(DEPWNNJLIB)
169 AC_SUBST(HINSI_DATA)
170
171 AC_ARG_WITH(libcwnn,
172 [ --with-libcwnn use installed cWnn library [default=no]],
173 [
174 AC_ARG_WITH(cwnn-includes,
175 [ --with-cwnn-includes=DIR CWNN include files are in DIR],
176 [cwnnincludedir="-I${withval}"], [cwnnincludedir=''])
177 AC_ARG_WITH(cwnn-libraries,
178 [ --with-cwnn-libraries=DIR Search for CWNN libraries in DIR[default=/usr/local/lib]],
179 [cwnnlibdir="${withval}"], [cwnnlibdir='/usr/local/lib'])
180 if test "X${with_libcwnn}" = X-lcwnn; then
181 CWNNJLIB="-L${cwnnlibdir} -lcwnn"
182 elif test X"`echo ${with_libcwnn} | grep '^/.*'`" != X ; then
183 CWNNJLIB="${with_libcwnn}"
184 else
185 CWNNJLIB="${cwnnlibdir}/libcwnn.a"
186 fi
187 DEPCWNNJLIB=""
188 CHINSI_DATA="\$(CWNNWNNDIR)/cixing.data"
189 THINSI_DATA="\$(TWNNTDSRC)/cixing.data"
190 ],
191 [ CWNNJLIB="\$(CWNNJLIBSRC)/libcwnn.la"
192 DEPCWNNJLIB="\$(CWNNJLIB)"
193 CHINSI_DATA="\$(CWNNCDSRC)/cixing.data"
194 THINSI_DATA="\$(TWNNTDSRC)/cixing.data"
195 ])
196 AC_SUBST(CWNNJLIB)
197 AC_SUBST(DEPCWNNJLIB)
198 AC_SUBST(CHINSI_DATA)
199 AC_SUBST(THINSI_DATA)
200
201 AC_ARG_WITH(libkwnn,
202 [ --with-libkwnn use installed kWnn library [default=no]],
203 [
204 AC_ARG_WITH(kwnn-includes,
205 [ --with-kwnn-includes=DIR KWNN include files are in DIR],
206 [kwnnincludedir="-I${withval}"], [kwnnincludedir=''])
207 AC_ARG_WITH(kwnn-libraries,
208 [ --with-kwnn-libraries=DIR Search for KWNN libraries in DIR[default=/usr/local/lib]],
209 [kwnnlibdir="${withval}"], [kwnnlibdir='/usr/local/lib'])
210 if test "X${with_libkwnn}" = X-lkwnn; then
211 KWNNJLIB="-L${kwnnlibdir} -lkwnn"
212 elif test X"`echo ${with_libkwnn} | grep '^/.*'`" != X ; then
213 KWNNJLIB="${with_libkwnn}"
214 else
215 KWNNJLIB="${kwnnlibdir}/libkwnn.a"
216 fi
217 DEPKWNNJLIB=""
218 KHINSI_DATA="\$(KWNNWNNDIR)/hinsi.data"
219 ],
220 [ KWNNJLIB="\$(KWNNJLIBSRC)/libkwnn.la"
221 DEPKWNNJLIB="\$(KWNNJLIB)"
222 KHINSI_DATA="\$(KWNNKDSRC)/hinsi.data"
223 ])
224 AC_SUBST(KWNNJLIB)
225 AC_SUBST(DEPKWNNJLIB)
226 AC_SUBST(KHINSI_DATA)
227
228 dnl
229 dnl Build Options
230 dnl
231
232 AC_ARG_ENABLE(ipv6,
233 [ --enable-ipv6 build and install IPv6 [default=no]],
234 [case "${enableval}" in
235 yes) ipv6="-DINET6";;
236 no) ipv6="" ;;
237 *) AC_MSG_ERROR(bad value for --enable-ipv6) ;;
238 esac], ipv6="")
239 AC_SUBST(ipv6)
240
241 AC_ARG_ENABLE(unsafe-path,
242 [ --enable-unsafe-path allow creating files in an arbitrary path [default=no]],
243 [case "${enableval}" in
244 yes) unsafe_path=true;;
245 no) unsafe_path=false;;
246 *) AC_MSG_ERROR(bad value for --enable-unsafe-path) ;;
247 esac], unsafe_path=false)
248 AC_SUBST(unsafe_path)
249
250 if test ${unsafe_path} = true; then
251 AC_DEFINE(WNN_ALLOW_UNSAFE_PATH)
252 fi
253
254 dnl
255 dnl Checks for cc and cpp.
256 dnl
257 AC_PROG_CC
258
259 dnl Use environment variable (if set). It will be overridden
260 dnl in supported system though...
261 CDEBUGFLAGS=${CDEBUGFLAGS:-"-O"}
262 case $host in
263 *-*-linux*)
264 CCOPTIONS="-Dlinux -D_POSIX_SOURCE -D_BSD_SOURCE"
265 CDEBUGFLAGS="-O2 -fno-strength-reduce"
266 ;;
267 *-*-freebsd*|*-*-netbsd*|*-*-openbsd*)
268 CCOPTIONS="-DCSRG_BASED"
269 CDEBUGFLAGS="-O2 -fno-strength-reduce"
270 ;;
271 *-*-bsdi*)
272 CCOPTIONS="-DCSRG_BASED"
273 CDEBUGFLAGS="-O2 -fno-strength-reduce"
274 ;;
275 *-*-sunos*)
276 if test $GCC = yes; then
277 CCOPTIONS="-Dsun -Dsparc"
278 CDEBUGFLAGS=-O2
279 else
280 CCOPTIONS=""
281 CDEBUGFLAGS=-O4
282 fi
283 ;;
284 *-*-solaris2.*)
285 # Will 'solaris*' be OK?
286 if test $GCC = yes; then
287 CCOPTIONS="-Dsun -D`uname -p` -DSVR4 -DSYSV"
288 CDEBUGFLAGS=-O2
289 else
290 CCOPTIONS="-Xc -xF -xcg92 -Dsun -D`uname -p` -DSVR4 -DSYSV"
291 CDEBUGFLAGS=-O4
292 fi
293 ;;
294 *-*-hpux*)
295 if test $GCC = yes; then
296 CCOPTIONS="-Dhpux -DSYSV"
297 CDEBUGFLAGS=-O2
298 else
299 CCOPTIONS="-Ae -Dhpux -DSYSV"
300 fi
301 ;;
302 i[[34567]]86-pc-beos*)
303 CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE"
304 CDEBUGFLAGS="-O2 -fno-strength-reduce"
305 ;;
306 powerpc-*-beos*)
307 CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE"
308 ;;
309 *-*-aix*)
310 if test $GCC = yes; then
311 CDEBUGFLAGS=-O2
312 else
313 CDEBUGFLAGS=-O
314 fi
315 CCOPTIONS="-DSYSV"
316 ;;
317 *)
318 AC_MSG_WARN("It is not reported if FreeWnn works on this system. But continuing...")
319 AC_MSG_WARN([(It may or may not work if you set CCOPTIONS properly.)])
320 ;;
321 esac
322
323 dnl Checking if we use gcc or not
324 if test $debug = true; then
325 if test $GCC = yes; then
326 CDEBUGFLAGS="-g2 -Wall -fstack-check $CDEBUGFLAGS"
327 fi
328 fi
329
330 if test ${debug} = true; then
331 INSTPGMFLAGS=
332 else
333 INSTPGMFLAGS="-s"
334 fi
335 AC_SUBST(INSTPGMFLAGS)
336
337 echo "Set CDEBUGFLAGS and CCOPTIONS to following:"
338 echo ' CDEBUGFLAGS="'"$CDEBUGFLAGS"'"'
339 echo ' CCOPTIONS="'"$CCOPTIONS"'"'
340
341 dnl ��������������������������������configure������������CPP������������
342 dnl ������������������������������������CPP������������������������
343 dnl ��CPP=${CPP:-"/usr/ccs/lib/cpp"}������������������������������������
344 dnl ����������������
345 AC_PROG_CPP
346
347 dnl
348 dnl Checks for programs.
349 dnl
350 dnl ### AC_PROG_YACC
351 dnl ### AC_PROG_LEX
352 AC_PROG_INSTALL
353 AC_PROG_LN_S
354 AC_PROG_MAKE_SET
355 AC_PROG_LIBTOOL
356 AC_SUBST(LIBTOOL_DEPS)
357 AC_SUBST(CCOPTIONS)
358 AC_SUBST(CDEBUGFLAGS)
359
360 dnl Checks for libraries.
361 dnl ### dnl Replace `main' with a function in -lX11:
362 dnl ### AC_CHECK_LIB(X11, main)
363 dnl ### dnl Replace `main' with a function in -lcurses:
364 dnl ### AC_CHECK_LIB(curses, main)
365
366 AC_CHECK_LIB(crypt, crypt)
367 AC_CHECK_LIB(socket, connect)
368 AC_CHECK_LIB(nsl, gethostbyname)
369
370 dnl
371 dnl Checks for header files.
372 dnl
373 AC_PATH_X
374 AC_HEADER_STDC
375 AC_HEADER_SYS_WAIT
376 AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sgtty.h strings.h termio.h unistd.h)
377 AC_CHECK_HEADERS(sys/file.h sys/ioctl.h sys/time.h sys/types.h sys/param.h)
378 dnl If you don't use ansidecl.h, use this (and modify Wnn/jserver/error.c)
379 dnl AC_CHECK_HEADERS(stdarg.h varargs.h, break)
380
381 dnl
382 dnl Checks for typedefs, structures, and compiler characteristics.
383 dnl
384 AC_TYPE_MODE_T
385 AC_HEADER_TIME
386 AC_CHECK_TYPE(time_t, long)
387
388 dnl
389 dnl socklen_t �� sys/socket.h �� bits/socket.h ����������������������
390 dnl AC_CHECK_TYPE ����������������
391 dnl
392 AC_MSG_CHECKING(for socklen_t)
393 AC_EGREP_CPP(socklen_t, [#include <sys/socket.h>], AC_MSG_RESULT(yes),
394 [
395 AC_DEFINE(socklen_t, int)
396 AC_MSG_RESULT(no)
397 ])
398
399 dnl
400 dnl Checks for symbol
401 dnl
402
403 AC_MSG_CHECKING(for RAND_MAX)
404 AC_EGREP_CPP(yes,
405 [#include <stdlib.h>
406 #ifdef RAND_MAX
407 yes
408 #endif
409 ],AC_DEFINE(HAVE_RAND_MAX))
410
411 dnl
412 dnl Checks for library functions.
413 dnl
414 AC_PROG_GCC_TRADITIONAL
415 AC_FUNC_MEMCMP
416 AC_TYPE_SIGNAL
417 AC_FUNC_WAIT3
418 AC_CHECK_FUNCS(gethostname select socket strtol)
419 AC_CHECK_FUNCS(drand48)
420 AC_CHECK_FUNCS(perror)
421 AC_CHECK_FUNCS(closesocket setsockopt send recv)
422 AC_CHECK_FUNC(setpgrp)
423 AC_CHECK_FUNCS(vsyslog)
424 dnl for bcopy/index -> memcpy/strchr conversion (preparation):
425 dnl AC_CHECK_FUNCS(strchr memcpy)
426 AC_FUNC_SETPGRP
427
428 dnl Check fallback functions for jserver (should use AC_REPLACE_FUNCS?)
429 JS_SUPPORTOBJS=
430 AC_CHECK_FUNCS(mkdir vasprintf, ,
431 [JS_SUPPORTOBJS="$JS_SUPPORTOBJS ${ac_func}.o"])
432 AC_SUBST(JS_SUPPORTOBJS)
433
434
435 dnl
436 dnl Creating Makefiles.
437 dnl
438 # mkdir -p Contrib/dic/gerodic in case builddir != srcdir
439 for dir in Contrib Contrib/dic Contrib/dic/gerodic; do
440 if test ! -d $dir; then
441 echo "creating $dir ..."
442 mkdir $dir
443 fi
444 done
445
446 # Wnn / kWnn part is not available yet ...
447 if test "x$cWnn" = "xcWnn"; then
448 makefiles_cwnn="cWnn/Makefile cWnn/cdic/Makefile cWnn/conv/Makefile cWnn/etc/Makefile \
449 cWnn/cd/Makefile cWnn/cd/rk/Makefile cWnn/cd/rk_p/Makefile cWnn/cd/rk_z/Makefile \
450 cWnn/td/Makefile cWnn/td/rk/Makefile cWnn/td/rk_z/Makefile cWnn/td/rk_p/Makefile \
451 cWnn/include/Makefile cWnn/jlib/Makefile cWnn/jserver/Makefile cWnn/jutil/Makefile \
452 cWnn/man/Makefile cWnn/man/1.intro/Makefile cWnn/man/2.env/Makefile \
453 cWnn/man/4.cmd/Makefile cWnn/man/6.jutil/Makefile \
454 cWnn/tdic/Makefile cWnn/romkan/Makefile cWnn/uum/Makefile"
455 fi
456
457 AC_OUTPUT(makerule.mk Makefile Contrib/dic/gerodic/Makefile \
458 Wnn/Makefile Wnn/conv/Makefile Wnn/include/Makefile Wnn/jutil/Makefile \
459 Wnn/jd/Makefile Wnn/jd/rk/Makefile Wnn/jd/rk.vi/Makefile \
460 Wnn/jlib/Makefile Wnn/jlib.V3/Makefile Wnn/jserver/Makefile \
461 Wnn/ld/Makefile Wnn/ld/rk/Makefile Wnn/man/Makefile \
462 Wnn/man/2.env/Makefile Wnn/man/3.libwnn/Makefile Wnn/man/4.cmd/Makefile Wnn/man/6.jutil/Makefile \
463 Wnn/man/2.env/dic/Makefile Wnn/man/2.env/wnn/Makefile \
464 Wnn/man/3.libwnn/jl_lib/Makefile Wnn/man/3.libwnn/js_lib/Makefile \
465 Wnn/man/3.libwnn/misc_lib/Makefile Wnn/man/3.libwnn/rk_lib/Makefile \
466 Wnn/pubdicplus/Makefile Wnn/romkan/Makefile Wnn/uum/Makefile \
467 Wnn/wnncons/Makefile Wnn/wnncons/dic/Makefile \
468 $makefiles_cwnn \
469 kWnn/Makefile kWnn/conv/Makefile kWnn/etc/Makefile kWnn/include/Makefile \
470 kWnn/jlib/Makefile kWnn/jutil/Makefile kWnn/jserver/Makefile \
471 kWnn/kd/Makefile kWnn/kd/rk/Makefile kWnn/kdic/Makefile \
472 kWnn/romkan/Makefile kWnn/uum/Makefile)

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