AC_INIT(telnet.c)
CONFIG_RULES
AC_PROG_INSTALL
AC_VFORK
AC_CHECK_HEADERS(string.h arpa/nameser.h unistd.h sys/select.h stdlib.h arpa/inet.h sys/filio.h)
AC_CHECK_LIB(termcap,main,AC_DEFINE(TERMCAP)
LIBS="$LIBS -ltermcap",
  AC_CHECK_LIB(curses,setupterm,LIBS="$LIBS -lcurses",
  AC_CHECK_LIB(ncurses,setupterm,LIBS="$LIBS -lncurses")
))
AC_CHECK_FUNCS(gettosbyname setupterm)
AC_HEADER_CHECK(termios.h,AC_DEFINE(USE_TERMIO) ac_termio=1)
if test -z "$ac_termio"; then
AC_HEADER_CHECK(termio.h,AC_DEFINE(SYSV_TERMIO),ac_sysv_termio=1)
if test -z "$ac_sysv_termio"; then
  AC_MSG_CHECKING([for cc_t in termio.h])
  AC_CACHE_VAL(krb_cv_type_cc_t,
  [AC_TRY_LINK([cc_t],[#include <termio.h>],
  [cc_t foo;],krb_cv_type_cc_t=yes,krb_cv_type_cc_t=no)])
  AC_MSG_RESULT($krb_cv_type_cc_t)
  if test $krb_cv_type_cc_t = no; then
    AC_DEFINE(NO_CC_T)
  fi
fi
fi
CHECK_SIGNALS
if test "$KRB4_LIB" = ''; then
	AC_MSG_RESULT(No Kerberos 4 authentication)
else
	AC_MSG_RESULT(Kerberos 4 authentication enabled)
	AC_DEFINE(KRB4)
fi
dnl
KRB5_BUILD_PROGRAM
V5_AC_OUTPUT_MAKEFILE
