1 dnl telnet.m4--telnet special macros
3 dnl $Id: telnet.m4,v 1.13 2006/02/25 18:36:36 cg2v Exp $
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")
12 AC_DEFUN([CMU_TELNET_CC_T],
14 AC_MSG_CHECKING(for cc_t definition)
15 AC_CACHE_VAL(cmu_cv_cc_t_definition, [
18 #ifdef HAVE_SYS_TERMIOS_H
19 #include <sys/termios.h>
21 #ifdef HAVE_SYS_TERMIO_H
22 #include <sys/termio.h>
27 cmu_cv_cc_t_definition=yes,
28 cmu_cv_cc_t_definition=no)
30 if test "$cmu_cv_cc_t_definition" = "no"; then
31 AC_DEFINE(NO_CC_T,, [The type `cc_t' is not available])
33 AC_MSG_RESULT($cmu_cv_cc_t_definition)
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
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
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, [
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)
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
65 AC_MSG_RESULT($cmu_cv_des_string_to_key_proto)
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, [
74 char des_key_sched(int foo, int bar);
76 [des_key_sched(NULL, NULL);],
77 cmu_cv_des_key_sched_proto=no,
78 cmu_cv_des_key_sched_proto=yes)
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
83 AC_MSG_RESULT($cmu_cv_des_key_sched_proto)
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, [
92 char des_set_random_generator_seed(int foo, int bar);
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)
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
101 AC_MSG_RESULT($cmu_cv_des_set_random_generator_seed_proto)
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, [
110 char des_new_random_key(int foo, int bar);
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)
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
119 AC_MSG_RESULT($cmu_cv_des_new_random_key_proto)
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, [
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)
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
137 AC_MSG_RESULT($cmu_cv_des_ecb_encrypt_proto)
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"
150 AC_CHECK_FUNCS(cgetent)
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])
158 if test -f "/etc/issue"; then
159 AC_DEFINE(ISSUE_FILE, "/etc/issue", [path of issue file to use])
164 AC_DEFUN([CMU_TELNET_PTYDIR], [
166 if test -d /dev/pts -o -d /dev/pty; then
171 AC_DEFINE(PTYDIR,, [Has /dev/ptX and pty allocation funcs])
174 AC_DEFINE(PTYDIR,, [Has /dev/ptX and pty allocation funcs])
175 AC_DEFINE(STREAMSPTY,, [ptys are streams devices])