dnl Process this file with autoconf to produce a configure script. AC_INIT(configure.in) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(TSXtelnet, 1.7) test "$CFLAGS" = "" && CFLAGS="-O" dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_RANLIB AC_ARG_PROGRAM dnl Checks for libraries. AC_ARG_ENABLE(ncurses, [ --disable-ncurses don't look for -lncurses]) AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(nsl, gethostbyname) AC_CHECK_LIB(resolv, gethostname) AC_CHECK_LIB(util, logout) AC_CHECK_LIB(dl, dlopen) if test -z "$LIBTERM" then AC_CHECK_LIB(termlib, setupterm, LIBTERM="-ltermlib") fi if test "$enable_ncurses" != "no" -a -z "$LIBTERM" then AC_CHECK_LIB(ncurses, setupterm, LIBTERM="-lncurses") fi if test "$enable_curses" != "no" -a -z "$LIBTERM" then AC_CHECK_LIB(curses, setupterm, LIBTERM="-lcurses") fi if test -z "$LIBTERM" then AC_CHECK_LIB(termcap, tgetent, LIBTERM="-ltermcap") AC_DEFINE(TERMCAP) fi LIBS="$LIBTERM $LIBS" dnl AC_CHECK_LIB(termlib, setupterm, LIBS="-ltermlib $LIBS", AC_DEFINE(TERMCAP) LIBS="-ltermcap $LIBS") dnl Checks for header files. AC_CHECK_HEADER(utmpx.h, AC_DEFINE(UTMPX)) AC_CHECK_HEADERS(bsdsetjmp.h errno.h getopt.h netinet/in_systm.h netinet/ip.h \ sac.h stdarg.h string.h sys/filio.h sys/ptyvar.h sys/spt.h \ sys/stream.h sys/tty.h sys/time.h sys/types.h sys/un.h \ termio.h termios.h) AC_HEADER_TIME AC_TRY_COMPILE([ #include #include ], [ struct utmp u; u.ut_tv.tv_sec = 0; ], AC_DEFINE(HAVE_UTMP_UT_TV)) AC_TRY_COMPILE([ #include #include ], [ struct utmpx u; u.ut_tv.tv_sec = 0; ], AC_DEFINE(HAVE_UTMPX_UT_TV)) AC_TRY_COMPILE([ #include #include #ifdef HAVE_UTMPX_H #include #else #include #endif ], [ #ifdef HAVE_UTMPX_H struct utmpx u; #else struct utmp u; #endif u.ut_user;], AC_DEFINE(UT_USER, ut_user), AC_DEFINE(UT_USER, ut_name)) dnl Checks for compiler characteristics. AC_C_BIGENDIAN dnl Checks for library functions. AC_FUNC_VFORK AC_FUNC_SETPGRP AC_REPLACE_FUNCS([strcasecmp setenv getent getopt strdup strftime strerror herror parsetos strchr strrchr]) AC_CHECK_FUNCS([grantpt mktime modutx makeutx ptsname updwtmpx unlockpt vhangup]) AC_CHECK_FUNC(memmove, , LIBOBJS="$LIBOBJS mem.o") AC_CHECK_FUNC(gettosbyname, AC_DEFINE(HAS_GETTOS)) dnl AC_CHECK_FUNC(modutx, AC_DEFINE(UTMPX)) dnl User options. AC_ARG_ENABLE(noencryption, [ --enable-noencryption disable encryption]) AC_ARG_WITH(inet6, [ --with-inet6 compile with IPv6 support]) if test "$with_inet6" = "yes" then AC_DEFINE(INET6) CPPFLAGS="$CPPFLAGS -I/usr/inet6/include" LIBS="-L/usr/inet6/lib -linet6 $LIBS" fi dnl Math library options. AC_ARG_WITH(openssl, [ --with-openssl=DIR compile to use OpenSSL (look in DIR if given)], OPENSSLDIR=$withval, with_openssl=no) AC_ARG_WITH(cryptolib, [ --with-cryptolib=DIR compile to use CryptoLib (look in DIR if given)], CRYPTOLIBDIR=$withval, with_cryptolib=no) AC_ARG_WITH(gmp, [ --with-gmp=DIR compile to use GNU MP (look in DIR if given)], GMPDIR=$withval, with_gmp=no) AC_ARG_WITH(gcrypt, [ --with-gcrypt=DIR compile to use libgcrypt (look in DIR if given)], GCRYPTDIR=$withval, with_gcrypt=no) AC_ARG_WITH(mpi, [ --with-mpi=DIR compile to use MPI (look in DIR if given)], MPIDIR=$withval, with_mpi=no) AC_ARG_WITH(tomcrypt, [ --with-tomcrypt=DIR compile to use libtomcrypt (look in DIR if given)], TOMCRYPTDIR=$withval, with_tomcrypt=no) AC_ARG_WITH(tommath, [ --with-tommath=DIR compile to use libtommath (look in DIR if given)], TOMMATHDIR=$withval, with_tommath=no) if test "$with_gmp" != "no" then AC_DEFINE(GNU_MP) LIBS="-lgmp $LIBS" if test "$GMPDIR" != "yes"; then LIBS="-L$GMPDIR/.libs -L$GMPDIR $LIBS" CPPFLAGS="-I$GMPDIR $CPPFLAGS" fi elif test "$with_gcrypt" != "no" then AC_DEFINE(GCRYPT) LIBS="-lgcrypt $LIBS" if test "$GCRYPTDIR" != "yes"; then LIBS="-L$GCRYPTDIR/src/.libs -L$GCRYPTDIR $LIBS" CPPFLAGS="-I$GCRYPTDIR $CPPFLAGS" fi elif test "$with_mpi" != "no" then AC_DEFINE(MPI) LIBS="-lmpi $LIBS" if test "$MPIDIR" != "yes"; then LIBS="-L$MPIDIR $LIBS" CPPFLAGS="-I$MPIDIR $CPPFLAGS" fi elif test "$with_tomcrypt" != "no" then AC_DEFINE(TOMCRYPT) AC_DEFINE(TOMMATH) LIBS="-ltomcrypt $LIBS" if test "$TOMCRYPTDIR" != "yes"; then LIBS="-L$TOMCRYPTDIR $LIBS" CPPFLAGS="-I$TOMCRYPTDIR/src/headers $CPPFLAGS" fi elif test "$with_tommath" != "no" then AC_DEFINE(TOMMATH) LIBS="-ltommath $LIBS" if test "$TOMMATHDIR" != "yes"; then LIBS="-L$TOMMATHDIR $LIBS" CPPFLAGS="-I$TOMMATHDIR $CPPFLAGS" fi elif test "$with_cryptolib" != "no" then AC_DEFINE(CRYPTOLIB) LIBS="-lcrypt $LIBS" if test "$CRYPTOLIBDIR" != "yes"; then LIBS="-L$CRYPTOLIBDIR/cryptolib/lib $LIBS" CPPFLAGS="-I$CRYPTOLIBDIR/cryptolib/include $CPPFLAGS" fi else if test "$with_openssl" = "no"; then with_openssl="yes" OPENSSLDIR="yes" fi AC_DEFINE(OPENSSL) LIBS="-lcrypto $LIBS" TLSOK="1" if test "$OPENSSLDIR" != "yes"; then LIBS="-L$OPENSSLDIR/lib -L$OPENSSLDIR $LIBS" CPPFLAGS="-I$OPENSSLDIR/include $CPPFLAGS" fi fi dnl Authentication types. AC_DEFINE(AUTHENTICATION) AC_ARG_WITH(srp, [ --with-srp compile with SRP support]) AC_ARG_WITH(krb4, [ --with-krb4 compile with kerberos4 support]) AC_ARG_WITH(krb5, [ --with-krb5=DIR compile with kerberos5 support (look in DIR if given)]) AC_ARG_WITH(spx, [ --with-spx compile with SPX support]) AC_ARG_WITH(rsaencpwd, [ --with-rsaencpwd compile with RSA_ENCPWD support]) AC_ARG_WITH(krb4encpwd, [ --with-krb4encpwd compile with KRB4_ENCPWD support]) AC_ARG_ENABLE(krb_fwd, [ --enable-krb_fwd enable forwarding of Kerberos credentials]) dnl Encryption options. AC_ARG_WITH(cast, [ --with-cast compile with CAST5 (RFC 2144) encryption support]) AC_ARG_WITH(des, [ --with-des=DIR compile with DES encryption support (look in DIR if given)]) AC_ARG_WITH(rsa, [ --without-rsa OpenSSL is built without RSA support], RSA=$withval) if test "$with_srp" != "no" then AC_DEFINE(HAVE_SRP) CPPFLAGS="$CPPFLAGS -I../../libsrp" LIBS="-L../../libsrp -lsrp $LIBS" fi if test -n "$with_krb5" -a "$with_krb5" != "no" then AC_DEFINE(KRB5) LIBS="-lkrb5 -lk5crypto -lcom_err $LIBS" if test "$with_krb5" != "yes" then CPPFLAGS="$CPPFLAGS -I$with_krb5/include -I$with_krb5/include/krb5" LIBS="-L$with_krb5/lib $LIBS" fi if test "$enable_krb_fwd" != "no" then AC_DEFINE(FORWARD) fi if test -z "$with_des" then with_des=yes fi fi if test -n "$with_krb4" -a "$with_krb4" != "no" then if test -n "$with_krb5" -a "$with_krb5" != "no" then AC_DEFINE(KRB4) LIBS="-lkrb4 $LIBS" if test "$with_krb5" != "yes" then LIBS="-L$with_krb5/lib $LIBS" CPPFLAGS="$CPPFLAGS -I$with_krb5/include/kerberosIV" fi else AC_DEFINE(KRB4C) LIBS="-lkrb -lcom_err $LIBS" if test "$with_krb4" != "yes" then LIBS="-L$with_krb4/lib $LIBS" CPPFLAGS="$CPPFLAGS -I$with_krb4/include" fi if test -z "$with_des" then with_des=yes fi fi fi if test "$with_spx" = "yes" then AC_DEFINE(SPX) fi if test "$with_rsaencpwd" = "yes" then AC_DEFINE(RSA_ENCPWD) fi if test "$with_krb4encpwd" = "yes" then AC_DEFINE(KRB4_ENCPWD) fi if test "$with_cast" != "no" -a "$enable_noencryption" != "yes" then if test -z "$with_cast" then if test "$with_openssl" != "no" -o "$with_tomcrypt" != "no" then with_cast="yes" else with_cast="no" fi fi if test "$with_cast" = "yes" then AC_DEFINE(CAST_ENCRYPTION) if test "$with_openssl" != "no" then AC_DEFINE(OPENSSL_CAST) elif test "$with_tomcrypt" != "no" then AC_DEFINE(TOMCRYPT_CAST) fi fi fi if test "$with_des" != "no" -a "$enable_noencryption" != "yes" then if test -z "$with_des" then if test "$with_openssl" != "no" -o "$with_cryptolib" != "no" then with_des="yes" else with_des="no" fi fi if test "$with_des" = "yes" then AC_DEFINE(DES_ENCRYPTION) if test "$with_openssl" != "no" then AC_DEFINE(OPENSSL_DES) elif test "$with_cryptolib" != "no" then AC_DEFINE(CRYPTOLIB_DES) elif test -n "$with_krb5" -a "$with_krb5" != "no" then AC_DEFINE(DESLIB4) LIBS="$LIBS -ldes425" elif test -n "$with_krb4" -a "$with_krb4" != "no" then AC_DEFINE(DESLIB4) LIBS="$LIBS -ldes" else AC_DEFINE(DESLIB3) LIBS="$LIBS -ldes" fi elif test "$with_des" != "no" then AC_DEFINE(DES_ENCRYPTION) AC_DEFINE(DESLIB3) LIBS="$LIBS -L$with_des -ldes" fi fi if test "$enable_noencryption" != "yes" then if test "$with_cast" != "no" -o "$with_des" != "no" then AC_DEFINE(ENCRYPTION) fi fi if test "$RSA" = "no" then AC_DEFINE(NO_RSA) fi dnl Other options AC_ARG_ENABLE(tls, [ --disable-tls disable TLS security], , enable_tls=yes) AC_ARG_ENABLE(tls_sfc, [ --enable-tls_sfc enable TLS session file cache (EXPERIMENTAL)], , enable_tls_sfc=no) AC_ARG_WITH(tls_sfc-dir, [ --with-tls_sfc-dir=DIR TLS server session file cache in DIR [LOCALSTATEDIR/state/tls_sfc]], TLS_SFC_DIR=$withval, TLS_SFC_DIR=\$\(localstatedir\)/state/tls_sfc) AC_SUBST(TLS_SFC_DIR) AC_ARG_ENABLE(tls_krb5, [ --enable-tls_krb5 enable Kerberos5-based TLS authentication (EXPERIMENTAL)], AC_DEFINE(TLS_KRB5)) if test "$enable_tls" = "yes" -a -n "$TLSOK" then AC_DEFINE(TLS) LIBS="-lssl $LIBS" if test -n "$OPENSSLDIR" -a "$OPENSSLDIR" != "yes"; then LIBS="-L$OPENSSLDIR $LIBS" fi if test "$enable_tls_sfc" = "yes"; then AC_DEFINE(TLS_SESSION_FILE_CACHE) fi fi AC_ARG_WITH(zlib, [ --with-zlib=DIR compile with zlib compression support (look in DIR if given)]) if test -n "$with_zlib" -a "$with_zlib" != "no" then if test "$with_zlib" != "yes" then LIBS="$LIBS -L$with_zlib" fi LIBS="$LIBS -lz" AC_DEFINE(ZLIB) fi AC_ARG_ENABLE(forward_x, [ --disable-forward_x disable FORWARD_X support], , enable_forward_x=yes) AC_ARG_ENABLE(fwdx_xdm, [ --disable-fwdx_xdm disable XDM-AUTHORIZATION-1 together with FORWARD_X], , enable_fwdx_xdm=yes) AC_ARG_ENABLE(fwdx_loopback, [ --disable-fwdx_loopback disable use of ip loopback addr (127.0.0.1) together with FORWARD_X], , enable_fwdx_loopback=yes) AC_ARG_ENABLE(fwdx_unix_sock, [ --disable-fwdx_unix_sock disable use of unix domain sockets together with FORWARD_X], , enable_fwdx_unix_sock=yes) if test "$enable_forward_x" = yes; then if test "$enable_fwdx_xdm" = yes; then AC_DEFINE(FWDX_XDM) fi if test "$enable_fwdx_loopback" = yes; then AC_DEFINE(FWDX_LOOPBACK) fi if test "$enable_fwdx_unix_sock" = yes; then AC_DEFINE(FWDX_UNIX_SOCK) fi AC_DEFINE(FWD_X) fi dnl Configurable options. AC_DEFINE(ENV_HACK) AC_DEFINE(OLD_ENVIRON) AC_DEFINE(KLUDGELINEMODE) AC_DEFINE(DIAGNOSTICS) AC_DEFINE(TJW) dnl Find host type and set parameters. AC_CANONICAL_HOST changequote(,)dnl version_num=`expr "${host}" : '.*[^0-9.]\([0-9.]*\)$'` changequote([,])dnl case "${host}" in *bsdi*) AC_DEFINE_UNQUOTED(DEFAULT_IM, "\r\nBSDI BSD/OS ${version_num} (%h) (%t)\r\n\r\r\n\r") ;; *bsd*) AC_DEFINE_UNQUOTED(DEFAULT_IM, "\r\n${version_num}BSD UNIX (%h) (%t)\r\n\r\r\n\r") ;; *reno*) AC_DEFINE_UNQUOTED(DEFAULT_IM, "\r\n${version_num}BSD-Reno UNIX (%h) (%t)\r\n\r\r\n\r") ;; *tahoe*) AC_DEFINE_UNQUOTED(DEFAULT_IM, "\r\n${version_num}BSD-Tahoe UNIX (%h) (%t)\r\n\r\r\n\r") ;; *unicos*) AC_DEFINE_UNQUOTED(DEFAULT_IM, "\r\nCray UNICOS ${version_num} (%h) (%t)\r\n\r\r\n\r") ;; *sunos*) AC_DEFINE_UNQUOTED(DEFAULT_IM, "\r\nSunOS UNIX ${version_num} (%h) (%t)\r\n\r\r\n\r") ;; *solaris2*) AC_DEFINE_UNQUOTED(DEFAULT_IM, "\r\n\r\nUNIX(r) System V Release 4.0 (%h)\r\n\r\n") ;; *linux*) AC_DEFINE_UNQUOTED(DEFAULT_IM, "\r\n\r\nLinux(r) Release ${version_num} (%h)\r\n\r\n") ;; *dynix*) AC_DEFINE_UNQUOTED(DEFAULT_IM, "\r\nDYNIX(R) V${version_num} (%h) (%t)\r\n\r\r\n\r") ;; *ultrix*) AC_DEFINE_UNQUOTED(DEFAULT_IM, "\r\nULTRIX V${version_num} (%h) (%t)\r\n\r\r\n\r") ;; *irix*) AC_DEFINE_UNQUOTED(DEFAULT_IM, "\r\n\r\nIRIX System V.4 (%h) (%t)\r\n\r\r\n\r") ;; *osf*) AC_DEFINE_UNQUOTED(DEFAULT_IM, "\r\n\r\nOSF/1 (%h) (%t)\r\n\r\r\n\r") ;; *hpux*) AC_DEFINE_UNQUOTED(DEFAULT_IM, "\r\n\r\nHP-UX (%h) (%t)\r\n\r\r\n\r") ;; esac case "${host}" in *unicos*) AC_DEFINE(signal, bsdsignal) ;; esac case "${host}" in *solaris2*) AC_DEFINE(SOLARIS) ;; *irix*) AC_DEFINE(IRIX) ;; *linux*) AC_DEFINE(LINUX) ;; *osf*) AC_DEFINE(OSF) ;; *sco*) AC_DEFINE(SCO) ;; esac case "${host}" in *bsd* | *unicos* | *reno* | *tahoe*) AC_DEFINE(LINEMODE) ;; esac case "${host}" in *unicos*) AC_DEFINE(SYSV_TERMIO) ;; esac case "${host}" in *unicos6*) AC_DEFINE(NEWINIT) ;; esac case "${host}" in *sunos3*) AC_DEFINE(HAVE_fd_set) ;; esac case "${host}" in *solaris2* | *aix*) AC_DEFINE(STREAMSPTY) ;; esac AC_ARG_ENABLE(loginf, [ --enable-loginf use if /bin/login supports -f]) case "${host}" in *sunos4* | *solaris2.[[234678]]* | *ultrix4.3* | irix[5-9]*) if test "$enable_loginf" != "yes" then AC_DEFINE(NO_LOGIN_F) AC_DEFINE(LOGIN_R) fi;; *bsd* | *reno* | *tahoe* | *solaris2* | *linux* | *hpux* | *dynix* | *osf* | *next* | *aix* | *sco*) if test "$enable_loginf" = "no" then AC_DEFINE(NO_LOGIN_F) AC_DEFINE(LOGIN_R) fi;; *unicos[[7-9]]*) if test "$enable_loginf" = "no" then AC_DEFINE(NO_LOGIN_F) fi;; *) if test "$enable_loginf" != "yes" then AC_DEFINE(NO_LOGIN_F) fi esac case "${host}" in *unicos6* | *hpux* | *solaris2.[[234]]* | *aix* | *sco*) AC_DEFINE(NO_LOGIN_P) AC_DEFINE(LOGIN_ARGS) ;; *bsd* | *reno* | *tahoe* | *unicos[[7-9]]* | *sunos4* | *solaris2* | *linux* | *dynix* | *osf* | *next* | *convex*) ;; *) AC_DEFINE(NO_LOGIN_P) esac case "${host}" in *sco*) AC_DEFINE(NO_LOGIN_H) ;; esac dnl Generate Makefiles. AC_OUTPUT(Makefile arpa/Makefile libtelnet/Makefile telnet/Makefile telnetd/Makefile)