AC_INIT(telnet.c)
CONFIG_RULES
AC_PROG_INSTALL
AC_FUNC_VFORK
AC_HEADER_STDARG
case $krb5_cv_host in
*-*-solaris*)
	if test "$krb5_cv_prog_gcc" = yes; then
		# Solaris 8 at least has curses.h that is noisy under gcc
		ac_cv_header_curses_h=yes
	fi
	;;
esac
AC_CHECK_HEADERS(string.h arpa/nameser.h unistd.h sys/select.h stdlib.h arpa/inet.h sys/filio.h curses.h)
dnl
dnl On some systems, term.h requires curses.h inclusion
AC_CHECK_HEADERS(term.h,,,dnl
[#ifdef HAVE_CURSES_H
#include <curses.h>
#endif
])
dnl
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")
))
KRB5_AC_INET6
AC_CHECK_FUNCS(gettosbyname setupterm)
AC_CHECK_HEADER(termios.h,AC_DEFINE(USE_TERMIO) ac_termio=1)
if test -z "$ac_termio"; then
AC_CHECK_HEADER(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
KRB5_NEED_PROTO([#include <unistd.h>
#include <stdlib.h>],parsetos,1)
dnl
KRB5_NEED_PROTO([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>],herror,1)
dnl
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
