AC_INIT(skkserv/skkserv.c)
AC_CONFIG_HEADER(config.h)

AC_SUBST(DBMLIB)
AC_SUBST(EMACS)
AC_SUBST(JISYO)
AC_SUBST(PRIVATE)

AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET

AC_CHECK_LIB(socket, setsockopt, [LIBS="$LIBS -lsocket -lnsl"])

AC_CHECK_HEADERS(sys/ioctl.h fcntl.h malloc.h)

AC_HEADER_STDC
AC_PROG_GCC_TRADITIONAL
AC_FUNC_SETPGRP
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(bzero tiocnotty getdtablesize)

AC_CHECK_FUNC(dbm_open, , [DBMLIB="-ldbm"])

AC_ARG_WITH(emacs,
[  --with-emacs=emacs      Set Emacs program name if you use other Emacs],
[EMACS="$withval"],
[EMACS="emacs"])

AC_ARG_WITH(jisyo,
[  --with-jisyo=jisyo      Select jisyo file name (default is SKK-JISYO.L)],
[JISYO="$withval"],
[JISYO="SKK-JISYO.L"])

AC_ARG_ENABLE(private,
[  --enable-private        Make private skkserver if you can't be a superuser],
[PRIVATE="-DPRIVATE"])

AC_OUTPUT(Makefile skkserv/Makefile jisyo-tools/Makefile
          lisp/Makefile doc/Makefile etc/Makefile)
