
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@229 ec53bebd-3082-4978-b11e-865c3cabbd6b
296 lines
6.0 KiB
Plaintext
296 lines
6.0 KiB
Plaintext
#
|
|
# configure script for telnet
|
|
#
|
|
# $Id$
|
|
#
|
|
|
|
|
|
|
|
AC_INIT(telnet/telnet.c)
|
|
AC_CONFIG_HEADER(config.h)
|
|
|
|
# This may be overridden using --prefix=/usr to configure
|
|
AC_PREFIX_DEFAULT(/usr/athena)
|
|
|
|
# We want these before the checks, so the checks can modify their values.
|
|
test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
|
|
test -z "$LDFLAGS" && LDFLAGS=-g
|
|
|
|
AC_PROG_CC
|
|
AC_PROG_RANLIB
|
|
AC_PROG_CPP
|
|
|
|
# If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
|
|
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
|
|
|
|
AC_SUBST(CFLAGS)dnl
|
|
AC_SUBST(LDFLAGS)dnl
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_TYPE_SIGNAL
|
|
|
|
dnl
|
|
dnl NEXTSTEP is not posix compliant by default,
|
|
dnl you need a switch -posix to the compiler
|
|
dnl
|
|
AC_MSG_CHECKING(for NEXTSTEP)
|
|
AC_CACHE_VAL(krb_cv_sys_nextstep,
|
|
AC_EGREP_CPP(yes,
|
|
[#ifdef NeXT
|
|
yes
|
|
#endif
|
|
], krb_cv_sys_nextstep=yes, krb_cv_sys_nextstep=no) )
|
|
test $krb_cv_sys_nextstep = "yes" && CFLAGS="$CFLAGS -posix"
|
|
test $krb_cv_sys_nextstep = "yes" && LIBS="$LIBS -posix"
|
|
AC_MSG_RESULT($krb_cv_sys_nextstep)
|
|
|
|
#
|
|
# authentication
|
|
#
|
|
|
|
AC_MSG_CHECKING(for authentication)
|
|
|
|
AC_ARG_ENABLE(authentication, [ --enable-authentication configure with authentication],
|
|
[
|
|
if test "$enableval" = no; then
|
|
do_authentication=no
|
|
else
|
|
do_authentication=yes
|
|
fi
|
|
unset telnet_cv_opt_authentication
|
|
],[
|
|
do_authentication=yes
|
|
])
|
|
|
|
AC_CACHE_VAL(telnet_cv_opt_authentication,
|
|
telnet_cv_opt_authentication=$do_authentication)
|
|
|
|
if test "$telnet_cv_opt_authentication" != no; then
|
|
AC_DEFINE(AUTHENTICATION)
|
|
AC_DEFINE(KRB4)
|
|
fi
|
|
|
|
AC_MSG_RESULT($telnet_cv_opt_authentication)
|
|
|
|
AC_SUBST(AUTHENTICATION)
|
|
AC_SUBST(KRB4)
|
|
|
|
#
|
|
# encryption
|
|
#
|
|
|
|
|
|
AC_MSG_CHECKING(for encryption)
|
|
|
|
AC_ARG_ENABLE(encryption, [ --enable-encryption configure with encryption],
|
|
[
|
|
if test "$enableval" = no; then
|
|
do_encryption=no
|
|
else
|
|
do_encryption=yes
|
|
fi
|
|
unset telnet_cv_opt_encryption
|
|
],[
|
|
do_encryption=$telnet_cv_opt_authentication
|
|
])
|
|
|
|
AC_CACHE_VAL(telnet_cv_opt_encryption,
|
|
telnet_cv_opt_encryption=$do_encryption)
|
|
|
|
if test "$telnet_cv_opt_encryption" != no; then
|
|
AC_DEFINE(ENCRYPTION)
|
|
AC_DEFINE(DES_ENCRYPTION)
|
|
fi
|
|
|
|
AC_MSG_RESULT($telnet_cv_opt_encryption)
|
|
|
|
AC_SUBST(ENCRYPTION)
|
|
AC_SUBST(DES_ENCRYPTION)
|
|
|
|
|
|
#
|
|
# locate kerberos libraries
|
|
#
|
|
|
|
AC_MSG_CHECKING([for kerberos tree])
|
|
telnet_athena_default=yes
|
|
AC_ARG_WITH(athena,
|
|
[ --with-athena=path location of athena tree],
|
|
[
|
|
case "$withval" in
|
|
yes)
|
|
telnet_athena_default="/usr/athena"
|
|
;;
|
|
no)
|
|
telnet_athena_default="no"
|
|
;;
|
|
*)
|
|
telnet_athena_default="$withval"
|
|
;;
|
|
esac
|
|
])
|
|
|
|
if test "$telnet_athena_default" = yes; then
|
|
|
|
libtop='../../..'
|
|
KRBLIBPATH=""
|
|
LIBKRB='-L$(libtop)/lib/krb -lkrb'
|
|
LIBDES='-L$(libtop)/lib/des -ldes'
|
|
LIBKAFS='-L$(libtop)/lib/kafs -lkafs'
|
|
LIBCOM_ERR='-L$(libtop)/util/et -lcom_err'
|
|
KRBINCPATH='-I$(libtop)/include -I$(srcdir)/$(libtop)/include'
|
|
telnet_msg="default"
|
|
|
|
elif test "$telnet_athena_default" = no; then
|
|
|
|
if test "$telnet_cv_opt_encryption" = yes -o "$telnet_cv_opt_authentication" = yes; then
|
|
|
|
AC_MSG_ERROR([Kerberos libraries are needed for authentication and encryption])
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
libtop="$telnet_athena_default"
|
|
KRBLIBPATH='-L$(libtop)/lib'
|
|
LIBKRB="-lkrb"
|
|
LIBDES="-ldes"
|
|
LIBKAFS="-lkafs"
|
|
LIBCOM_ERR="-lcom_err"
|
|
KRBINCPATH='-I$(libtop)/include'
|
|
telnet_msg="$telnet_athena_default"
|
|
|
|
fi
|
|
|
|
AC_SUBST(libtop)
|
|
AC_SUBST(KRBINCPATH)
|
|
AC_SUBST(KRBLIBPATH)
|
|
AC_SUBST(LIBKRB)
|
|
AC_SUBST(LIBDES)
|
|
AC_SUBST(LIBKAFS)
|
|
AC_SUBST(LIBCOM_ERR)
|
|
|
|
AC_MSG_RESULT($telnet_msg)
|
|
|
|
#
|
|
# default im
|
|
#
|
|
|
|
|
|
AC_MSG_CHECKING(for default im)
|
|
|
|
AC_ARG_ENABLE(default-im, [ --enable-default-im[=ARG] default initial banner], [
|
|
|
|
if test "$enableval" != yes; then
|
|
default_im=$enableval
|
|
else
|
|
os_ver=`uname -s`
|
|
case $os_ver in
|
|
AIX)
|
|
os_rel=`uname -v`.`uname -r`
|
|
;;
|
|
*)
|
|
os_rel=`uname -r`
|
|
;;
|
|
esac
|
|
|
|
default_im="$os_ver $os_rel (%h) (%t)"
|
|
fi
|
|
unset telnet_cv_opt_default_im
|
|
], [
|
|
default_im=no
|
|
])
|
|
AC_CACHE_VAL(telnet_cv_opt_default_im, telnet_cv_opt_default_im="$default_im")
|
|
|
|
if test "$telnet_cv_opt_default_im" != no; then
|
|
AC_DEFINE_UNQUOTED(USE_IM, "$telnet_cv_opt_default_im")
|
|
fi
|
|
|
|
AC_MSG_RESULT($telnet_cv_opt_default_im)
|
|
|
|
AC_SUBST(USE_IM)
|
|
|
|
#
|
|
# misc options
|
|
#
|
|
|
|
AC_DEFINE(DIAGNOSTICS)
|
|
AC_SUBST(DIAGNOSTICS)
|
|
|
|
AC_DEFINE(KLUDGELINEMODE)
|
|
AC_SUBST(KLUDGELINEMODE)
|
|
|
|
AC_DEFINE(OLD_ENVIRON)
|
|
AC_SUBST(OLD_ENVIRON)
|
|
|
|
#
|
|
# AIX needs /lib/pse.exp for getmsg
|
|
#
|
|
if test -f /lib/pse.exp ; then LIBS="$LIBS -bI:/lib/pse.exp"; fi
|
|
|
|
AC_CHECK_LIB(termcap, tgetent)
|
|
AC_CHECK_LIB(curses, setupterm)
|
|
AC_CHECK_LIB(socket, socket)
|
|
AC_CHECK_LIB(nsl, gethostbyname)
|
|
|
|
|
|
AC_REPLACE_FUNCS(getent herror memmove setenv strdup strerror strftime)
|
|
AC_CHECK_FUNCS(cgetent getstr cgetstr uname vhangup)
|
|
AC_CHECK_FUNCS(frevoke revoke setsid setpgid getmsg)
|
|
AC_CHECK_FUNCS(tgetent setupterm mktime ptsname ttyname unlockpt grantpt)
|
|
|
|
dnl if test $ac_cv_func_tgetent = no; then
|
|
dnl # tgetent is not in the default libraries. See if it's in some other.
|
|
dnl for lib in termcap; do
|
|
dnl AC_CHECK_LIB($lib, tgetent, [AC_DEFINE(HAVE_TGETENT)
|
|
dnl LIBS="$LIBS -l$lib"; break])
|
|
dnl done
|
|
dnl fi
|
|
dnl
|
|
dnl if test $ac_cv_func_setupterm = no; then
|
|
dnl # setupterm is not in the default libraries. See if it's in some other.
|
|
dnl for lib in curses; do
|
|
dnl AC_CHECK_LIB($lib, setupterm, [AC_DEFINE(HAVE_SETUPTERM)
|
|
dnl LIBS="$LIBS -l$lib"; break])
|
|
dnl done
|
|
dnl fi
|
|
|
|
dnl # these two are mainly here for solaris
|
|
dnl AC_CHECK_FUNCS(socket)
|
|
dnl if test "$ac_cv_func_socket" = no; then
|
|
dnl AC_CHECK_LIB(socket, socket)
|
|
dnl fi
|
|
dnl AC_CHECK_FUNCS(gethostbyname)
|
|
dnl if test "$ac_cv_func_gethostbyname" = no; then
|
|
dnl AC_CHECK_LIB(nsl, gethostbyname)
|
|
dnl fi
|
|
|
|
AC_CHECK_LIB(util, logout)
|
|
|
|
AC_SUBST(HAVE_LIBTERMCAP)
|
|
|
|
AC_CHECK_HEADERS(sys/filio.h sys/ioctl.h sys/ptyvar.h sys/resource.h)
|
|
AC_CHECK_HEADERS(sys/select.h sys/stream.h sys/strtty.h sys/tty.h)
|
|
AC_CHECK_HEADERS(termio.h termios.h utmpx.h)
|
|
|
|
|
|
#
|
|
# Simple test for streamspty, based on the existance of getmsg()
|
|
#
|
|
|
|
|
|
AC_MSG_CHECKING(for streamspty)
|
|
krb_cv_sys_streamspty="$ac_cv_func_getmsg"
|
|
|
|
if test "$krb_cv_sys_streamspty" = yes; then
|
|
AC_DEFINE(STREAMSPTY)
|
|
fi
|
|
AC_SUBST(STREAMSPTY)
|
|
AC_MSG_RESULT($krb_cv_sys_streamspty)
|
|
|
|
|
|
###
|
|
|
|
AC_OUTPUT(Makefile libtelnet/Makefile telnet/Makefile telnetd/Makefile)
|