summaryrefslogtreecommitdiffstats
path: root/src/appl/telnet/configure.in
blob: 04173afc4c854e6f72b212b9eb3074cd1e49429c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
K5_AC_INIT(configure.in)
CONFIG_RULES
dnl AC_CONFIG_SUBDIRS(libtelnet telnet telnetd)
dnl
dnl from old libtelnet/configure.in, plus additional header & func checks
dnl
AC_REPLACE_FUNCS([strcasecmp strdup setsid strerror strftime getopt herror parsetos])
AC_CHECK_FUNCS(setenv unsetenv getenv gettosbyname cgetent gettosbyname vsnprintf)
AC_CHECK_HEADERS(stdlib.h string.h unistd.h arpa/nameser.h sys/select.h arpa/inet.h sys/filio.h curses.h utmp.h sys/time.h sys/tty.h sac.h sys/ptyvar.h sys/stream.h sys/utsname.h memory.h)
if test $ac_cv_func_setenv = no || test $ac_cv_func_unsetenv = no \
  || test $ac_cv_func_getenv = no; then
  SETENVSRC=setenv.c
  SETENVOBJ=setenv.o
  AC_SUBST([SETENVSRC])
  AC_SUBST([SETENVOBJ])
  AC_DEFINE([NEED_SETENV],1,[Define if setenv needs to be defined])
fi
dnl
KRB5_NEED_PROTO([#include <stdlib.h>],setenv)
AC_C_CONST
if test "$KRB4_LIB" = ''; then
	AC_MSG_RESULT(No Kerberos 4 authentication)
else
	AC_MSG_RESULT(Kerberos 4 authentication enabled)
	AC_DEFINE(KRB4,1,[Define if krb4 authentication is enabled])
fi
KRB5_BUILD_LIBRARY_STATIC
KRB5_BUILD_LIBOBJS
dnl
old_LIBS="$LIBS"
dnl
dnl from old telnet/configure.in
dnl
AC_PROG_INSTALL
AC_FUNC_VFORK
AC_HEADER_STDARG
case $krb5_cv_host in
*-*-solaris*)
	if test "$krb5_cv_prog_gcc" = yes; then
		# Solaris 8 at least has curses.h that is noisy under gcc
		ac_cv_header_curses_h=yes
	fi
	;;
esac
dnl
dnl On some systems, term.h requires curses.h inclusion
AC_CHECK_HEADERS(term.h,,,dnl
[#ifdef HAVE_CURSES_H
#include <curses.h>
#endif
])
dnl
AC_CHECK_LIB(termcap,main,AC_DEFINE(TERMCAP,1,[Define if termcap library is available])
LIBS="$LIBS -ltermcap")
AC_CHECK_LIB(curses,setupterm,LIBS="$LIBS -lcurses",
  AC_CHECK_LIB(ncurses,setupterm,LIBS="$LIBS -lncurses")
)
AC_CHECK_FUNC(tgetent, , [AC_MSG_ERROR([Could not find tgetent; are you missing a curses/ncurses library?])])
KRB5_AC_INET6
AC_CHECK_FUNCS(setupterm)
AC_CHECK_HEADER(termios.h,AC_DEFINE(USE_TERMIO,1,[Define if termio should be used]) ac_termio=1)
if test -z "$ac_termio"; then
AC_CHECK_HEADER(termio.h,AC_DEFINE(SYSV_TERMIO,1,[Define if SysV termio interface is found]),ac_sysv_termio=1)
if test -z "$ac_sysv_termio"; then
  AC_MSG_CHECKING([for cc_t in termio.h])
  AC_CACHE_VAL(krb_cv_type_cc_t,
  [AC_TRY_LINK([cc_t],[#include <termio.h>],
  [cc_t foo;],krb_cv_type_cc_t=yes,krb_cv_type_cc_t=no)])
  AC_MSG_RESULT($krb_cv_type_cc_t)
  if test $krb_cv_type_cc_t = no; then
    AC_DEFINE(NO_CC_T,1,[Define if termio.h does not define type cc_t])
  fi
fi
fi
KRB5_NEED_PROTO([#include <unistd.h>
#include <stdlib.h>],parsetos,1)
dnl
KRB5_NEED_PROTO([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>],herror,1)
dnl
CHECK_SIGNALS
if test "$KRB4_LIB" = ''; then
	AC_MSG_RESULT(No Kerberos 4 authentication)
else
	AC_MSG_RESULT(Kerberos 4 authentication enabled)
	AC_DEFINE(KRB4)
fi
dnl
KRB5_BUILD_PROGRAM
dnl
TELNET_LIBS="$LIBS"
AC_SUBST(TELNET_LIBS)
LIBS="$old_LIBS"
dnl
dnl from old telnetd/configure.in
dnl
dnl AC_PROG_INSTALL
AC_CHECK_LIB(termcap,main,AC_DEFINE(TERMCAP)
LIBS="$LIBS -ltermcap",
  AC_CHECK_LIB(curses,setupterm,LIBS="$LIBS -lcurses",
  AC_CHECK_LIB(ncurses,setupterm,LIBS="$LIBS -lncurses")
))
dnl ... whole termios.h/termio.h/NO_CC_T thing again ...
AC_HEADER_TIME
dnl KRB5_AC_INET6
dnl
dnl Test if speed_t needs to be defined
AC_CACHE_CHECK([if speed_t is defined], krb5_cv_type_speed_t,
[AC_TRY_COMPILE(dnl
[#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
#ifndef	USE_TERMIO
#include <sgtty.h>
#else
# ifdef	SYSV_TERMIO
# include <termio.h>
# else
# include <termios.h>
# endif
#endif
],[speed_t termspeed],krb5_cv_type_speed_t=yes, krb5_cv_type_speed_t=no)])
if test $krb5_cv_type_speed_t = no; then
   AC_DEFINE(speed_t, int, [Define if system termios interface doesn't define speed_t])
fi;
dnl
dnl
dnl Make our operating system-specific security checks and definitions for
dnl login.
dnl
case $krb5_cv_host in
*-*-hpux*)
     broken_streams=yes
     ;;
*-*-linux*)
     # Someday Linux may have a Streams user-level interface, so checking
     # for sys/stream.h may not always work.  But I'm reasonably
     # sure Linux will never require pushing magic streams modules onto 
     # pty's! :-)   --- TYT
     broken_streams=yes
     ;;
*-*-irix*)
     # Irix doesn't have a working granpt, and more over
     # you can't push anything onto a pty, so telnetd really
     # Really wants to treat it as if it doesn't have streams
     broken_streams=yes
     ;;
esac
if test -z "$broken_streams" -a "$ac_cv_header_sys_stream_h" = yes; then
    AC_CHECK_FUNC(grantpt,AC_DEFINE(STREAMSPTY,1,[Define if streams pty interface should be used]))
fi
AC_MSG_CHECKING([if setpgrp takes two arguments])
dnl
AC_CACHE_VAL(krb5_cv_sys_setpgrp_two,
[AC_TRY_LINK( 
[#include <unistd.h>],[setpgrp(0,0)],
krb5_cv_sys_setpgrp_two=yes,krb5_cv_sys_setpgrp_two=no)])
AC_MSG_RESULT($krb5_cv_sys_setpgrp_two)
if test $krb5_cv_sys_setpgrp_two = yes; then
  AC_DEFINE(SETPGRP_TWOARG,1,[Define if setpgrp takes two arguments])
fi
dnl
KRB5_NEED_PROTO([#include <stdlib.h>],unsetenv,1)
dnl KRB5_NEED_PROTO([#include <stdlib.h>],setenv,1)
dnl KRB5_BUILD_PROGRAM
dnl
TELNETD_LIBS="$LIBS"
AC_SUBST(TELNETD_LIBS)
LIBS="$old_LIBS"
dnl
KRB5_AC_LIBUTIL
V5_AC_OUTPUT_MAKEFILE(. libtelnet telnet telnetd)