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.0f)
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_ARG_ENABLE(kaserver,
58 [ --enable-kaserver if you want the KDC to try to emulate a kaserver],
60 if test "$enableval" != no; then
61 AC_DEFINE(KASERVER, 1)
62 if test "x$with_krb4" = "x"; then
63 AC_MSG_ERROR(kaserver requires krb4)
69 AC_TEST_PACKAGE(readline,readline.h,libreadline.a,-lreadline)
76 dnl Checks for typedefs, structures, and compiler characteristics.
85 dnl Checks for header files.
88 AC_CHECK_HEADERS(arpa/inet.h arpa/telnet.h bsdsetjmp.h crypt.h)
89 AC_CHECK_HEADERS(curses.h db.h dbm.h dirent.h err.h errno.h)
90 AC_CHECK_HEADERS(fcntl.h grp.h limits.h ndbm.h net/if.h netdb.h)
91 AC_CHECK_HEADERS(netinet/in.h netinet/in6.h)
92 AC_CHECK_HEADERS(netinet/in6_machtypes.h netinet/in_systm.h)
93 AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h netinfo/ni.h paths.h pty.h pwd.h)
94 AC_CHECK_HEADERS(rpcsvc/dbm.h sac.h shadow.h signal.h stropts.h)
95 AC_CHECK_HEADERS(sys/bitypes.h sys/file.h sys/filio.h sys/ioctl.h)
96 AC_CHECK_HEADERS(sys/param.h sys/proc.h sys/pty.h sys/ptyio.h)
97 AC_CHECK_HEADERS(sys/ptyvar.h sys/resource.h sys/select.h)
98 AC_CHECK_HEADERS(sys/socket.h sys/sockio.h sys/stat.h sys/stream.h)
99 AC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/time.h sys/timeb.h)
100 AC_CHECK_HEADERS(sys/times.h sys/tty.h sys/types.h sys/uio.h)
101 AC_CHECK_HEADERS(sys/utsname.h sys/wait.h syslog.h termio.h)
102 AC_CHECK_HEADERS(termios.h tmpdir.h unistd.h util.h utmp.h utmpx.h)
104 if test "$ac_cv_header_err_h" = no; then
105 EXTRA_HDRS="$EXTRA_HDRS err.h"
109 dnl Checks for libraries.
111 AC_FIND_FUNC(socket, socket)
112 AC_FIND_FUNC(gethostbyname, nsl)
113 AC_FIND_FUNC(dbopen, $berkeley_db)
114 AC_FIND_FUNC(dbm_firstkey, $berkeley_db gdbm ndbm)
115 AC_FIND_FUNC(syslog, syslog)
117 AC_FIND_FUNC(logwtmp, util)
118 AC_FIND_FUNC_NO_LIBS(tgetent, termcap)
120 dnl Checks for library functions.
125 AC_CHECK_FUNCS(_getpty asnprintf asprintf fcntl gethostname)
126 AC_CHECK_FUNCS(getmsg grantpt logwtmp mktime ptsname rand random)
127 AC_CHECK_FUNCS(revoke select setitimer setlogin setpcred setpgid)
128 AC_CHECK_FUNCS(setsid setsockopt strstr timegm ttyname umask)
129 AC_CHECK_FUNCS(unlockpt vasnprintf vasprintf vhangup)
132 if test "$ac_cv_type_signal" = "void" ; then
133 AC_DEFINE(VOID_RETSIGTYPE, 1)
135 AC_SUBST(VOID_RETSIGTYPE)
137 AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
143 AC_BROKEN(chown daemon err errx fchown flock getcwd)
144 AC_BROKEN(getdtablesize getusershell inet_aton initgroups)
145 AC_BROKEN(lstat memmove mkstemp putenv rcmd setegid setenv)
146 AC_BROKEN(seteuid strcasecmp strdup strerror strftime)
147 AC_BROKEN(strlwr strnlen strsep strtok_r strupr unsetenv)
148 AC_BROKEN(verr verrx vsyslog vwarn vwarnx warn warnx)
150 AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [
151 ac_cv_func_realloc_broken=no
158 return realloc(NULL, 17) == NULL;
160 ],:, ac_cv_func_realloc_broken=yes, :)
162 if test "$ac_cv_func_realloc_broken" = yes ; then
163 AC_DEFINE(BROKEN_REALLOC)
166 dnl AC_KRB_FUNC_GETCWD_BROKEN
169 dnl Checks for prototypes and declarations
187 AC_CHECK_VAR([#ifdef HAVE_SYS_TYPES_H
188 #include <sys/types.h>
195 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
200 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
205 AC_CHECK_VAR([#ifdef HAVE_ERR_H
207 #endif],[__progname])
209 AC_CHECK_DECLARATION([#include <stdlib.h>], optarg)
210 AC_CHECK_DECLARATION([#include <stdlib.h>], optind)
211 AC_CHECK_DECLARATION([#include <stdlib.h>], opterr)
212 AC_CHECK_DECLARATION([#include <stdlib.h>], optopt)
215 dnl Check for fields in struct utmp
217 AC_EGREP_HEADER(ut_user, utmp.h, AC_DEFINE(HAVE_UT_USER))
218 AC_EGREP_HEADER(ut_host, utmp.h, AC_DEFINE(HAVE_UT_HOST))
219 AC_EGREP_HEADER(ut_addr, utmp.h, AC_DEFINE(HAVE_UT_ADDR))
220 AC_EGREP_HEADER(ut_type, utmp.h, AC_DEFINE(HAVE_UT_TYPE))
221 AC_EGREP_HEADER(ut_pid, utmp.h, AC_DEFINE(HAVE_UT_PID))
222 AC_EGREP_HEADER(ut_id, utmp.h, AC_DEFINE(HAVE_UT_ID))
223 AC_EGREP_HEADER(ut_syslen, utmpx.h, AC_DEFINE(HAVE_UT_SYSLEN))
226 dnl Check for struct winsize
229 AC_KRB_STRUCT_WINSIZE
232 dnl Check for sa_len in struct sockaddr
235 AC_KRB_STRUCT_SOCKADDR_SA_LEN
238 dnl Check for some common types
245 AC_CHECK_TYPE(ssize_t, int)
248 dnl AC_SUBST(LIBOBJS)
250 AC_GROK_TYPES(int8_t int16_t int32_t int64_t)
251 AC_GROK_TYPES(u_int8_t u_int16_t u_int32_t u_int64_t)
254 dnl Tests for editline
257 AC_FIND_FUNC_NO_LIBS(el_init, edit)
258 AC_FIND_FUNC_NO_LIBS(readline, readline)
260 if test "$with_readline"; then
261 AC_DEFINE(HAVE_READLINE, 1)
263 LIB_readline="$READLINELIB "'$(LIB_tgetent)'
264 INCLUDE_readline="$READLINEINCLUDE"
265 elif test "$ac_cv_func_el_init" = yes; then
266 AC_DEFINE(HAVE_READLINE, 1)
268 editline_OBJS=edit_compat.o
269 LIB_readline='-L$(top_builddir)/lib/editline -leditline '"$LIB_el_init"' $(LIB_tgetent)'
271 INCLUDE_readline='-I$(top_builddir)/lib/editline -I$(top_srcdir)/lib/editline'
272 elif test "$ac_cv_func_readline" = yes; then
273 AC_DEFINE(HAVE_READLINE, 1)
275 LIB_readline='-lreadline $(LIB_tgetent)'
278 AC_DEFINE(HAVE_READLINE, 1)
279 editline_OBJS="editline.o complete.o sysunix.o"
280 LIB_readline='-L$(top_builddir)/lib/editline -leditline $(LIB_tgetent)'
281 INCLUDE_readline='-I$(top_builddir)/lib/editline -I$(top_srcdir)/lib/editline'
283 AC_SUBST(LIB_tgetent)
284 AC_SUBST(LIB_readline)
285 AC_SUBST(INCLUDE_readline)
286 AC_SUBST(editline_OBJS)
288 dnl telnet muck --------------------------------------------------
290 AC_DEFINE(AUTHENTICATION)dnl
292 AC_DEFINE(ENCRYPTION)dnl
293 AC_DEFINE(DES_ENCRYPTION)dnl
294 AC_DEFINE(DIAGNOSTICS)dnl
295 AC_DEFINE(OLD_ENVIRON)dnl
297 # Simple test for streamspty, based on the existance of getmsg(), alas
298 # this breaks on SunOS4 which have streams but BSD-like ptys
300 # And also something wierd has happend with dec-osf1, fallback to bsd-ptys
302 AC_MSG_CHECKING(for streamspty)
303 case "`uname -sr`" in
304 SunOS\ 4*|OSF1*|IRIX\ 4*|HP-UX\ ?.10.*)
305 krb_cv_sys_streamspty=no
308 os_rel=`uname -v`.`uname -r`
309 if expr "$os_rel" : "3*" >/dev/null 2>&1; then
310 krb_cv_sys_streamspty=no
312 krb_cv_sys_streamspty="$ac_cv_func_getmsg"
316 krb_cv_sys_streamspty="$ac_cv_func_getmsg"
319 if test "$krb_cv_sys_streamspty" = yes; then
320 AC_DEFINE(STREAMSPTY)
322 dnl AC_SUBST(STREAMSPTY)
323 AC_MSG_RESULT($krb_cv_sys_streamspty)
329 lib/editline/Makefile \
332 lib/error/compile_et \
337 lib/gssapi/Makefile \
348 appl/popper/Makefile \
350 appl/telnet/Makefile \
351 appl/telnet/libtelnet/Makefile \
352 appl/telnet/telnet/Makefile \
353 appl/telnet/telnetd/Makefile \
354 appl/afsutil/Makefile \
359 dnl This is the release version name-number[beta]
361 HEIMDALVERSION="$PACKAGE-$VERSION"
363 cat > include/newversion.h.in <<EOF
364 char *heimdal_long_version = "@(#)\$Version: $HEIMDALVERSION by @USER@ on @HOST@ ($host) @DATE@ \$";
365 char *heimdal_version = "$HEIMDALVERSION";
368 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
369 echo "include/version.h is unchanged"
370 rm -f include/newversion.h.in
372 echo "creating include/version.h"
373 User=${USER-${LOGNAME}}
374 Host=`(hostname || uname -n) 2>/dev/null | sed 1q`
376 mv -f include/newversion.h.in include/version.h.in
377 sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h