Mercurial > freewnn
annotate configure.in @ 29:35bc1f2e3f14 default tip
minor fix
| author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
|---|---|
| date | Sat, 06 Mar 2010 23:55:24 +0900 |
| parents | 6dcfbd28e807 |
| children |
| rev | line source |
|---|---|
| 0 | 1 dnl |
| 2 dnl $Id: configure.in,v 1.48 2006/09/25 17:31:35 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 | |
| 15 dnl | |
| 16 dnl Maintainer: FreeWnn Project | |
| 17 dnl | |
| 18 dnl This program is free software; you can redistribute it and/or modify | |
| 19 dnl it under the terms of the GNU General Public License as published by | |
| 20 dnl the Free Software Foundation; either version 2 of the License, or | |
| 21 dnl (at your option) any later version. | |
| 22 dnl | |
| 23 dnl This program is distributed in the hope that it will be useful, | |
| 24 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 25 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 26 dnl GNU General Public License for more details. | |
| 27 dnl | |
| 28 dnl You should have received a copy of the GNU General Public License | |
| 29 dnl along with this program; if not, write to the Free Software | |
| 30 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 31 dnl | |
| 32 | |
| 33 dnl | |
| 34 dnl Process this file with autoconf to produce a configure script. | |
| 35 dnl | |
| 36 dnl new AC_INIT do not work. I seem to make a mistake... | |
| 37 dnl AC_INIT("FreeWnn", "1.11-pl21", "freewnn-users-owner@lists.sourceforge.jp") | |
| 38 dnl AC_CONFIG_SRC_DIR(Wnn/conv/cvt_head.h) | |
| 39 AC_INIT(Wnn/conv/cvt_head.h) | |
| 40 AC_CONFIG_HEADER(config.h) | |
|
26
6dcfbd28e807
- added build target; maintainer-clean
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
20
diff
changeset
|
41 AC_CONFIG_MACRO_DIR([m4]) |
| 0 | 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 if test $libraries = true; then | |
| 99 SUBDIRS="\$(LIB_SUBDIRS)" | |
| 100 WNNMANDIR="\$(LIB_WNNMANDIR)" | |
| 101 fi | |
| 102 if test $server = true; then | |
| 103 SUBDIRS="$SUBDIRS \$(SERVER_SUBDIRS)" | |
| 104 WNNMANDIR="$WNNMANDIR \$(SERVER_WNNMANDIR)" | |
| 105 fi | |
| 106 if test $client = true; then | |
| 107 SUBDIRS="$SUBDIRS \$(CLIENT_SUBDIRS)" | |
| 108 dnl currently client is only uum and its man is in SERVER_WNNMANDIR | |
| 109 dnl WNNMANDIR=$WNNMANDIR \$(CLIENT_WNNMANDIR)" | |
| 110 fi | |
| 111 | |
| 112 AC_SUBST(SUBDIRS) | |
| 113 AC_SUBST(WNNMANDIR) | |
| 114 | |
| 115 dnl For Severs | |
| 116 | |
| 117 AC_ARG_ENABLE(Wnn, | |
| 118 [ --enable-Wnn build and install Wnn [[default=yes]]], | |
| 119 [case "${enableval}" in | |
| 120 yes) Wnn="Wnn";; | |
| 121 no) Wnn="" ;; | |
| 122 *) AC_MSG_ERROR(bad value for --enable-Wnn) ;; | |
| 123 esac], Wnn="Wnn") | |
| 124 AC_SUBST(Wnn) | |
| 125 | |
| 126 if test "$server" = true -a "$Wnn" = Wnn; then | |
| 127 # JSERVER_SUBDIRS1="\$(JSERVER_SUBDIRS1)" | |
| 128 JSERVER_SUBDIRS2="\$(JSERVER_SUBDIRS2)" | |
| 129 else | |
| 130 # JSERVER_SUBDIRS1="" | |
| 131 JSERVER_SUBDIRS2="" | |
| 132 fi | |
| 133 dnl AC_SUBST(JSERVER_SUBDIRS1) | |
| 134 AC_SUBST(JSERVER_SUBDIRS2) | |
| 135 | |
| 136 AC_ARG_ENABLE(cWnn, | |
|
18
e7e2aba67cb3
disabled build for cWnn and kWnn by default
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
17
diff
changeset
|
137 [ --enable-cWnn build and install cWnn [[default=no]]], |
| 0 | 138 [case "${enableval}" in |
| 139 yes) cWnn="cWnn" ;; | |
| 140 no) cWnn="" ;; | |
| 141 *) AC_MSG_ERROR(bad value for --enable-cWnn) ;; | |
|
18
e7e2aba67cb3
disabled build for cWnn and kWnn by default
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
17
diff
changeset
|
142 esac], cWnn="") |
| 0 | 143 AC_SUBST(cWnn) |
| 144 | |
| 145 AC_ARG_ENABLE(kWnn, | |
|
18
e7e2aba67cb3
disabled build for cWnn and kWnn by default
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
17
diff
changeset
|
146 [ --enable-kWnn build and install kWnn [[default=no]]], |
| 0 | 147 [case "${enableval}" in |
| 148 yes) kWnn="kWnn" ;; | |
| 149 no) kWnn="" ;; | |
| 150 *) AC_MSG_ERROR(bad value for --enable-kWnn) ;; | |
|
18
e7e2aba67cb3
disabled build for cWnn and kWnn by default
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
17
diff
changeset
|
151 esac], kWnn="") |
| 0 | 152 AC_SUBST(kWnn) |
| 153 | |
| 154 dnl For a library libwnn | |
| 155 | |
| 156 dnl AC_ARG_WITH(libwnn, | |
| 157 dnl [ --with-libwnn use installed Wnn library [default=no]], | |
| 158 dnl [case "${withval}" in | |
| 159 dnl yes|no) with_libwnn=${withval};; | |
| 160 dnl *) AC_MSG_ERROR(invalid argument to --with-libwnn) ;; | |
| 161 dnl esac], with_libwnn=no) | |
| 162 dnl | |
| 163 | |
| 164 AC_ARG_WITH(libwnn, | |
| 165 [ --with-libwnn use installed Wnn library [[default=no]]], | |
| 166 [ with_libwnn="${withval}" | |
| 167 AC_ARG_WITH(wnn-includes, | |
| 168 [ --with-wnn-includes=DIR WNN include files are in DIR], | |
| 169 [wnnincludedir="-I${withval}"], [wnnincludedir='']) | |
| 170 AC_ARG_WITH(wnn-libraries, | |
| 171 [ --with-wnn-libraries=DIR Search for WNN libraries in DIR [[default=/usr/local/lib]]], | |
| 172 [wnnlibdir="${withval}"], [wnnlibdir='/usr/local/lib']) | |
| 173 if test "X${with_libwnn}" = X-lwnn; then | |
| 174 WNNJLIB="-L${wnnlibdir} -lwnn" | |
| 175 elif test X"`echo ${with_libwnn} | grep '^/.*'`" != X ; then | |
| 176 WNNJLIB="${with_libwnn}" | |
| 177 else | |
| 178 WNNJLIB="${wnnlibdir}/libwnn.a" | |
| 179 fi | |
| 180 DEPWNNJLIB="" | |
| 181 HINSI_DATA="\$(JWNNWNNDIR)/hinsi.data" | |
| 182 ], | |
| 183 [ WNNJLIB="\$(top_builddir)/Wnn/jlib/libwnn.la" | |
| 184 DEPWNNJLIB="\$(WNNJLIB)" | |
| 185 HINSI_DATA="\$(top_builddir)/Wnn/jd/hinsi.data" | |
| 186 ]) | |
| 187 AC_SUBST(WNNJLIB) | |
| 188 AC_SUBST(DEPWNNJLIB) | |
| 189 AC_SUBST(HINSI_DATA) | |
| 190 | |
| 191 AC_ARG_WITH(libcwnn, | |
| 192 [ --with-libcwnn use installed cWnn library [[default=no]]], | |
| 193 [ | |
| 194 AC_ARG_WITH(cwnn-includes, | |
| 195 [ --with-cwnn-includes=DIR CWNN include files are in DIR], | |
| 196 [cwnnincludedir="-I${withval}"], [cwnnincludedir='']) | |
| 197 AC_ARG_WITH(cwnn-libraries, | |
| 198 [ --with-cwnn-libraries=DIR Search for CWNN libraries in DIR [[default=/usr/local/lib]]], | |
| 199 [cwnnlibdir="${withval}"], [cwnnlibdir='/usr/local/lib']) | |
| 200 if test "X${with_libcwnn}" = X-lcwnn; then | |
| 201 CWNNJLIB="-L${cwnnlibdir} -lcwnn" | |
| 202 elif test X"`echo ${with_libcwnn} | grep '^/.*'`" != X ; then | |
| 203 CWNNJLIB="${with_libcwnn}" | |
| 204 else | |
| 205 CWNNJLIB="${cwnnlibdir}/libcwnn.a" | |
| 206 fi | |
| 207 DEPCWNNJLIB="" | |
| 208 CHINSI_DATA="\$(CWNNWNNDIR)/cixing.data" | |
| 209 THINSI_DATA="\$(TWNNTDSRC)/cixing.data" | |
| 210 ], | |
| 211 [ CWNNJLIB="\$(top_builddir)/cWnn/jlib/libcwnn.la" | |
| 212 DEPCWNNJLIB="\$(CWNNJLIB)" | |
| 213 CHINSI_DATA="\$(CWNNCDSRC)/cixing.data" | |
| 214 THINSI_DATA="\$(TWNNTDSRC)/cixing.data" | |
| 215 ]) | |
| 216 AC_SUBST(CWNNJLIB) | |
| 217 AC_SUBST(DEPCWNNJLIB) | |
| 218 AC_SUBST(CHINSI_DATA) | |
| 219 AC_SUBST(THINSI_DATA) | |
| 220 | |
| 221 AC_ARG_WITH(libkwnn, | |
| 222 [ --with-libkwnn use installed kWnn library [[default=no]]], | |
| 223 [ | |
| 224 AC_ARG_WITH(kwnn-includes, | |
| 225 [ --with-kwnn-includes=DIR KWNN include files are in DIR], | |
| 226 [kwnnincludedir="-I${withval}"], [kwnnincludedir='']) | |
| 227 AC_ARG_WITH(kwnn-libraries, | |
| 228 [ --with-kwnn-libraries=DIR Search for KWNN libraries in DIR [[default=/usr/local/lib]]], | |
| 229 [kwnnlibdir="${withval}"], [kwnnlibdir='/usr/local/lib']) | |
| 230 if test "X${with_libkwnn}" = X-lkwnn; then | |
| 231 KWNNJLIB="-L${kwnnlibdir} -lkwnn" | |
| 232 elif test X"`echo ${with_libkwnn} | grep '^/.*'`" != X ; then | |
| 233 KWNNJLIB="${with_libkwnn}" | |
| 234 else | |
| 235 KWNNJLIB="${kwnnlibdir}/libkwnn.a" | |
| 236 fi | |
| 237 DEPKWNNJLIB="" | |
| 238 KHINSI_DATA="\$(KWNNWNNDIR)/hinsi.data" | |
| 239 ], | |
| 240 [ KWNNJLIB="\$(top_builddir)/kWnn/jlib/libkwnn.la" | |
| 241 DEPKWNNJLIB="\$(KWNNJLIB)" | |
| 242 KHINSI_DATA="\$(KWNNKDSRC)/hinsi.data" | |
| 243 ]) | |
| 244 AC_SUBST(KWNNJLIB) | |
| 245 AC_SUBST(DEPKWNNJLIB) | |
| 246 AC_SUBST(KHINSI_DATA) | |
| 247 | |
| 248 dnl | |
| 249 dnl Build Options | |
| 250 dnl | |
| 251 | |
| 252 AC_ARG_ENABLE(ipv6, | |
| 253 [ --enable-ipv6 build and install IPv6 [[default=no]]], | |
| 254 [case "${enableval}" in | |
| 255 yes) ipv6="-DINET6";; | |
| 256 no) ipv6="" ;; | |
| 257 *) AC_MSG_ERROR(bad value for --enable-ipv6) ;; | |
| 258 esac], ipv6="") | |
| 259 AC_SUBST(ipv6) | |
| 260 | |
| 261 AC_ARG_ENABLE(unsafe-path, | |
| 262 [ --enable-unsafe-path allow creating files in an arbitrary path [[default=no]]], | |
| 263 [case "${enableval}" in | |
| 264 yes) unsafe_path=true;; | |
| 265 no) unsafe_path=false;; | |
| 266 *) AC_MSG_ERROR(bad value for --enable-unsafe-path) ;; | |
| 267 esac], unsafe_path=false) | |
| 268 AC_SUBST(unsafe_path) | |
| 269 | |
| 270 if test ${unsafe_path} = true; then | |
| 271 AC_DEFINE(WNN_ALLOW_UNSAFE_PATH, 1, | |
| 272 [Define to allow writing to other than JSERVERDIR.]) | |
| 273 fi | |
| 274 | |
| 275 dnl | |
| 276 dnl Checks for cc and cpp. | |
| 277 dnl | |
| 278 AC_PROG_CC | |
| 279 | |
| 280 dnl System specific options | |
| 281 dnl Now that we are using autoconf, CCOPTIONS should be nuked... | |
| 282 dnl But please report if your system needs specific settings (CCOPTIONS etc.) | |
| 283 case $host in | |
| 284 *-*-linux*) | |
| 285 CCOPTIONS="-Dlinux -D_GNU_SOURCE -D_POSIX_SOURCE -D_BSD_SOURCE" | |
| 286 ;; | |
| 287 *-*-darwin*) | |
| 288 if test $GCC = yes; then | |
| 289 # Unfortunately, autoconf (at least 2.57) does not recognize | |
| 290 # proper CPP. (Normal cpp-precomp nor auto-retrying in basic mode does | |
| 291 # not work with pubdic+ processing.) So define here .... | |
| 292 # Note: It seems gcc-3.3 (or (probably) later) does not need this. | |
| 293 CPP=${CPP:-"$CC -E -no-cpp-precomp"} | |
| 294 fi | |
| 295 # Don't care other CC-s. | |
| 296 ;; | |
| 297 *-*-sunos*) | |
| 298 if test $GCC = yes; then | |
| 299 CCOPTIONS="-Dsun -Dsparc" | |
| 300 else | |
| 301 CCOPTIONS="" | |
| 302 fi | |
| 303 ;; | |
| 304 *-*-solaris2.*) | |
| 305 # Will 'solaris*' be OK? | |
| 306 if test $GCC = yes; then | |
| 307 CCOPTIONS="-Dsun -D`uname -p` -DSVR4 -DSYSV" | |
| 308 else | |
| 309 CCOPTIONS="-Xc -xF -xcg92 -Dsun -D`uname -p` -DSVR4 -DSYSV" | |
| 310 fi | |
| 311 ;; | |
| 312 *-*-hpux*) | |
| 313 if test $GCC = yes; then | |
| 314 CCOPTIONS="-Dhpux -DSYSV" | |
| 315 else | |
| 316 CCOPTIONS="-Ae -Dhpux -DSYSV" | |
| 317 fi | |
| 318 ;; | |
| 319 i[[34567]]86-pc-beos*) | |
| 320 CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE" | |
| 321 ;; | |
| 322 powerpc-*-beos*) | |
| 323 CCOPTIONS="-DBEOS -D_POSIX_SOURCE -D_BSD_SOURCE" | |
| 324 ;; | |
| 325 *-*-aix*) | |
| 326 CCOPTIONS="-DSYSV" | |
| 327 ;; | |
| 328 esac | |
| 329 | |
| 330 dnl Checking if we use gcc or not | |
| 331 if test $debug = true; then | |
| 332 if test $GCC = yes; then | |
| 333 # FIXME: gcc -fstack-check doesn't work well on Linux/i386 ... | |
| 334 CDEBUGFLAGS=${CDEBUGFLAGS:-"-g2 -O2 -Wall"} | |
| 335 else | |
| 336 CDEBUGFLAGS=${CDEBUGFLAGS:-""} | |
| 337 fi | |
| 338 INSTPGMFLAGS= | |
| 339 else | |
| 340 CDEBUGFLAGS=${CDEBUGFLAGS:-""} | |
| 341 INSTPGMFLAGS="-s" | |
| 342 fi | |
| 343 AC_SUBST(CCOPTIONS) | |
| 344 AC_SUBST(CDEBUGFLAGS) | |
| 345 AC_SUBST(INSTPGMFLAGS) | |
| 346 | |
| 347 echo "Set CDEBUGFLAGS and CCOPTIONS to following:" | |
| 348 echo ' CDEBUGFLAGS="'"$CDEBUGFLAGS"'"' | |
| 349 echo ' CCOPTIONS="'"$CCOPTIONS"'"' | |
| 350 | |
| 351 dnl ¼«Æ°Ç§¼±¤Ç·èÄꤵ¤ì¤¿¤¯¤Ê¤¤¾ì¹ç¤Ïconfigure»þ¤Ë´Ä¶ÊÑ¿ôCPP¤òÀßÄꤻ¤è¡£ | |
| 352 dnl ¤³¤Î°ÌÃ֤ʤé¤Ð¤Þ¤À¥·¥¹¥Æ¥à¸ÇÍÉôʬ¤ÇCPP¤ò¥ª¡¼¥Ð¥é¥¤¥É¤Ç¤¤ë¤¬¡¢ | |
| 353 dnl ¡ÖCPP=${CPP:-"/usr/ccs/lib/cpp"}¡×¤Î¤´¤È¤¯¥æ¡¼¥¶¤Î°Õ»Ö¤òº½Å¤·¤¿Êý¤¬ | |
| 354 dnl ¤è¤¤¤È»×¤ï¤ì¤ë¡£ | |
| 355 AC_PROG_CPP | |
| 356 | |
| 357 dnl | |
| 358 dnl Checks for programs. | |
| 359 dnl | |
| 360 dnl ### AC_PROG_YACC | |
| 361 dnl ### AC_PROG_LEX | |
| 362 AC_PROG_INSTALL | |
| 363 AC_PROG_LN_S | |
| 364 AC_PROG_MAKE_SET | |
| 365 AC_PROG_LIBTOOL | |
| 366 AC_SUBST(LIBTOOL_DEPS) | |
| 367 | |
| 368 dnl Checks for libraries. | |
| 369 dnl ### dnl Replace `main' with a function in -lX11: | |
| 370 dnl ### AC_CHECK_LIB(X11, main) | |
| 371 dnl ### dnl Replace `main' with a function in -lcurses: | |
| 372 dnl ### AC_CHECK_LIB(curses, main) | |
| 373 | |
| 374 AC_SEARCH_LIBS(crypt, crypt) | |
| 375 AC_CHECK_LIB(socket, connect) | |
| 376 AC_CHECK_LIB(bind, getservbyname) | |
| 377 AC_CHECK_LIB(nsl, gethostbyname) | |
| 378 dnl libutil only needed by uum w/openpty... | |
| 379 dnl FIXME: deals with Linux that have both ptsname & openpty | |
| 380 AC_CHECK_LIB(util, openpty) | |
| 381 | |
| 382 dnl | |
| 383 dnl Checks for header files. | |
| 384 dnl | |
| 385 AC_PATH_X | |
| 386 AC_HEADER_STDC | |
| 387 AC_HEADER_SYS_WAIT | |
| 388 AC_HEADER_TIME | |
| 389 AC_CHECK_HEADERS(fcntl.h syslog.h unistd.h utmp.h utmpx.h \ | |
| 390 sys/file.h sys/ioctl.h sys/time.h sys/types.h sys/param.h \ | |
| 391 malloc.h strings.h memory.h \ | |
| 392 curses.h ncurses.h sgtty.h term.h termio.h termios.h \ | |
| 393 termcap.h sys/termio.h libutil.h\ | |
| 394 ) | |
| 395 | |
| 396 dnl | |
| 397 dnl Terminal library selection. | |
| 398 dnl ported from vim6.1 via canuum (Canna 3.6p3) for uum. | |
| 399 dnl FIXME: cross compilation | |
| 400 dnl | |
| 401 olibs="$LIBS" | |
| 402 CNVFILE_SUBDIR=bsd | |
| 403 AC_MSG_CHECKING(--with-term-libs argument) | |
| 404 AC_ARG_WITH(tlib, | |
| 405 [ --with-term-libs=-lLIB terminal library to be used ],) | |
| 406 if test -n "$with_term_libs"; then | |
| 407 AC_MSG_RESULT($with_term_libs) | |
| 408 dnl LIBS="$LIBS $with_term_libs" | |
| 409 TERMLIB=$with_term_libs | |
| 410 else | |
| 411 AC_MSG_RESULT([automatic terminal library selection]) | |
| 412 dnl On HP-UX 10.10 termcap or termlib should be used instead of | |
| 413 dnl curses, because curses is much slower. | |
| 414 dnl Newer versions of ncurses are preferred over anything. | |
| 415 dnl Older versions of ncurses have bugs, get a new one! | |
| 416 dnl Digital Unix (OSF1) should use curses (Ronald Schild). | |
| 417 case "`uname -s 2>/dev/null`" in | |
| 418 OSF1) tlibs="ncurses curses termlib termcap";; | |
| 419 *) tlibs="ncurses termlib termcap curses";; | |
| 420 esac | |
| 421 for libname in $tlibs; do | |
| 422 AC_CHECK_LIB(${libname}, tgetent, [ | |
| 423 dnl It's possible that a library is found but it doesn't work | |
| 424 dnl e.g., shared library that cannot be found. | |
| 425 dnl compile and run a test program to be sure | |
| 426 LIBS="${LIBS} -l${libname}" | |
| 427 AC_TRY_RUN([ | |
| 428 #ifdef HAVE_TERMCAP_H | |
| 429 # include <termcap.h> | |
| 430 #endif | |
| 431 main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }], | |
| 432 res="OK", res="FAIL", res="FAIL") | |
| 433 if test "$res" = "OK"; then | |
| 434 TERMLIB="${TERMLIB} -l${libname}" | |
| 435 dnl lname=`echo ${libname} | sed 'y/termcaplibnus/TERMCAPLIBNUS/'` | |
| 436 dnl AC_DEFINE_UNQUOTED(HAVE_${lname}, 1, [use ${libname} for terminal control]) | |
| 437 dnl We need to define AH_TEMPLATE (if we really need this) | |
| 438 dnl ex. AH_TEMPLATE(HAVE_NCURSES, [use ncurses for terminal control]) | |
| 439 break | |
| 440 fi | |
| 441 AC_MSG_RESULT($libname library is not usable) | |
| 442 ],) | |
| 443 LIBS=${olibs} | |
| 444 done | |
| 445 fi | |
| 446 if test "x$TERMLIB" != "x"; then | |
| 447 LIBS="${LIBS} ${TERMLIB}" | |
| 448 AC_MSG_CHECKING(whether we talk terminfo) | |
| 449 AC_TRY_RUN([ | |
| 450 #ifdef HAVE_TERMCAP_H | |
| 451 # include <termcap.h> | |
| 452 #endif | |
| 453 main() | |
| 454 {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }], | |
| 455 [ AC_MSG_RESULT([no -- we are in termcap land]) | |
| 456 CNVFILE_SUBDIR=bsd ], | |
| 457 [ AC_DEFINE(HAVE_TERMINFO, 1, [terminfo spoken here]) | |
| 458 AC_MSG_RESULT([yes -- terminfo spoken here]) | |
| 459 CNVFILE_SUBDIR=sysV ], | |
| 460 AC_MSG_ERROR(failed to compile test program.)) | |
| 461 else | |
| 462 AC_MSG_RESULT(none found) | |
| 463 fi | |
| 464 LIBS=${olibs} | |
| 465 AC_SUBST(TERMLIB) | |
| 466 AC_SUBST(CNVFILE_SUBDIR) | |
| 467 | |
| 468 dnl delayed check for --enable-client-utmp | |
| 469 if test $client = true; then | |
| 470 if test $client_utmp = auto; then | |
| 471 AC_EGREP_CPP(yes, [ | |
| 472 #if HAVE_SYS_PARAM_H | |
| 473 # include <sys/param.h> | |
| 474 #endif | |
| 475 #if defined(BSD) && (BSD >= 199306) | |
| 476 yes | |
| 477 #endif | |
| 478 ], client_utmp=false, client_utmp=true) | |
| 479 fi | |
| 480 | |
| 481 dnl for Debug | |
| 482 AC_MSG_CHECKING([whether we're using utmp with uum]) | |
| 483 if test $client_utmp = true; then | |
| 484 dnl We need to look again if we introduce libspt check | |
| 485 AC_DEFINE(USE_UTMP, 1, [Define to 1 if uum writes utmp entry]) | |
| 486 AC_MSG_RESULT(yes) | |
| 487 else | |
| 488 AC_MSG_RESULT(no) | |
| 489 fi | |
| 490 fi | |
| 491 | |
| 492 dnl | |
| 493 dnl Checks for typedefs, structures, and compiler characteristics. | |
| 494 dnl | |
| 495 AC_TYPE_MODE_T | |
| 496 AC_HEADER_TIME | |
| 497 | |
| 498 dnl AC_CHECK_TYPES(time_t,, | |
| 499 dnl AC_DEFINE(time_t, long, [Define missing time_t.]), | |
| 500 dnl [INCLUDES = time.h]) | |
| 501 AC_CHECK_TYPES(socklen_t,, | |
| 502 AC_DEFINE(socklen_t, int, [Define missing socklen_t.]), [ | |
| 503 #if HAVE_SYS_TYPES_H | |
| 504 # include <sys/types.h> | |
| 505 #endif | |
| 506 #include <sys/socket.h>]) | |
| 507 | |
| 508 AC_CHECK_MEMBERS([struct utmp.ut_user, struct utmp.ut_name, struct utmp.ut_id],,,[ | |
| 509 #include <sys/types.h> | |
| 510 #if HAVE_UTMPX_H | |
| 511 # include <utmpx.h> | |
| 512 #endif | |
| 513 #if HAVE_UTMP_H | |
| 514 # include <utmp.h> | |
| 515 #endif]) | |
| 516 | |
| 517 dnl | |
| 518 dnl Checks for symbol | |
| 519 dnl | |
| 520 | |
| 521 dnl | |
| 522 dnl Checks for library functions. | |
| 523 dnl | |
| 524 AC_PROG_GCC_TRADITIONAL | |
| 525 | |
| 526 dnl idea borrowed from EB Library http://www.sra.co.jp/people/m-kasahr/eb/ | |
| 527 AC_TYPE_SIGNAL | |
| 528 if test "$ac_cv_type_signal" = void; then | |
| 529 AC_DEFINE(RETSIGTYPE_VOID, 1, [Define if the signal function returns void.]) | |
| 530 fi | |
| 531 | |
| 532 AC_FUNC_MEMCMP | |
| 533 AC_CHECK_FUNCS(getpgid getpgrp setpgrp wait3) | |
| 534 AC_FUNC_GETPGRP | |
| 535 AC_FUNC_SETPGRP | |
| 536 dnl FreeWnn do not use the 3rd parameter of wait3(). | |
| 537 dnl AC_FUNC_WAIT3 | |
| 538 | |
| 539 dnl NOTE: FD_SET is defined as macro on many systems. But this check | |
| 540 dnl will be done in Wnn/include/wnn_os.h , so don't care... | |
| 541 AC_CHECK_FUNCS(random drand48 fchmod getopt killpg \ | |
| 542 FD_SET \ | |
| 543 gethostname select socket closesocket setsockopt send recv \ | |
| 544 getdtablesize getrlimit syslog vsyslog setenv snprintf \ | |
| 545 ptsname posix_openpt openpty pututxline pututline setsid) | |
| 546 dnl for bcopy/index -> memcpy/strchr conversion (preparation): | |
| 547 AC_CHECK_FUNCS(bcopy bzero bcmp index rindex \ | |
| 548 memcpy memmove memset strchr strrchr) | |
| 549 | |
| 550 dnl Check fallback functions for jserver (should use AC_REPLACE_FUNCS?) | |
| 551 JS_SUPPORTOBJS= | |
| 552 AC_CHECK_FUNCS(mkdir vasprintf, , | |
| 553 [JS_SUPPORTOBJS="${JS_SUPPORTOBJS} ${ac_func}.o"]) | |
| 554 AC_SUBST(JS_SUPPORTOBJS) | |
| 555 | |
| 556 | |
| 557 dnl | |
| 558 dnl File Existence | |
| 559 dnl Checking file at compile time may bring false result when cross- | |
| 560 dnl compiling. So, one have to check generated config.h and edit it | |
| 561 dnl if necessary after running configure. | |
| 562 dnl | |
| 563 dnl AC_CHECK_FILE(/dev/ptmx, AC_DEFINE(HAVE_DEV_PTMX, 1, [/dev/ptmx found]),) | |
| 564 AC_CHECK_FILES(/dev/ptmx,,) | |
| 565 | |
| 566 | |
| 567 dnl | |
| 568 dnl FIXME: libspt support | |
| 569 dnl for example: | |
| 570 dnl | |
| 571 dnl --with-libspt[=/path/to/libspt-config] | |
| 572 dnl | |
| 573 dnl LIBSPT_CFLAGS=`/path/to/libspt-config --cflags` | |
| 574 dnl LIBSPT_LIBS=`/path/to/libspt-config --libs` | |
| 575 dnl AC_SUBST(LIBSPT_CFLAGS) | |
| 576 dnl AC_SUBST(LIBSPT_LIBS) | |
| 577 dnl AC_DEFINE(HAVE_LIBSPT, 1, [Define if you have libspt support.]) | |
| 578 | |
| 579 dnl | |
| 580 dnl TCP Wrapper. | |
| 581 dnl | |
| 582 WRAPLIB= | |
| 583 AC_MSG_CHECKING(whether to use libwrap) | |
| 584 AC_ARG_WITH(libwrap, | |
| 585 [ --with-libwrap[[=DIR]] Compile in libwrap (tcp_wrappers) support [[default=try to find libwrap]]], | |
| 586 [ case "$withval" in | |
| 587 no) | |
| 588 AC_MSG_RESULT(no) | |
| 589 WRAP_TRY=no | |
| 590 ;; | |
| 591 yes) | |
| 592 AC_MSG_RESULT(yes) | |
| 593 WRAP_TRY=yes | |
| 594 ;; | |
| 595 *) | |
| 596 AC_MSG_RESULT(yes) | |
| 597 WRAP_TRY=yes | |
| 598 if test -d "$withval"; then | |
| 599 WRAPINCLUDES="-I$withval" | |
| 600 if test -d $withval/include; then | |
| 601 WRAPINCLUDES="-I$withval/include $WRAPINCLUDES" | |
| 602 fi | |
| 603 WRAPLIB="-L$withval -lwrap" | |
| 604 if test -d $withval/lib; then | |
| 605 WRAPLIB="-L$withval/lib $WRAPLIB" | |
| 606 fi | |
| 607 else | |
| 608 WRAPINCLUDES="$withval" | |
| 609 fi | |
| 610 ;; | |
| 611 esac], | |
| 612 [AC_MSG_RESULT([try to find]) | |
| 613 WRAP_TRY=auto] | |
| 614 ) | |
| 615 # Link test for libwrap | |
| 616 if test "$WRAP_TRY" = yes -o "$WRAP_TRY" = auto; then | |
| 617 OLDCFLAGS="$CFLAGS" | |
| 618 CFLAGS="$WRAPINCLUDES $CFLAGS" | |
| 619 OLDLIBS="$LIBS" | |
| 620 WRAPLIB=${WRAPLIB:-"-lwrap"} | |
| 621 LIBS="$WRAPLIB $OLDLIBS" | |
| 622 AC_MSG_CHECKING([libwrap is working]) | |
| 623 AC_TRY_LINK([ int allow_severity; int deny_severity; ], | |
| 624 [ hosts_access(); ], | |
| 625 [ AC_MSG_RESULT(yes) | |
| 626 AC_DEFINE(HAVE_LIBWRAP, 1, | |
| 627 [Define if you have libwrap (TCP wrapper) support.]) | |
| 628 AC_SUBST(WRAPLIB)], | |
| 629 [ AC_MSG_RESULT(no) | |
| 630 if test "$WRAP_TRY" = yes; then | |
| 631 AC_MSG_ERROR([Could not find libwrap. Please check config.log.]) | |
| 632 else | |
| 633 # recover old flag / clear needless WRAPLIB and continue | |
| 634 CFLAGS=$OLDCFLAGS | |
| 635 WRAPLIB= | |
| 636 fi] ) | |
| 637 # only jserver needs libwrap, recover LIBS also | |
| 638 LIBS=$OLDLIBS | |
| 639 fi | |
| 640 | |
| 641 | |
| 642 dnl | |
| 643 dnl Creating Makefiles. | |
| 644 dnl | |
| 645 # mkdir -p Contrib/dic/gerodic in case builddir != srcdir | |
|
20
c4b8c1d2b943
added supplement.u and ldic.u
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
18
diff
changeset
|
646 for dir in Contrib/dic/gerodic Contrib/dic/supplement Contrib/dic/ldic Contrib/dic/2ch |
|
c4b8c1d2b943
added supplement.u and ldic.u
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
18
diff
changeset
|
647 do |
|
c4b8c1d2b943
added supplement.u and ldic.u
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
18
diff
changeset
|
648 if test ! -d $dir; then |
|
c4b8c1d2b943
added supplement.u and ldic.u
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
18
diff
changeset
|
649 echo "creating $dir ..." |
|
c4b8c1d2b943
added supplement.u and ldic.u
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
18
diff
changeset
|
650 $ac_install_sh -d $dir |
|
c4b8c1d2b943
added supplement.u and ldic.u
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
18
diff
changeset
|
651 fi |
|
c4b8c1d2b943
added supplement.u and ldic.u
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
18
diff
changeset
|
652 done |
| 0 | 653 |
| 654 dnl | |
| 655 dnl Generate Makefiles | |
| 656 dnl | |
| 657 | |
| 658 dnl Generic | |
| 659 | |
| 660 makefiles_generic="makerule.mk Makefile" | |
| 661 | |
| 662 dnl Japanese | |
| 663 | |
| 664 if test "x${Wnn}" = "xWnn"; then | |
| 665 makefiles_wnn="Wnn/Makefile Wnn/conv/Makefile Wnn/include/Makefile \ | |
| 666 Wnn/jd/Makefile Wnn/jd/rk/Makefile Wnn/jd/rk.vi/Makefile \ | |
| 667 Wnn/jlib/Makefile Wnn/jlib.V3/Makefile Wnn/jserver/Makefile \ | |
| 668 Wnn/jutil/Makefile Wnn/ld/Makefile Wnn/ld/rk/Makefile \ | |
| 669 Wnn/romkan/Makefile Wnn/uum/Makefile \ | |
| 670 Wnn/man/Makefile Wnn/man/2.env/Makefile Wnn/man/3.libwnn/Makefile \ | |
| 671 Wnn/man/4.cmd/Makefile Wnn/man/6.jutil/Makefile \ | |
| 672 Wnn/man/2.env/dic/Makefile Wnn/man/2.env/wnn/Makefile \ | |
| 673 Wnn/man/3.libwnn/jl_lib/Makefile Wnn/man/3.libwnn/js_lib/Makefile \ | |
| 674 Wnn/man/3.libwnn/misc_lib/Makefile Wnn/man/3.libwnn/rk_lib/Makefile" | |
|
17
a3fdd8ad75dc
2ch dictionary has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
675 makefiles_wnn_dic="Contrib/dic/gerodic/Makefile Contrib/dic/2ch/Makefile \ |
|
20
c4b8c1d2b943
added supplement.u and ldic.u
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
18
diff
changeset
|
676 Contrib/dic/supplement/Makefile Contrib/dic/ldic/Makefile\ |
|
17
a3fdd8ad75dc
2ch dictionary has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
677 Wnn/pubdicplus/Makefile \ |
| 0 | 678 Wnn/wnncons/Makefile Wnn/wnncons/dic/Makefile" |
| 679 fi | |
| 680 | |
| 681 dnl Chinese and Taiwanese | |
| 682 | |
| 683 if test "x$cWnn" = "xcWnn"; then | |
| 684 makefiles_cwnn="cWnn/Makefile cWnn/conv/Makefile cWnn/etc/Makefile \ | |
| 685 cWnn/cd/Makefile cWnn/cd/rk/Makefile \ | |
| 686 cWnn/cd/rk_p/Makefile cWnn/cd/rk_z/Makefile \ | |
| 687 cWnn/td/Makefile cWnn/td/rk/Makefile \ | |
| 688 cWnn/td/rk_z/Makefile cWnn/td/rk_p/Makefile \ | |
| 689 cWnn/include/Makefile cWnn/jlib/Makefile \ | |
| 690 cWnn/jserver/Makefile cWnn/jutil/Makefile \ | |
| 691 cWnn/man/Makefile cWnn/man/1.intro/Makefile cWnn/man/2.env/Makefile \ | |
| 692 cWnn/man/4.cmd/Makefile cWnn/man/6.jutil/Makefile \ | |
| 693 cWnn/romkan/Makefile cWnn/uum/Makefile" | |
| 694 makefiles_cwnn_dic="cWnn/cdic/Makefile cWnn/tdic/Makefile" | |
| 695 fi | |
| 696 | |
| 697 dnl Korean | |
| 698 | |
| 699 if test "x$kWnn" = "xkWnn"; then | |
| 700 makefiles_kwnn="kWnn/Makefile kWnn/conv/Makefile kWnn/etc/Makefile \ | |
| 701 kWnn/include/Makefile kWnn/jlib/Makefile kWnn/jutil/Makefile \ | |
| 702 kWnn/jserver/Makefile kWnn/kd/Makefile kWnn/kd/rk/Makefile \ | |
| 703 kWnn/romkan/Makefile kWnn/uum/Makefile" | |
| 704 makefiles_kwnn_dic="kWnn/kdic/Makefile" | |
| 705 fi | |
| 706 | |
| 707 AC_OUTPUT(${makefiles_generic} \ | |
| 708 ${makefiles_wnn} ${makefiles_wnn_dic} \ | |
| 709 ${makefiles_cwnn} ${makefiles_cwnn_dic} \ | |
| 710 ${makefiles_kwnn} ${makefiles_kwnn_dic}) |
