| 1 |
dnl telnet.m4--telnet special macros |
| 2 |
dnl Derrick Brashear |
| 3 |
dnl $Id: telnet.m4,v 1.11 2002/05/25 19:57:42 leg Exp $ |
| 4 |
|
| 5 |
AC_DEFUN(CMU_TELNET_WHICH_TERM, [ |
| 6 |
AC_CHECK_LIB(termlib, setupterm, [ |
| 7 |
AC_DEFINE(HAVE_SETUPTERM) |
| 8 |
AC_CHECK_LIB(c, setupterm, TCLIB="/usr/ccs/lib/libtermlib.a",TCLIB="-ltermlib","/usr/ccs/lib/libtermlib.a") |
| 9 |
], TCLIB="-ltermcap") |
| 10 |
]) |
| 11 |
|
| 12 |
AC_DEFUN(CMU_TELNET_CC_T, |
| 13 |
[ |
| 14 |
AC_MSG_CHECKING(for cc_t definition) |
| 15 |
AC_CACHE_VAL(cmu_cv_cc_t_definition, [ |
| 16 |
AC_TRY_COMPILE( |
| 17 |
[ |
| 18 |
#ifdef HAVE_SYS_TERMIOS_H |
| 19 |
#include <sys/termios.h> |
| 20 |
#else |
| 21 |
#ifdef HAVE_SYS_TERMIO_H |
| 22 |
#include <sys/termio.h> |
| 23 |
#endif |
| 24 |
#endif |
| 25 |
], |
| 26 |
[cc_t ffoo;], |
| 27 |
cmu_cv_cc_t_definition=yes, |
| 28 |
cmu_cv_cc_t_definition=no) |
| 29 |
]) |
| 30 |
if test "$cmu_cv_cc_t_definition" = "no"; then |
| 31 |
AC_DEFINE(NO_CC_T) |
| 32 |
fi |
| 33 |
AC_MSG_RESULT($cmu_cv_cc_t_definition) |
| 34 |
]) |
| 35 |
|
| 36 |
AC_DEFUN(CMU_STREAMS, [ |
| 37 |
if test "$ac_cv_header_sys_stropts_h" = "yes" -o "$ac_cv_header_stropts_h" = "yes"; then |
| 38 |
AC_DEFINE(HAVE_STREAMS)dnl |
| 39 |
fi |
| 40 |
]) |
| 41 |
|
| 42 |
AC_DEFUN(CMU_TERMIO_MODEL, [ |
| 43 |
if test "$ac_cv_header_sys_termio_h" = "yes" -o "$ac_cv_header_sys_termios_h" = "yes"; then |
| 44 |
AC_DEFINE(USE_TERMIO)dnl |
| 45 |
if test "$ac_cv_header_sys_termios_h" = "no"; then |
| 46 |
AC_DEFINE(SYSV_TERMIO)dnl |
| 47 |
fi |
| 48 |
fi |
| 49 |
]) |
| 50 |
|
| 51 |
AC_DEFUN(CMU_TELNET_DES_STRING_TO_KEY_PROTO, [ |
| 52 |
AC_MSG_CHECKING(for des_string_to_key prototype) |
| 53 |
AC_CACHE_VAL(cmu_cv_des_string_to_key_proto, [ |
| 54 |
AC_TRY_COMPILE( |
| 55 |
[#include <des.h> |
| 56 |
typedef unsigned char Block[8]; |
| 57 |
int des_string_to_key(char *, Block);], |
| 58 |
[int foo = des_string_to_key(NULL, NULL);], |
| 59 |
cmu_cv_des_string_to_key_proto=no, |
| 60 |
cmu_cv_des_string_to_key_proto=yes) |
| 61 |
]) |
| 62 |
if test "$cmu_cv_des_string_to_key_proto" = yes; then |
| 63 |
AC_DEFINE(HAVE_DES_STRING_TO_KEY_PROTO)dnl |
| 64 |
fi |
| 65 |
AC_MSG_RESULT($cmu_cv_des_string_to_key_proto) |
| 66 |
]) |
| 67 |
|
| 68 |
AC_DEFUN(CMU_TELNET_DES_KEY_SCHED_PROTO, [ |
| 69 |
AC_MSG_CHECKING(for des_key_sched prototype) |
| 70 |
AC_CACHE_VAL(cmu_cv_des_key_sched_proto, [ |
| 71 |
AC_TRY_COMPILE( |
| 72 |
[ |
| 73 |
#include <des.h> |
| 74 |
char des_key_sched(int foo, int bar, int baz); |
| 75 |
], |
| 76 |
[des_key_sched(NULL, NULL);], |
| 77 |
cmu_cv_des_key_sched_proto=no, |
| 78 |
cmu_cv_des_key_sched_proto=yes) |
| 79 |
]) |
| 80 |
if test "$cmu_cv_des_key_sched_proto" = yes; then |
| 81 |
AC_DEFINE(HAVE_DES_KEY_SCHED_PROTO)dnl |
| 82 |
fi |
| 83 |
AC_MSG_RESULT($cmu_cv_des_key_sched_proto) |
| 84 |
]) |
| 85 |
|
| 86 |
AC_DEFUN(CMU_TELNET_DES_SET_RANDOM_GENERATOR_SEED_PROTO, [ |
| 87 |
AC_MSG_CHECKING(for des_set_random_generator_seed prototype) |
| 88 |
AC_CACHE_VAL(cmu_cv_des_set_random_generator_seed_proto, [ |
| 89 |
AC_TRY_COMPILE( |
| 90 |
[ |
| 91 |
#include <des.h> |
| 92 |
char des_set_random_generator_seed(int foo, int bar, int baz); |
| 93 |
], |
| 94 |
[des_set_random_generator_seed(NULL, NULL);], |
| 95 |
cmu_cv_des_set_random_generator_seed_proto=no, |
| 96 |
cmu_cv_des_set_random_generator_seed_proto=yes) |
| 97 |
]) |
| 98 |
if test "$cmu_cv_des_set_random_generator_seed_proto" = yes; then |
| 99 |
AC_DEFINE(HAVE_DES_SET_RANDOM_GENERATOR_SEED_PROTO)dnl |
| 100 |
fi |
| 101 |
AC_MSG_RESULT($cmu_cv_des_set_random_generator_seed_proto) |
| 102 |
]) |
| 103 |
|
| 104 |
AC_DEFUN(CMU_TELNET_DES_NEW_RANDOM_KEY_PROTO, [ |
| 105 |
AC_MSG_CHECKING(for des_new_random_key prototype) |
| 106 |
AC_CACHE_VAL(cmu_cv_des_new_random_key_proto, [ |
| 107 |
AC_TRY_COMPILE( |
| 108 |
[ |
| 109 |
#include <des.h> |
| 110 |
char des_new_random_key(int foo, int bar, int baz); |
| 111 |
], |
| 112 |
[des_new_random_key(NULL, NULL);], |
| 113 |
cmu_cv_des_new_random_key_proto=no, |
| 114 |
cmu_cv_des_new_random_key_proto=yes) |
| 115 |
]) |
| 116 |
if test "$cmu_cv_des_new_random_key_proto" = yes; then |
| 117 |
AC_DEFINE(HAVE_DES_NEW_RANDOM_KEY_PROTO)dnl |
| 118 |
fi |
| 119 |
AC_MSG_RESULT($cmu_cv_des_new_random_key_proto) |
| 120 |
]) |
| 121 |
|
| 122 |
AC_DEFUN(CMU_TELNET_DES_ECB_ENCRYPT_PROTO, [ |
| 123 |
AC_MSG_CHECKING(for des_ecb_encrypt prototype) |
| 124 |
AC_CACHE_VAL(cmu_cv_des_ecb_encrypt_proto, [ |
| 125 |
AC_TRY_COMPILE( |
| 126 |
[#include <des.h> |
| 127 |
typedef unsigned char Block[8]; |
| 128 |
typedef struct { Block _; } Schedule[16]; |
| 129 |
void des_ecb_encrypt(Block, Block, Schedule, int);], |
| 130 |
[int foo = des_ecb_encrypt(NULL, NULL, NULL, 0);], |
| 131 |
cmu_cv_des_ecb_encrypt_proto=no, |
| 132 |
cmu_cv_des_ecb_encrypt_proto=yes) |
| 133 |
]) |
| 134 |
if test "$cmu_cv_des_ecb_encrypt_proto" = yes; then |
| 135 |
AC_DEFINE(HAVE_DES_ECB_ENCRYPT_PROTO)dnl |
| 136 |
fi |
| 137 |
AC_MSG_RESULT($cmu_cv_des_ecb_encrypt_proto) |
| 138 |
]) |
| 139 |
|
| 140 |
AC_DEFUN(CMU_TELNET_NEWDES, [ |
| 141 |
AC_REQUIRE([CMU_KRB4]) |
| 142 |
AC_REQUIRE([CMU_KRB5]) |
| 143 |
AC_MSG_CHECKING(for des_new_random_key prototype) |
| 144 |
AC_CACHE_VAL(ac_cv_func_des_new_random_key_proto, [ |
| 145 |
AC_TRY_COMPILE( |
| 146 |
[#include <des.h> |
| 147 |
des_cblock key;], |
| 148 |
[des_new_random_key(&key);], |
| 149 |
ac_cv_func_des_new_random_key=yes, |
| 150 |
ac_cv_func_des_new_random_key=no) |
| 151 |
]) |
| 152 |
if test "$ac_cv_func_des_new_random_key" = yes; then |
| 153 |
AC_DEFINE(NEWDESLIB)dnl |
| 154 |
fi |
| 155 |
AC_MSG_RESULT($ac_cv_func_des_new_random_key) |
| 156 |
]) |
| 157 |
|
| 158 |
AC_DEFUN(CMU_TELNET_OLDNEWDES, [ |
| 159 |
AC_REQUIRE([CMU_KRB4]) |
| 160 |
AC_REQUIRE([CMU_KRB5]) |
| 161 |
saved_LIBS=$LIBS |
| 162 |
LIBS="$KRB_LIB_FLAGS $KRB5_LIB_FLAGS" |
| 163 |
if test "$with_des" = yes; then |
| 164 |
AC_CHECK_FUNCS(des_new_random_key) |
| 165 |
if test "$ac_cv_func_des_new_random_key" = yes; then |
| 166 |
AC_DEFINE(NEWDESLIB) |
| 167 |
fi |
| 168 |
fi |
| 169 |
LIBS=$saved_LIBS |
| 170 |
]) |
| 171 |
|
| 172 |
AC_DEFUN(CMU_TELNET_GETTYTAB, [ |
| 173 |
if test -f "/etc/gettytab"; then |
| 174 |
AC_CHECK_FUNCS(getent getstr) |
| 175 |
if test "X$ac_cv_func_getent" != "Xyes"; then |
| 176 |
AC_DEFINE(HAVE_GETTYTAB) |
| 177 |
if test "X$ac_cv_func_getstr" = "Xyes"; then |
| 178 |
CFLAGS="$CFLAGS -Dgetstr=ggetstr" |
| 179 |
fi |
| 180 |
fi |
| 181 |
else |
| 182 |
AC_CHECK_FUNCS(cgetent) |
| 183 |
fi |
| 184 |
]) |
| 185 |
|
| 186 |
AC_DEFUN(CMU_TELNET_ISSUE, [ |
| 187 |
if test -f "/etc/issue.net"; then |
| 188 |
AC_DEFINE(ISSUE_FILE, "/etc/issue.net") |
| 189 |
else |
| 190 |
if test -f "/etc/issue"; then |
| 191 |
AC_DEFINE(ISSUE_FILE, "/etc/issue") |
| 192 |
fi |
| 193 |
fi |
| 194 |
]) |
| 195 |
|
| 196 |
AC_DEFUN(CMU_TELNET_PTYDIR, [ |
| 197 |
|
| 198 |
if test -d /dev/pts -o -d /dev/pty; then |
| 199 |
case "${host}" in |
| 200 |
*-*-irix*) |
| 201 |
;; |
| 202 |
*-*-linux*) |
| 203 |
AC_DEFINE(PTYDIR) |
| 204 |
;; |
| 205 |
*) |
| 206 |
AC_DEFINE(PTYDIR) |
| 207 |
AC_DEFINE(STREAMSPTY) |
| 208 |
;; |
| 209 |
esac |
| 210 |
fi |
| 211 |
]) |