GSS_S_PROMPTING_NEEDED is a bit
[cyrus-sasl.git] / cmulocal / telnet.m4
1 dnl telnet.m4--telnet special macros
2 dnl Derrick Brashear
3 dnl $Id: telnet.m4,v 1.13 2006/02/25 18:36:36 cg2v Exp $
4
5 AC_DEFUN([CMU_TELNET_WHICH_TERM], [
6 AC_CHECK_LIB(termlib, setupterm, [
7 AC_DEFINE(HAVE_SETUPTERM,, [Define to 1 if you have the `setupterm' function.]) 
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,, [The type `cc_t' is not available])
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,, [STREAMS are available])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,, [Use termios for tty configuration])dnl
45         if test "$ac_cv_header_sys_termios_h" = "no"; then
46                 AC_DEFINE(SYSV_TERMIO,, [Use SysV termios])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,, [define to 1 if `des_string_to_key' has a prototype])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);
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,, [define to 1 if `des_key_sched' has a prototype])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);
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,, [define to 1 if `des_set_random_generator_seed' has a prototype])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);
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,, [define to 1 if `des_new_random_key' has a prototype])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,, [define to 1 if `des_ecb_encrypt' has a prototype])dnl
136 fi
137 AC_MSG_RESULT($cmu_cv_des_ecb_encrypt_proto)
138 ])
139
140 AC_DEFUN([CMU_TELNET_GETTYTAB], [
141          if test -f "/etc/gettytab"; then
142                 AC_CHECK_FUNCS(getent getstr)
143                 if test "X$ac_cv_func_getent" != "Xyes"; then
144                         AC_DEFINE(HAVE_GETTYTAB,, [gettytab support is present])
145                         if test "X$ac_cv_func_getstr" = "Xyes"; then
146                                 CFLAGS="$CFLAGS -Dgetstr=ggetstr"
147                         fi
148                 fi
149          else
150                 AC_CHECK_FUNCS(cgetent)
151          fi
152          ])
153
154 AC_DEFUN([CMU_TELNET_ISSUE], [
155          if test -f "/etc/issue.net"; then
156                 AC_DEFINE(ISSUE_FILE, "/etc/issue.net", [path of issue file to use])
157          else
158                 if test -f "/etc/issue"; then
159                         AC_DEFINE(ISSUE_FILE, "/etc/issue", [path of issue file to use])
160                 fi
161          fi
162          ])
163
164 AC_DEFUN([CMU_TELNET_PTYDIR], [
165
166          if test -d /dev/pts -o -d /dev/pty; then
167                 case "${host}" in
168                   *-*-irix*)
169                     ;;
170                   *-*-linux*)
171                     AC_DEFINE(PTYDIR,, [Has /dev/ptX and pty allocation funcs])
172                     ;;
173                   *)
174                     AC_DEFINE(PTYDIR,, [Has /dev/ptX and pty allocation funcs])
175                     AC_DEFINE(STREAMSPTY,, [ptys are streams devices])
176                     ;;
177                 esac
178          fi
179          ])
180