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.0k)
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")dnl
55 AC_SUBST(INCLUDE_krb4)dnl
56 AM_CONDITIONAL(AIX, test `uname` = AIX)dnl
58 AC_ARG_ENABLE(kaserver,
59 [ --enable-kaserver if you want the KDC to try to emulate a kaserver],
61 if test "$enableval" != no; then
62 AC_DEFINE(KASERVER, 1)
63 if test "x$with_krb4" = "x"; then
64 AC_MSG_ERROR(kaserver requires krb4)
72 [ --disable-otp if you don't want OTP support],
74 if test "$enableval" = "no"; then
78 if test "$otp" = "yes"; then
80 LIB_otp='-L$(top_builddir)/lib/otp -lotp'
86 AC_PATH_PROG(NROFF, nroff)
87 AC_PATH_PROG(GROFF, groff)
88 AC_CACHE_CHECK(how to format man pages,ac_cv_sys_man_format,
89 [cat > conftest.1 << END
98 if test "$NROFF" ; then
99 for i in "-mdoc" "-mandoc"; do
100 if "$NROFF" $i conftest.1 2> /dev/null | \
101 grep Jan > /dev/null 2>&1 ; then
102 ac_cv_sys_man_format="$NROFF $i"
107 if test "$ac_cv_sys_man_format" = "" -a "$GROFF" ; then
108 for i in "-mdoc" "-mandoc"; do
109 if "$GROFF" -Tascii $i conftest.1 2> /dev/null | \
110 grep Jan > /dev/null 2>&1 ; then
111 ac_cv_sys_man_format="$GROFF -Tascii $i"
116 if test "$ac_cv_sys_man_format"; then
117 ac_cv_sys_man_format="$ac_cv_sys_man_format \$< > \$@"
120 if test "$ac_cv_sys_man_format"; then
121 CATMAN="$ac_cv_sys_man_format"
124 AM_CONDITIONAL(CATMAN, test "$CATMAN")
125 AC_CACHE_CHECK(extension of pre-formatted manual pages,ac_cv_sys_catman_ext,
126 if grep _suffix /etc/man.conf > /dev/null 2>&1; then
127 ac_cv_sys_catman_ext=0
129 ac_cv_sys_catman_ext=number
132 if test "$ac_cv_sys_catman_ext" = number; then
133 CATMANEXT='$$section'
139 AC_TEST_PACKAGE(readline,readline.h,libreadline.a,-lreadline)
148 dnl Checks for typedefs, structures, and compiler characteristics.
157 dnl Checks for header files.
160 AC_CHECK_HEADERS(arpa/inet.h arpa/telnet.h bsdsetjmp.h crypt.h)
161 AC_CHECK_HEADERS(curses.h db.h dbm.h dirent.h err.h errno.h)
162 AC_CHECK_HEADERS(fcntl.h fnmatch.h grp.h inttypes.h limits.h ndbm.h)
163 AC_CHECK_HEADERS(net/if.h netdb.h)
164 AC_CHECK_HEADERS(netinet/in.h netinet/in6.h netinet/in6_var.h)
165 AC_CHECK_HEADERS(netinet/in6_machtypes.h netinet/in_systm.h)
166 AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h netinfo/ni.h netinet6/in6.h paths.h pty.h pwd.h)
167 AC_CHECK_HEADERS(rpcsvc/dbm.h sac.h sgtty.h shadow.h signal.h stropts.h)
168 AC_CHECK_HEADERS(sys/bitypes.h sys/file.h sys/filio.h sys/ioctl.h)
169 AC_CHECK_HEADERS(sys/param.h sys/proc.h sys/pty.h sys/ptyio.h)
170 AC_CHECK_HEADERS(sys/ptyvar.h sys/resource.h sys/select.h)
171 AC_CHECK_HEADERS(sys/socket.h sys/sockio.h sys/stat.h sys/stream.h)
172 AC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/time.h sys/timeb.h)
173 AC_CHECK_HEADERS(sys/times.h sys/tty.h sys/types.h sys/uio.h)
174 AC_CHECK_HEADERS(sys/utsname.h sys/wait.h syslog.h termio.h)
175 AC_CHECK_HEADERS(termios.h tmpdir.h unistd.h util.h utmp.h utmpx.h)
177 if test "$ac_cv_header_err_h" = no; then
178 EXTRA_HDRS="$EXTRA_HDRS err.h"
181 if test "$ac_cv_header_fnmatch_h" = no; then
182 EXTRA_HDRS="$EXTRA_HDRS fnmatch.h"
186 dnl Checks for libraries.
188 AC_FIND_FUNC(socket, socket)
189 AC_FIND_FUNC(gethostbyname, nsl)
190 AC_FIND_FUNC(dbopen, $berkeley_db)
191 AC_FIND_FUNC(dbm_firstkey, $berkeley_db gdbm ndbm)
192 AC_FIND_FUNC(syslog, syslog)
194 AC_FIND_FUNC(logwtmp, util)
195 AC_FIND_FUNC_NO_LIBS(tgetent, termcap)
196 AC_FIND_FUNC(gethostbyname2, inet6 ip6)
197 AC_FIND_FUNC(inet_ntop, inet6 ip6)
198 AC_CHECK_FUNCS(inet_pton)
200 dnl Checks for library functions.
205 AC_CHECK_FUNCS(_getpty asnprintf asprintf fcntl gethostname)
206 AC_CHECK_FUNCS(getmsg grantpt logwtmp mktime ptsname rand random)
207 AC_CHECK_FUNCS(revoke select setitimer setlogin setpcred setpgid)
208 AC_CHECK_FUNCS(setsid setsockopt sigaction strstr timegm ttyname umask)
209 AC_CHECK_FUNCS(unlockpt vasnprintf vasprintf vhangup)
212 if test "$ac_cv_type_signal" = "void" ; then
213 AC_DEFINE(VOID_RETSIGTYPE, 1)
215 AC_SUBST(VOID_RETSIGTYPE)
217 AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
222 if test "$ac_cv_func_hstrerror" = yes; then
230 AC_BROKEN(chown daemon err errx fchown flock fnmatch getcwd)
231 AC_BROKEN(getdtablesize getopt getusershell inet_aton initgroups)
232 AC_BROKEN(lstat memmove mkstemp putenv rcmd readv setegid setenv)
233 AC_BROKEN(seteuid setenv seteuid strcasecmp strdup strerror strftime)
234 AC_BROKEN(strlwr strnlen strsep strtok_r strupr unsetenv)
235 AC_BROKEN(verr verrx vsyslog vwarn vwarnx warn warnx writev)
237 AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [
238 ac_cv_func_realloc_broken=no
245 return realloc(NULL, 17) == NULL;
247 ],:, ac_cv_func_realloc_broken=yes, :)
249 if test "$ac_cv_func_realloc_broken" = yes ; then
250 AC_DEFINE(BROKEN_REALLOC)
253 dnl AC_KRB_FUNC_GETCWD_BROKEN
256 dnl Checks for prototypes and declarations
260 #ifdef HAVE_SYS_TYPES_H
261 #include <sys/types.h>
263 #ifdef HAVE_SYS_SOCKET_H
264 #include <sys/socket.h>
266 #ifdef HAVE_NETINET_IN_H
267 #include <netinet/in.h>
269 #ifdef HAVE_ARPA_INET_H
270 #include <arpa/inet.h>
276 gethostbyname, struct hostent *gethostbyname(const char *))
279 #ifdef HAVE_SYS_TYPES_H
280 #include <sys/types.h>
282 #ifdef HAVE_SYS_SOCKET_H
283 #include <sys/socket.h>
285 #ifdef HAVE_NETINET_IN_H
286 #include <netinet/in.h>
288 #ifdef HAVE_ARPA_INET_H
289 #include <arpa/inet.h>
295 gethostbyaddr, struct hostent *gethostbyaddr(const void *, size_t, int))
298 #ifdef HAVE_SYS_TYPES_H
299 #include <sys/types.h>
301 #ifdef HAVE_SYS_SOCKET_H
302 #include <sys/socket.h>
304 #ifdef HAVE_NETINET_IN_H
305 #include <netinet/in.h>
307 #ifdef HAVE_ARPA_INET_H
308 #include <arpa/inet.h>
314 getservbyname, struct servent *getservbyname(const char *, const char *))
321 openlog, void openlog(const char *, int, int))
338 AC_CHECK_VAR([#ifdef HAVE_SYS_TYPES_H
339 #include <sys/types.h>
346 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
351 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
356 AC_CHECK_VAR([#ifdef HAVE_ERR_H
358 #endif],[__progname])
360 AC_CHECK_DECLARATION([#include <stdlib.h>], optarg)
361 AC_CHECK_DECLARATION([#include <stdlib.h>], optind)
362 AC_CHECK_DECLARATION([#include <stdlib.h>], opterr)
363 AC_CHECK_DECLARATION([#include <stdlib.h>], optopt)
366 dnl Check for fields in struct utmp
368 AC_EGREP_HEADER(ut_user, utmp.h, AC_DEFINE(HAVE_UT_USER))
369 AC_EGREP_HEADER(ut_host, utmp.h, AC_DEFINE(HAVE_UT_HOST))
370 AC_EGREP_HEADER(ut_addr, utmp.h, AC_DEFINE(HAVE_UT_ADDR))
371 AC_EGREP_HEADER(ut_type, utmp.h, AC_DEFINE(HAVE_UT_TYPE))
372 AC_EGREP_HEADER(ut_pid, utmp.h, AC_DEFINE(HAVE_UT_PID))
373 AC_EGREP_HEADER(ut_id, utmp.h, AC_DEFINE(HAVE_UT_ID))
374 AC_EGREP_HEADER(ut_syslen, utmpx.h, AC_DEFINE(HAVE_UT_SYSLEN))
379 dnl Check for struct winsize
382 AC_KRB_STRUCT_WINSIZE
385 dnl Check for sa_len in struct sockaddr
388 AC_KRB_STRUCT_SOCKADDR_SA_LEN
391 dnl Check for some common types
398 AC_CHECK_TYPE(ssize_t, int)
401 dnl AC_SUBST(LIBOBJS)
403 AC_GROK_TYPES(int8_t int16_t int32_t int64_t)
404 AC_GROK_TYPES(u_int8_t u_int16_t u_int32_t u_int64_t)
407 dnl Tests for editline
410 AC_FIND_FUNC_NO_LIBS(el_init, edit)
411 AC_FIND_FUNC_NO_LIBS(readline, readline)
413 if test "$with_readline"; then
414 AC_DEFINE(HAVE_READLINE, 1)
416 LIB_readline="$READLINELIB "'$(LIB_tgetent)'
417 INCLUDE_readline="$READLINEINCLUDE"
418 elif test "$ac_cv_func_el_init" = yes; then
419 AC_DEFINE(HAVE_READLINE, 1)
421 editline_OBJS=edit_compat.o
422 LIB_readline='-L$(top_builddir)/lib/editline -leditline '"$LIB_el_init"' $(LIB_tgetent)'
424 INCLUDE_readline='-I$(top_builddir)/lib/editline -I$(top_srcdir)/lib/editline'
425 elif test "$ac_cv_func_readline" = yes; then
426 AC_DEFINE(HAVE_READLINE, 1)
428 LIB_readline='-lreadline $(LIB_tgetent)'
431 AC_DEFINE(HAVE_READLINE, 1)
432 editline_OBJS="editline.o complete.o sysunix.o"
433 LIB_readline='-L$(top_builddir)/lib/editline -leditline $(LIB_tgetent)'
434 INCLUDE_readline='-I$(top_builddir)/lib/editline -I$(top_srcdir)/lib/editline'
436 AC_SUBST(LIB_tgetent)
437 AC_SUBST(LIB_readline)
438 AC_SUBST(INCLUDE_readline)
439 AC_SUBST(editline_OBJS)
441 dnl telnet muck --------------------------------------------------
443 AC_DEFINE(AUTHENTICATION)dnl
445 AC_DEFINE(ENCRYPTION)dnl
446 AC_DEFINE(DES_ENCRYPTION)dnl
447 AC_DEFINE(DIAGNOSTICS)dnl
448 AC_DEFINE(OLD_ENVIRON)dnl
450 # Simple test for streamspty, based on the existance of getmsg(), alas
451 # this breaks on SunOS4 which have streams but BSD-like ptys
453 # And also something wierd has happend with dec-osf1, fallback to bsd-ptys
455 AC_MSG_CHECKING(for streamspty)
456 case "`uname -sr`" in
457 SunOS\ 4*|OSF1*|IRIX\ 4*|HP-UX\ ?.10.*)
458 krb_cv_sys_streamspty=no
461 os_rel=`uname -v`.`uname -r`
462 if expr "$os_rel" : "3*" >/dev/null 2>&1; then
463 krb_cv_sys_streamspty=no
465 krb_cv_sys_streamspty="$ac_cv_func_getmsg"
469 krb_cv_sys_streamspty="$ac_cv_func_getmsg"
472 if test "$krb_cv_sys_streamspty" = yes; then
473 AC_DEFINE(STREAMSPTY)
475 dnl AC_SUBST(STREAMSPTY)
476 AC_MSG_RESULT($krb_cv_sys_streamspty)
480 include/kadm5/Makefile \
483 lib/editline/Makefile \
486 lib/error/compile_et \
492 lib/gssapi/Makefile \
504 appl/popper/Makefile \
506 appl/telnet/Makefile \
507 appl/telnet/libtelnet/Makefile \
508 appl/telnet/telnet/Makefile \
509 appl/telnet/telnetd/Makefile \
510 appl/afsutil/Makefile \
515 dnl This is the release version name-number[beta]
517 HEIMDALVERSION="$PACKAGE-$VERSION"
519 cat > include/newversion.h.in <<EOF
520 char *heimdal_long_version = "@(#)\$Version: $HEIMDALVERSION by @USER@ on @HOST@ ($host) @DATE@ \$";
521 char *heimdal_version = "$HEIMDALVERSION";
524 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
525 echo "include/version.h is unchanged"
526 rm -f include/newversion.h.in
528 echo "creating include/version.h"
529 User=${USER-${LOGNAME}}
530 Host=`(hostname || uname -n) 2>/dev/null | sed 1q`
532 mv -f include/newversion.h.in include/version.h.in
533 sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h