
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@574 ec53bebd-3082-4978-b11e-865c3cabbd6b
292 lines
5.7 KiB
Plaintext
292 lines
5.7 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_CACHE_VAL(krb_cv_ld_flags,
|
|
krb_cv_ld_flags="") dnl
|
|
LD_FLAGS=${krb_cv_ld_flags}
|
|
AC_SUBST(CFLAGS) dnl
|
|
AC_SUBST(LDFLAGS) dnl
|
|
AC_SUBST(LD_FLAGS) 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'
|
|
LIBROKEN='-L$(libtop)/lib/roken -lroken'
|
|
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"
|
|
LIBROKEN="-lroken"
|
|
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(LIBROKEN)
|
|
|
|
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, but alas that file is broken in
|
|
# AIX414
|
|
#
|
|
|
|
if test -f /lib/pse.exp ;then
|
|
LIBS="$LIBS -Wl,-bI:/lib/pse.exp"
|
|
fi
|
|
|
|
AC_FIND_FUNC(tgetent, termcap)
|
|
AC_FIND_FUNC(setupterm, curses)
|
|
AC_FIND_FUNC(socket, socket)
|
|
AC_FIND_FUNC(gethostbyname, nsl)
|
|
|
|
|
|
AC_CHECK_FUNCS(cgetent getstr cgetstr uname vhangup)
|
|
AC_CHECK_FUNCS(frevoke revoke setsid setpgid getmsg)
|
|
AC_CHECK_FUNCS(tgetent setupterm ptsname ttyname unlockpt grantpt)
|
|
|
|
AC_FIND_FUNC(logout, util)
|
|
AC_FIND_FUNC(logwtmp, util)
|
|
|
|
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/str_tty.h)
|
|
AC_CHECK_HEADERS(sys/tty.h termio.h termios.h utmpx.h sys/uio.h)
|
|
|
|
|
|
# Simple test for streamspty, based on the existance of getmsg(), alas
|
|
# this breaks on SunOS4 which have streams but BSD-like ptys
|
|
#
|
|
# And also something wierd has happend with dec-osf1, fallback to bsd-ptys
|
|
|
|
AC_MSG_CHECKING(for streamspty)
|
|
case "`uname -sr`" in
|
|
SunOS\ 4*|OSF1*)
|
|
krb_cv_sys_streamspty=no
|
|
;;
|
|
AIX*)
|
|
os_rel=`uname -v`.`uname -r`
|
|
if expr "$os_rel" : "3*" >/dev/null 2>&1; then
|
|
krb_cv_sys_streamspty=no
|
|
else
|
|
krb_cv_sys_streamspty="$ac_cv_func_getmsg"
|
|
fi
|
|
;;
|
|
*)
|
|
krb_cv_sys_streamspty="$ac_cv_func_getmsg"
|
|
;;
|
|
esac
|
|
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)
|