| 1 |
dnl |
| 2 |
dnl $Id: configure.in,v 1.50 2010/02/22 17:06:54 aonoto 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 |
| 14 |
dnl 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, |
| 15 |
dnl 2010 |
| 16 |
dnl |
| 17 |
dnl Maintainer: FreeWnn Project |
| 18 |
dnl |
| 19 |
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 |
dnl the Free Software Foundation; either version 2 of the License, or |
| 22 |
dnl (at your option) any later version. |
| 23 |
dnl |
| 24 |
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 |
dnl |
| 29 |
dnl You should have received a copy of the GNU General Public License |
| 30 |
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 |
dnl |
| 33 |
|
| 34 |
dnl |
| 35 |
dnl Process this file with autoconf to produce a configure script. |
| 36 |
dnl |
| 37 |
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 |
AC_CONFIG_HEADER(config.h) |
| 42 |
|
| 43 |
dnl ==================================================================== |
| 44 |
dnl Check optional features |
| 45 |
dnl ==================================================================== |
| 46 |
|
| 47 |
# Quick and Dirty workaround for Autoconf-2.53 and Libtools-1.5.* pair ... |
| 48 |
# not to use additional tagged configuration. (default: CXX F77) |
| 49 |
# NOTICE: Please remove next line if situation changes. (aono) |
| 50 |
tagnames= |
| 51 |
|
| 52 |
AC_CANONICAL_HOST |
| 53 |
|
| 54 |
dnl build and install libraries, server or client |
| 55 |
|
| 56 |
AC_ARG_ENABLE(debug, |
| 57 |
[ --enable-debug enable debug options [[default=no]]], |
| 58 |
[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 |
|
| 64 |
AC_ARG_ENABLE(libraries, |
| 65 |
[ --enable-libraries build and install libraries [[default=yes]]], |
| 66 |
[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 |
[ --enable-server build and install server [[default=yes]]], |
| 74 |
[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 |
AC_ARG_ENABLE(client, |
| 81 |
[ --enable-client build and install clients [[default=no]]], |
| 82 |
[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 |
|
| 88 |
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 |
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 |
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 |
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 |
|
| 142 |
AC_SUBST(SUBDIRS) |
| 143 |
AC_SUBST(WNNMANDIR) |
| 144 |
|
| 145 |
dnl For Severs |
| 146 |
|
| 147 |
AC_ARG_ENABLE(Wnn, |
| 148 |
[ --enable-Wnn build and install Wnn [[default=yes]]], |
| 149 |
[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 |
# JSERVER_SUBDIRS1="\$(JSERVER_SUBDIRS1)" |
| 158 |
JSERVER_SUBDIRS2="\$(JSERVER_SUBDIRS2)" |
| 159 |
else |
| 160 |
# JSERVER_SUBDIRS1="" |
| 161 |
JSERVER_SUBDIRS2="" |
| 162 |
fi |
| 163 |
dnl AC_SUBST(JSERVER_SUBDIRS1) |
| 164 |
AC_SUBST(JSERVER_SUBDIRS2) |
| 165 |
|
| 166 |
AC_ARG_ENABLE(cWnn, |
| 167 |
[ --enable-cWnn build and install cWnn [[default=yes]]], |
| 168 |
[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 |
[ --enable-kWnn build and install kWnn [[default=yes]]], |
| 177 |
[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 |
[ --with-libwnn use installed Wnn library [[default=no]]], |
| 196 |
[ with_libwnn="${withval}" |
| 197 |
AC_ARG_WITH(wnn-includes, |
| 198 |
[ --with-wnn-includes=DIR WNN include files are in DIR], |
| 199 |
[wnnincludedir="-I${withval}"], [wnnincludedir='']) |
| 200 |
AC_ARG_WITH(wnn-libraries, |
| 201 |
[ --with-wnn-libraries=DIR Search for WNN libraries in DIR [[default=/usr/local/lib]]], |
| 202 |
[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 |
[ WNNJLIB="\$(top_builddir)/Wnn/jlib/libwnn.la" |
| 214 |
DEPWNNJLIB="\$(WNNJLIB)" |
| 215 |
HINSI_DATA="\$(top_builddir)/Wnn/jd/hinsi.data" |
| 216 |
]) |
| 217 |
AC_SUBST(WNNJLIB) |
| 218 |
AC_SUBST(DEPWNNJLIB) |
| 219 |
AC_SUBST(HINSI_DATA) |
| 220 |
|
| 221 |
AC_ARG_WITH(libcwnn, |
| 222 |
[ --with-libcwnn use installed cWnn library [[default=no]]], |
| 223 |
[ |
| 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 |
[ --with-cwnn-libraries=DIR Search for CWNN libraries in DIR [[default=/usr/local/lib]]], |
| 229 |
[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 |
[ CWNNJLIB="\$(top_builddir)/cWnn/jlib/libcwnn.la" |
| 242 |
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 |
[ --with-libkwnn use installed kWnn library [[default=no]]], |
| 253 |
[ |
| 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 |
[ --with-kwnn-libraries=DIR Search for KWNN libraries in DIR [[default=/usr/local/lib]]], |
| 259 |
[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 |
[ KWNNJLIB="\$(top_builddir)/kWnn/jlib/libkwnn.la" |
| 271 |
DEPKWNNJLIB="\$(KWNNJLIB)" |
| 272 |
KHINSI_DATA="\$(KWNNKDSRC)/hinsi.data" |
| 273 |
]) |
| 274 |
AC_SUBST(KWNNJLIB) |
| 275 |
AC_SUBST(DEPKWNNJLIB) |
| 276 |
AC_SUBST(KHINSI_DATA) |
| 277 |
|
| 278 |
dnl |
| 279 |
dnl Build Options |
| 280 |
dnl |
| 281 |
|
| 282 |
AC_ARG_ENABLE(ipv6, |
| 283 |
[ --enable-ipv6 build and install IPv6 [[default=no]]], |
| 284 |
[case "${enableval}" in |
| 285 |
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 |
[ --enable-unsafe-path allow creating files in an arbitrary path [[default=no]]], |
| 293 |
[case "${enableval}" in |
| 294 |
yes) unsafe_path=true;; |
| 295 |
no) unsafe_path=false;; |
| 296 |
*) 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 |
AC_DEFINE(WNN_ALLOW_UNSAFE_PATH, 1, |
| 302 |
[Define to allow writing to other than JSERVERDIR.]) |
| 303 |
fi |
| 304 |
|
| 305 |
dnl |
| 306 |
dnl Checks for cc and cpp. |
| 307 |
dnl |
| 308 |
AC_PROG_CC |
| 309 |
|
| 310 |
dnl System specific options |
| 311 |
dnl Now that we are using autoconf, CCOPTIONS should be nuked... |
| 312 |
dnl But please report if your system needs specific settings (CCOPTIONS etc.) |
| 313 |
case $host in |
| 314 |
*-*-linux*) |
| 315 |
CCOPTIONS="-Dlinux -D_GNU_SOURCE -D_POSIX_SOURCE -D_BSD_SOURCE" |
| 316 |
;; |
| 317 |
*-*-*-gnu) |
| 318 |
# Non-Linux kernel with GNU libc. |
| 319 |
CCOPTIONS="-D_GNU_SOURCE" |
| 320 |
;; |
| 321 |
*-*-sunos*) |
| 322 |
if test $GCC = yes; then |
| 323 |
CCOPTIONS="-Dsun -Dsparc" |
| 324 |
else |
| 325 |
CCOPTIONS="" |
| 326 |
fi |
| 327 |
;; |
| 328 |
*-*-solaris2.*) |
| 329 |
# Will 'solaris*' be OK? |
| 330 |
if test $GCC = yes; then |
| 331 |
CCOPTIONS="-Dsun -D`uname -p` -DSVR4 -DSYSV" |
| 332 |
else |
| 333 |
# TODO: need change for sparcv9 / x64 architecture ... |
| 334 |
CCOPTIONS="-Xc -xF -xcg92 -Dsun -D`uname -p` -DSVR4 -DSYSV" |
| 335 |
fi |
| 336 |
;; |
| 337 |
*-*-hpux*) |
| 338 |
if test $GCC = yes; then |
| 339 |
CCOPTIONS="-Dhpux -DSYSV" |
| 340 |
else |
| 341 |
CCOPTIONS="-Ae -Dhpux -DSYSV" |
| 342 |
fi |
| 343 |
;; |
| 344 |
i[[34567]]86-pc-beos*) |
| 345 |
CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE" |
| 346 |
;; |
| 347 |
powerpc-*-beos*) |
| 348 |
CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE" |
| 349 |
;; |
| 350 |
*-*-aix*) |
| 351 |
CCOPTIONS="-DSYSV" |
| 352 |
;; |
| 353 |
esac |
| 354 |
|
| 355 |
dnl Checking if we use gcc or not |
| 356 |
if test $debug = true; then |
| 357 |
if test $GCC = yes; then |
| 358 |
# FIXME: gcc -fstack-check doesn't work well on Linux/i386 ... |
| 359 |
CDEBUGFLAGS=${CDEBUGFLAGS:-"-g2 -O2 -Wall"} |
| 360 |
else |
| 361 |
CDEBUGFLAGS=${CDEBUGFLAGS:-""} |
| 362 |
fi |
| 363 |
INSTPGMFLAGS= |
| 364 |
else |
| 365 |
CDEBUGFLAGS=${CDEBUGFLAGS:-""} |
| 366 |
INSTPGMFLAGS="-s" |
| 367 |
fi |
| 368 |
AC_SUBST(CCOPTIONS) |
| 369 |
AC_SUBST(CDEBUGFLAGS) |
| 370 |
AC_SUBST(INSTPGMFLAGS) |
| 371 |
|
| 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 |
AC_PROG_CPP |
| 381 |
|
| 382 |
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 |
dnl |
| 394 |
dnl Checks for programs. |
| 395 |
dnl |
| 396 |
dnl ### AC_PROG_YACC |
| 397 |
dnl ### AC_PROG_LEX |
| 398 |
AC_PROG_INSTALL |
| 399 |
AC_PROG_LN_S |
| 400 |
AC_PROG_MAKE_SET |
| 401 |
AC_PROG_LIBTOOL |
| 402 |
AC_SUBST(LIBTOOL_DEPS) |
| 403 |
|
| 404 |
dnl Checks for libraries. |
| 405 |
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 |
|
| 410 |
AC_SEARCH_LIBS(crypt, crypt) |
| 411 |
AC_CHECK_LIB(socket, connect) |
| 412 |
AC_CHECK_LIB(bind, getservbyname) |
| 413 |
AC_SEARCH_LIBS(gethostbyname, nsl) |
| 414 |
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 |
|
| 418 |
dnl |
| 419 |
dnl Checks for header files. |
| 420 |
dnl |
| 421 |
AC_PATH_X |
| 422 |
AC_HEADER_STDC |
| 423 |
AC_HEADER_SYS_WAIT |
| 424 |
AC_HEADER_TIME |
| 425 |
AC_CHECK_HEADERS(fcntl.h syslog.h unistd.h utmp.h utmpx.h \ |
| 426 |
sys/file.h sys/ioctl.h sys/time.h sys/types.h sys/param.h \ |
| 427 |
malloc.h strings.h memory.h \ |
| 428 |
curses.h ncurses.h sgtty.h term.h termio.h termios.h \ |
| 429 |
termcap.h sys/termio.h libutil.h\ |
| 430 |
) |
| 431 |
|
| 432 |
dnl |
| 433 |
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 |
CNVFILE_SUBDIR=bsd |
| 439 |
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 |
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 |
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 |
[ AC_MSG_RESULT([no -- we are in termcap land]) |
| 492 |
CNVFILE_SUBDIR=bsd ], |
| 493 |
[ AC_DEFINE(HAVE_TERMINFO, 1, [terminfo spoken here]) |
| 494 |
AC_MSG_RESULT([yes -- terminfo spoken here]) |
| 495 |
CNVFILE_SUBDIR=sysV ], |
| 496 |
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 |
AC_SUBST(CNVFILE_SUBDIR) |
| 503 |
|
| 504 |
dnl |
| 505 |
dnl Checks for typedefs, structures, and compiler characteristics. |
| 506 |
dnl |
| 507 |
AC_TYPE_MODE_T |
| 508 |
AC_HEADER_TIME |
| 509 |
|
| 510 |
dnl AC_CHECK_TYPES(time_t,, |
| 511 |
dnl AC_DEFINE(time_t, long, [Define missing time_t.]), |
| 512 |
dnl [INCLUDES = time.h]) |
| 513 |
AC_CHECK_TYPES(socklen_t,, |
| 514 |
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 |
|
| 520 |
AC_CHECK_MEMBERS([struct utmp.ut_user, struct utmp.ut_name, struct utmp.ut_id],,,[ |
| 521 |
#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 |
dnl |
| 530 |
dnl Checks for symbol |
| 531 |
dnl |
| 532 |
|
| 533 |
dnl |
| 534 |
dnl Checks for library functions. |
| 535 |
dnl |
| 536 |
AC_PROG_GCC_TRADITIONAL |
| 537 |
|
| 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 |
AC_FUNC_MEMCMP |
| 545 |
AC_CHECK_FUNCS(getpgid getpgrp setpgrp wait3) |
| 546 |
AC_FUNC_GETPGRP |
| 547 |
AC_FUNC_SETPGRP |
| 548 |
dnl FreeWnn do not use the 3rd parameter of wait3(). |
| 549 |
dnl AC_FUNC_WAIT3 |
| 550 |
|
| 551 |
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 |
AC_CHECK_FUNCS(random drand48 fchmod getopt killpg \ |
| 554 |
FD_SET \ |
| 555 |
gethostname select socket closesocket setsockopt send recv \ |
| 556 |
getdtablesize getrlimit syslog vsyslog setenv snprintf \ |
| 557 |
ptsname posix_openpt openpty pututxline pututline setsid) |
| 558 |
dnl for bcopy/index -> memcpy/strchr conversion (preparation): |
| 559 |
AC_CHECK_FUNCS(bcopy bzero bcmp index rindex \ |
| 560 |
memcpy memmove memset strchr strrchr) |
| 561 |
|
| 562 |
dnl Check fallback functions for jserver (should use AC_REPLACE_FUNCS?) |
| 563 |
JS_SUPPORTOBJS= |
| 564 |
AC_CHECK_FUNCS(mkdir vasprintf, , |
| 565 |
[JS_SUPPORTOBJS="${JS_SUPPORTOBJS} ${ac_func}.o"]) |
| 566 |
AC_SUBST(JS_SUPPORTOBJS) |
| 567 |
|
| 568 |
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 |
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 |
dnl TCP Wrapper. |
| 707 |
dnl |
| 708 |
WRAPLIB= |
| 709 |
AC_MSG_CHECKING(whether to use libwrap) |
| 710 |
AC_ARG_WITH(libwrap, |
| 711 |
[ --with-libwrap[[=DIR]] Compile in libwrap (tcp_wrappers) support [[default=try to find libwrap]]], |
| 712 |
[ case "$withval" in |
| 713 |
no) |
| 714 |
AC_MSG_RESULT(no) |
| 715 |
WRAP_TRY=no |
| 716 |
;; |
| 717 |
yes) |
| 718 |
AC_MSG_RESULT(yes) |
| 719 |
WRAP_TRY=yes |
| 720 |
;; |
| 721 |
*) |
| 722 |
AC_MSG_RESULT(yes) |
| 723 |
WRAP_TRY=yes |
| 724 |
if test -d "$withval"; then |
| 725 |
WRAPINCLUDES="-I$withval" |
| 726 |
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 |
else |
| 734 |
WRAPINCLUDES="$withval" |
| 735 |
fi |
| 736 |
;; |
| 737 |
esac], |
| 738 |
[AC_MSG_RESULT([try to find]) |
| 739 |
WRAP_TRY=auto] |
| 740 |
) |
| 741 |
# 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 |
|
| 767 |
|
| 768 |
dnl |
| 769 |
dnl Creating Makefiles. |
| 770 |
dnl |
| 771 |
# mkdir -p Contrib/dic/gerodic in case builddir != srcdir |
| 772 |
dir=Contrib/dic/gerodic |
| 773 |
if test ! -d $dir; then |
| 774 |
echo "creating $dir ..." |
| 775 |
$ac_install_sh -d $dir |
| 776 |
fi |
| 777 |
|
| 778 |
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 |
if test "x$cWnn" = "xcWnn"; then |
| 806 |
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 |
fi |
| 828 |
|
| 829 |
AC_OUTPUT(${makefiles_generic} \ |
| 830 |
${makefiles_wnn} ${makefiles_wnn_dic} \ |
| 831 |
${makefiles_cwnn} ${makefiles_cwnn_dic} \ |
| 832 |
${makefiles_kwnn} ${makefiles_kwnn_dic}) |