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.0g)
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_PATH_PROG(NROFF, nroff)
70 AC_PATH_PROG(GROFF, groff)
71 AC_CACHE_CHECK(how to format man pages,ac_cv_sys_man_format,
72 [cat > conftest.1 << END
81 if test "$NROFF" ; then
82 for i in "-mdoc" "-mandoc"; do
83 if "$NROFF" $i conftest.1 2> /dev/null | \
84 grep Jan > /dev/null 2>&1 ; then
85 ac_cv_sys_man_format="$NROFF $i"
90 if test "$ac_cv_sys_man_format" = "" -a "$GROFF" ; then
91 for i in "-mdoc" "-mandoc"; do
92 if "$GROFF" -Tascii $i conftest.1 2> /dev/null | \
93 grep Jan > /dev/null 2>&1 ; then
94 ac_cv_sys_man_format="$GROFF -Tascii $i"
99 if test "$ac_cv_sys_man_format"; then
100 ac_cv_sys_man_format="$ac_cv_sys_man_format \$< > \$@"
103 if test "$ac_cv_sys_man_format"; then
104 CATMAN="$ac_cv_sys_man_format"
107 AM_CONDITIONAL(CATMAN, test "$CATMAN")
108 AC_CACHE_CHECK(extension of pre-formatted manual pages,ac_cv_sys_catman_ext,
109 if grep _suffix /etc/man.conf > /dev/null 2>&1; then
110 ac_cv_sys_catman_ext=0
112 ac_cv_sys_catman_ext=number
115 if test "$ac_cv_sys_catman_ext" = number; then
116 CATMANEXT='$$section'
122 AC_TEST_PACKAGE(readline,readline.h,libreadline.a,-lreadline)
129 dnl Checks for typedefs, structures, and compiler characteristics.
138 dnl Checks for header files.
141 AC_CHECK_HEADERS(arpa/inet.h arpa/telnet.h bsdsetjmp.h crypt.h)
142 AC_CHECK_HEADERS(curses.h db.h dbm.h dirent.h err.h errno.h)
143 AC_CHECK_HEADERS(fcntl.h grp.h limits.h ndbm.h net/if.h netdb.h)
144 AC_CHECK_HEADERS(netinet/in.h netinet/in6.h)
145 AC_CHECK_HEADERS(netinet/in6_machtypes.h netinet/in_systm.h)
146 AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h netinfo/ni.h paths.h pty.h pwd.h)
147 AC_CHECK_HEADERS(rpcsvc/dbm.h sac.h sgtty.h shadow.h signal.h stropts.h)
148 AC_CHECK_HEADERS(sys/bitypes.h sys/file.h sys/filio.h sys/ioctl.h)
149 AC_CHECK_HEADERS(sys/param.h sys/proc.h sys/pty.h sys/ptyio.h)
150 AC_CHECK_HEADERS(sys/ptyvar.h sys/resource.h sys/select.h)
151 AC_CHECK_HEADERS(sys/socket.h sys/sockio.h sys/stat.h sys/stream.h)
152 AC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/time.h sys/timeb.h)
153 AC_CHECK_HEADERS(sys/times.h sys/tty.h sys/types.h sys/uio.h)
154 AC_CHECK_HEADERS(sys/utsname.h sys/wait.h syslog.h termio.h)
155 AC_CHECK_HEADERS(termios.h tmpdir.h unistd.h util.h utmp.h utmpx.h)
157 if test "$ac_cv_header_err_h" = no; then
158 EXTRA_HDRS="$EXTRA_HDRS err.h"
162 dnl Checks for libraries.
164 AC_FIND_FUNC(socket, socket)
165 AC_FIND_FUNC(gethostbyname, nsl)
166 AC_FIND_FUNC(dbopen, $berkeley_db)
167 AC_FIND_FUNC(dbm_firstkey, $berkeley_db gdbm ndbm)
168 AC_FIND_FUNC(syslog, syslog)
170 AC_FIND_FUNC(logwtmp, util)
171 AC_FIND_FUNC_NO_LIBS(tgetent, termcap)
173 dnl Checks for library functions.
178 AC_CHECK_FUNCS(_getpty asnprintf asprintf fcntl gethostname)
179 AC_CHECK_FUNCS(getmsg grantpt logwtmp mktime ptsname rand random)
180 AC_CHECK_FUNCS(revoke select setitimer setlogin setpcred setpgid)
181 AC_CHECK_FUNCS(setsid setsockopt sigaction strstr timegm ttyname umask)
182 AC_CHECK_FUNCS(unlockpt vasnprintf vasprintf vhangup)
185 if test "$ac_cv_type_signal" = "void" ; then
186 AC_DEFINE(VOID_RETSIGTYPE, 1)
188 AC_SUBST(VOID_RETSIGTYPE)
190 AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
196 AC_BROKEN(chown daemon err errx fchown flock getcwd)
197 AC_BROKEN(getdtablesize getusershell inet_aton initgroups)
198 AC_BROKEN(lstat memmove mkstemp putenv rcmd setegid setenv)
199 AC_BROKEN(seteuid strcasecmp strdup strerror strftime)
200 AC_BROKEN(strlwr strnlen strsep strtok_r strupr unsetenv)
201 AC_BROKEN(verr verrx vsyslog vwarn vwarnx warn warnx)
203 AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [
204 ac_cv_func_realloc_broken=no
211 return realloc(NULL, 17) == NULL;
213 ],:, ac_cv_func_realloc_broken=yes, :)
215 if test "$ac_cv_func_realloc_broken" = yes ; then
216 AC_DEFINE(BROKEN_REALLOC)
219 dnl AC_KRB_FUNC_GETCWD_BROKEN
222 dnl Checks for prototypes and declarations
240 AC_CHECK_VAR([#ifdef HAVE_SYS_TYPES_H
241 #include <sys/types.h>
248 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
253 AC_CHECK_VAR([#ifdef HAVE_NETDB_H
258 AC_CHECK_VAR([#ifdef HAVE_ERR_H
260 #endif],[__progname])
262 AC_CHECK_DECLARATION([#include <stdlib.h>], optarg)
263 AC_CHECK_DECLARATION([#include <stdlib.h>], optind)
264 AC_CHECK_DECLARATION([#include <stdlib.h>], opterr)
265 AC_CHECK_DECLARATION([#include <stdlib.h>], optopt)
268 dnl Check for fields in struct utmp
270 AC_EGREP_HEADER(ut_user, utmp.h, AC_DEFINE(HAVE_UT_USER))
271 AC_EGREP_HEADER(ut_host, utmp.h, AC_DEFINE(HAVE_UT_HOST))
272 AC_EGREP_HEADER(ut_addr, utmp.h, AC_DEFINE(HAVE_UT_ADDR))
273 AC_EGREP_HEADER(ut_type, utmp.h, AC_DEFINE(HAVE_UT_TYPE))
274 AC_EGREP_HEADER(ut_pid, utmp.h, AC_DEFINE(HAVE_UT_PID))
275 AC_EGREP_HEADER(ut_id, utmp.h, AC_DEFINE(HAVE_UT_ID))
276 AC_EGREP_HEADER(ut_syslen, utmpx.h, AC_DEFINE(HAVE_UT_SYSLEN))
279 dnl Check for struct winsize
282 AC_KRB_STRUCT_WINSIZE
285 dnl Check for sa_len in struct sockaddr
288 AC_KRB_STRUCT_SOCKADDR_SA_LEN
291 dnl Check for some common types
298 AC_CHECK_TYPE(ssize_t, int)
301 dnl AC_SUBST(LIBOBJS)
303 AC_GROK_TYPES(int8_t int16_t int32_t int64_t)
304 AC_GROK_TYPES(u_int8_t u_int16_t u_int32_t u_int64_t)
307 dnl Tests for editline
310 AC_FIND_FUNC_NO_LIBS(el_init, edit)
311 AC_FIND_FUNC_NO_LIBS(readline, readline)
313 if test "$with_readline"; then
314 AC_DEFINE(HAVE_READLINE, 1)
316 LIB_readline="$READLINELIB "'$(LIB_tgetent)'
317 INCLUDE_readline="$READLINEINCLUDE"
318 elif test "$ac_cv_func_el_init" = yes; then
319 AC_DEFINE(HAVE_READLINE, 1)
321 editline_OBJS=edit_compat.o
322 LIB_readline='-L$(top_builddir)/lib/editline -leditline '"$LIB_el_init"' $(LIB_tgetent)'
324 INCLUDE_readline='-I$(top_builddir)/lib/editline -I$(top_srcdir)/lib/editline'
325 elif test "$ac_cv_func_readline" = yes; then
326 AC_DEFINE(HAVE_READLINE, 1)
328 LIB_readline='-lreadline $(LIB_tgetent)'
331 AC_DEFINE(HAVE_READLINE, 1)
332 editline_OBJS="editline.o complete.o sysunix.o"
333 LIB_readline='-L$(top_builddir)/lib/editline -leditline $(LIB_tgetent)'
334 INCLUDE_readline='-I$(top_builddir)/lib/editline -I$(top_srcdir)/lib/editline'
336 AC_SUBST(LIB_tgetent)
337 AC_SUBST(LIB_readline)
338 AC_SUBST(INCLUDE_readline)
339 AC_SUBST(editline_OBJS)
341 dnl telnet muck --------------------------------------------------
343 AC_DEFINE(AUTHENTICATION)dnl
345 AC_DEFINE(ENCRYPTION)dnl
346 AC_DEFINE(DES_ENCRYPTION)dnl
347 AC_DEFINE(DIAGNOSTICS)dnl
348 AC_DEFINE(OLD_ENVIRON)dnl
350 # Simple test for streamspty, based on the existance of getmsg(), alas
351 # this breaks on SunOS4 which have streams but BSD-like ptys
353 # And also something wierd has happend with dec-osf1, fallback to bsd-ptys
355 AC_MSG_CHECKING(for streamspty)
356 case "`uname -sr`" in
357 SunOS\ 4*|OSF1*|IRIX\ 4*|HP-UX\ ?.10.*)
358 krb_cv_sys_streamspty=no
361 os_rel=`uname -v`.`uname -r`
362 if expr "$os_rel" : "3*" >/dev/null 2>&1; then
363 krb_cv_sys_streamspty=no
365 krb_cv_sys_streamspty="$ac_cv_func_getmsg"
369 krb_cv_sys_streamspty="$ac_cv_func_getmsg"
372 if test "$krb_cv_sys_streamspty" = yes; then
373 AC_DEFINE(STREAMSPTY)
375 dnl AC_SUBST(STREAMSPTY)
376 AC_MSG_RESULT($krb_cv_sys_streamspty)
382 lib/editline/Makefile \
385 lib/error/compile_et \
390 lib/gssapi/Makefile \
401 appl/popper/Makefile \
403 appl/telnet/Makefile \
404 appl/telnet/libtelnet/Makefile \
405 appl/telnet/telnet/Makefile \
406 appl/telnet/telnetd/Makefile \
407 appl/afsutil/Makefile \
412 dnl This is the release version name-number[beta]
414 HEIMDALVERSION="$PACKAGE-$VERSION"
416 cat > include/newversion.h.in <<EOF
417 char *heimdal_long_version = "@(#)\$Version: $HEIMDALVERSION by @USER@ on @HOST@ ($host) @DATE@ \$";
418 char *heimdal_version = "$HEIMDALVERSION";
421 if test -f include/version.h && cmp -s include/newversion.h.in include/version.h.in; then
422 echo "include/version.h is unchanged"
423 rm -f include/newversion.h.in
425 echo "creating include/version.h"
426 User=${USER-${LOGNAME}}
427 Host=`(hostname || uname -n) 2>/dev/null | sed 1q`
429 mv -f include/newversion.h.in include/version.h.in
430 sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/version.h.in > include/version.h