1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION($Revision$)
3 AC_INIT(lib/krb5/send_to_kdc.c)
4 AM_CONFIG_HEADER(include/config.h)
6 AM_INIT_AUTOMAKE(heimdal,0.0e)
8 AC_PREFIX_DEFAULT(/usr/heimdal)
12 AC_SUBST(CANONICAL_HOST)
20 dnl Checks for programs.
30 if test "$GCC" = "yes"; then
31 WFLAGS="-Wall -Wno-unused -Wmissing-prototypes"
37 AC_ARG_WITH(berkeley-db,
38 [ --without-berkeley-db if you don't want berkeley db],[
39 if test "$withval" = no; then
44 AC_TEST_PACKAGE(krb4,krb.h,libkrb.a,-lkrb)
46 if test "$with_krb4"; then
48 LIB_krb4="$KRB4LIB -ldes"
49 INCLUDE_krb4="$KRB4INCLUDE"
53 AM_CONDITIONAL(KRB4, test "$with_krb4")
55 AC_SUBST(INCLUDE_krb4)
57 AC_TEST_PACKAGE(readline,readline.h,libreadline.a,-lreadline)
64 dnl Checks for typedefs, structures, and compiler characteristics.
72 dnl Checks for header files.
75 AC_CHECK_HEADERS(arpa/inet.h arpa/telnet.h bsdsetjmp.h crypt.h)
76 AC_CHECK_HEADERS(curses.h db.h dbm.h dirent.h err.h errno.h)
77 AC_CHECK_HEADERS(fcntl.h grp.h limits.h ndbm.h net/if.h netdb.h)
78 AC_CHECK_HEADERS(netinet/in.h netinet/in6.h)
79 AC_CHECK_HEADERS(netinet/in6_machtypes.h netinet/in_systm.h)
80 AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h netinfo/ni.h paths.h pty.h pwd.h)
81 AC_CHECK_HEADERS(rpcsvc/dbm.h sac.h shadow.h signal.h stropts.h)
82 AC_CHECK_HEADERS(sys/bitypes.h sys/file.h sys/filio.h sys/ioctl.h)
83 AC_CHECK_HEADERS(sys/param.h sys/proc.h sys/pty.h sys/ptyio.h)
84 AC_CHECK_HEADERS(sys/ptyvar.h sys/resource.h sys/select.h)
85 AC_CHECK_HEADERS(sys/socket.h sys/sockio.h sys/stat.h sys/stream.h)
86 AC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/time.h sys/timeb.h)
87 AC_CHECK_HEADERS(sys/times.h sys/tty.h sys/types.h sys/uio.h)
88 AC_CHECK_HEADERS(sys/utsname.h sys/wait.h syslog.h termio.h)
89 AC_CHECK_HEADERS(termios.h tmpdir.h unistd.h util.h utmp.h utmpx.h)
91 if test "$ac_cv_header_err_h" = no; then
92 EXTRA_HDRS="$EXTRA_HDRS err.h"
96 dnl Checks for libraries.
98 AC_FIND_FUNC(socket, socket)
99 AC_FIND_FUNC(gethostbyname, nsl)
100 AC_FIND_FUNC(dbopen, $berkeley_db)
101 AC_FIND_FUNC(dbm_firstkey, $berkeley_db gdbm ndbm)
102 AC_FIND_FUNC(syslog, syslog)
104 AC_FIND_FUNC(logwtmp, util)
105 AC_FIND_FUNC_NO_LIBS(tgetent, termcap)
107 dnl Checks for library functions.
112 AC_CHECK_FUNCS(_getpty asnprintf asprintf fcntl gethostname)
113 AC_CHECK_FUNCS(getmsg grantpt logwtmp mktime ptsname rand random)
114 AC_CHECK_FUNCS(revoke select setitimer setlogin setpcred setpgid)
115 AC_CHECK_FUNCS(setsid setsockopt strstr timegm ttyname umask)
116 AC_CHECK_FUNCS(unlockpt vasnprintf vasprintf vhangup)
119 if test "$ac_cv_type_signal" = "void" ; then
120 AC_DEFINE(VOID_RETSIGTYPE, 1)
122 AC_SUBST(VOID_RETSIGTYPE)
124 AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
130 AC_BROKEN(chown daemon err errx fchown flock getcwd)
131 AC_BROKEN(getdtablesize getusershell inet_aton initgroups)
132 AC_BROKEN(lstat memmove mkstemp putenv rcmd setegid setenv)
133 AC_BROKEN(seteuid strcasecmp strdup strerror strftime)
134 AC_BROKEN(strlwr strnlen strsep strtok_r strupr unsetenv)
135 AC_BROKEN(verr verrx vsyslog vwarn vwarnx warn warnx)
137 AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [
138 ac_cv_func_realloc_broken=no
145 return realloc(NULL, 17) == NULL;
147 ],:, ac_cv_func_realloc_broken=yes, :)
149 if test "$ac_cv_func_realloc_broken" = yes ; then
150 AC_DEFINE(BROKEN_REALLOC)
153 dnl AC_KRB_FUNC_GETCWD_BROKEN
156 dnl Checks for prototypes and declarations
174 AC_CHECK_VAR([#ifdef HAVE_SYS_TYPES_H
175 #include <sys/types.h>
182 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
187 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
192 AC_CHECK_VAR([#ifdef HAVE_ERR_H
194 #endif],[__progname])
196 AC_CHECK_DECLARATION([#include <stdlib.h>], optarg)
197 AC_CHECK_DECLARATION([#include <stdlib.h>], optind)
198 AC_CHECK_DECLARATION([#include <stdlib.h>], opterr)
199 AC_CHECK_DECLARATION([#include <stdlib.h>], optopt)
202 dnl Check for fields in struct utmp
204 AC_EGREP_HEADER(ut_user, utmp.h, AC_DEFINE(HAVE_UT_USER))
205 AC_EGREP_HEADER(ut_host, utmp.h, AC_DEFINE(HAVE_UT_HOST))
206 AC_EGREP_HEADER(ut_addr, utmp.h, AC_DEFINE(HAVE_UT_ADDR))
207 AC_EGREP_HEADER(ut_type, utmp.h, AC_DEFINE(HAVE_UT_TYPE))
208 AC_EGREP_HEADER(ut_pid, utmp.h, AC_DEFINE(HAVE_UT_PID))
209 AC_EGREP_HEADER(ut_id, utmp.h, AC_DEFINE(HAVE_UT_ID))
210 AC_EGREP_HEADER(ut_syslen, utmpx.h, AC_DEFINE(HAVE_UT_SYSLEN))
213 dnl Check for struct winsize
216 AC_KRB_STRUCT_WINSIZE
219 dnl Check for sa_len in struct sockaddr
222 AC_KRB_STRUCT_SOCKADDR_SA_LEN
225 dnl Check for some common types
232 AC_CHECK_TYPE(ssize_t, int)
235 dnl AC_SUBST(LIBOBJS)
237 AC_GROK_TYPES(int8_t int16_t int32_t int64_t)
238 AC_GROK_TYPES(u_int8_t u_int16_t u_int32_t u_int64_t)
241 dnl Tests for editline
244 AC_FIND_FUNC_NO_LIBS(el_init, edit)
245 AC_FIND_FUNC_NO_LIBS(readline, readline)
247 if test "$with_readline"; then
248 AC_DEFINE(HAVE_READLINE, 1)
250 LIB_readline="$READLINELIB "'$(LIB_tgetent)'
251 INCLUDE_readline="$READLINEINCLUDE"
252 elif test "$ac_cv_func_el_init" = yes; then
253 AC_DEFINE(HAVE_READLINE, 1)
255 editline_OBJS=edit_compat.o
256 LIB_readline='-L$(top_builddir)/lib/editline -leditline '"$LIB_el_init"' $(LIB_tgetent)'
258 INCLUDE_readline='-I$(top_builddir)/lib/editline -I$(top_srcdir)/lib/editline'
259 elif test "$ac_cv_func_readline" = yes; then
260 AC_DEFINE(HAVE_READLINE, 1)
262 LIB_readline='-lreadline $(LIB_tgetent)'
265 AC_DEFINE(HAVE_READLINE, 1)
266 editline_OBJS="editline.o complete.o sysunix.o"
267 LIB_readline='-L$(top_builddir)/lib/editline -leditline $(LIB_tgetent)'
268 INCLUDE_readline='-I$(top_builddir)/lib/editline -I$(top_srcdir)/lib/editline'
270 AC_SUBST(LIB_tgetent)
271 AC_SUBST(LIB_readline)
272 AC_SUBST(INCLUDE_readline)
273 AC_SUBST(editline_OBJS)
275 dnl telnet muck --------------------------------------------------
277 AC_DEFINE(AUTHENTICATION)dnl
279 AC_DEFINE(ENCRYPTION)dnl
280 AC_DEFINE(DES_ENCRYPTION)dnl
281 AC_DEFINE(DIAGNOSTICS)dnl
282 AC_DEFINE(OLD_ENVIRON)dnl
284 # Simple test for streamspty, based on the existance of getmsg(), alas
285 # this breaks on SunOS4 which have streams but BSD-like ptys
287 # And also something wierd has happend with dec-osf1, fallback to bsd-ptys
289 AC_MSG_CHECKING(for streamspty)
290 case "`uname -sr`" in
291 SunOS\ 4*|OSF1*|IRIX\ 4*|HP-UX\ ?.10.*)
292 krb_cv_sys_streamspty=no
295 os_rel=`uname -v`.`uname -r`
296 if expr "$os_rel" : "3*" >/dev/null 2>&1; then
297 krb_cv_sys_streamspty=no
299 krb_cv_sys_streamspty="$ac_cv_func_getmsg"
303 krb_cv_sys_streamspty="$ac_cv_func_getmsg"
306 if test "$krb_cv_sys_streamspty" = yes; then
307 AC_DEFINE(STREAMSPTY)
309 dnl AC_SUBST(STREAMSPTY)
310 AC_MSG_RESULT($krb_cv_sys_streamspty)
316 lib/editline/Makefile \
319 lib/error/compile_et \
324 lib/gssapi/Makefile \
335 appl/popper/Makefile \
337 appl/telnet/Makefile \
338 appl/telnet/libtelnet/Makefile \
339 appl/telnet/telnet/Makefile \
340 appl/telnet/telnetd/Makefile \
341 appl/afsutil/Makefile \
346 dnl This is the release version name-number[beta]
348 HEIMDALVERSION="$PACKAGE-$VERSION"
350 cat > include/newversion.h.in <<EOF
351 char *heimdal_long_version = "@(#)\$Version: $HEIMDALVERSION by @USER@ on @HOST@ ($host) @DATE@ \$";
352 char *heimdal_version = "$HEIMDALVERSION";
355 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
356 echo "include/version.h is unchanged"
357 rm -f include/newversion.h.in
359 echo "creating include/version.h"
360 User=${USER-${LOGNAME}}
361 Host=`(hostname || uname -n) 2>/dev/null | sed 1q`
363 mv -f include/newversion.h.in include/version.h.in
364 sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h