1
1
dnl Process this file with autoconf to produce a configure script.
2
dnl $Id: configure.ac 162 2005-08-10 05:05:32Z rra $
2
dnl $Id: configure.ac 2351 2006-01-02 03:38:00Z rra $
4
AC_REVISION($Revision: 162 $)
4
AC_REVISION($Revision: 2351 $)
6
AC_INIT([kstart], [2.8], [rra@stanford.edu])
6
AC_INIT([kstart], [2.9], [rra@stanford.edu])
8
m4_include([m4/krb5.m4])
8
10
dnl Checks for programs.
25
27
[Full path to aklog binary.])
28
dnl Find the networking libraries before looking for Kerberos.
29
AC_SEARCH_LIBS([gethostbyname], [nsl])
30
AC_SEARCH_LIBS([socket], [socket], ,
31
[AC_CHECK_LIB([nsl], [socket], [LIBS="$LIBS -lsocket -lnsl"], ,
33
AC_SEARCH_LIBS([res_search], [resolv])
34
AC_SEARCH_LIBS([crypt], [crypt])
36
dnl Where to find the Kerberos libraries.
37
AC_ARG_WITH([kerberos],
38
AC_HELP_STRING([--with-kerberos=DIR],
39
[Path to Kerberos headers and libraries]),
40
[if test x"$withval" != xno ; then
41
CPPFLAGS="-I$kerberos/include $CPPFLAGS"
42
LDFLAGS="-L$kerberos/lib $LDFLAGS"
45
dnl Find the Kerberos libraries. Supports both MIT and Heimdal.
46
AC_CHECK_LIB([krb4], [main],
47
[KRBLIBS="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"],
48
[KRBLIBS="-lcrypto -lkrb"],
49
[-ldes425 -lkrb5 -lk5crypto -lcom_err])
50
AC_CHECK_LIB([k5crypto], [main],
51
[KRB5LIBS="-lkrb5 -lk5crypto -lcom_err"],
52
[KRB5LIBS="-lkrb5 -lcrypto -lasn1 -lroken -lcom_err"],
53
[-lk5crypto -lcom_err])
57
dnl Allow the user to build statically against the Kerberos libraries.
58
AC_ARG_ENABLE([static],
59
AC_HELP_STRING([--enable-static],
60
[Link against the static Kerberos libraries]),
61
[if test x"$enableval" = xyes ; then
62
KRBLIBS="-Wl,-Bstatic $KRBLIBS -Wl,-Bdynamic"
63
KRB5LIBS="-Wl,-Bstatic $KRB5LIBS -Wl,-Bdynamic"
66
dnl See if AFS setpag support is desired.
67
AC_ARG_WITH([afs-setpag],
68
AC_HELP_STRING([--with-afs-setpag=DIR],
69
[Enable AFS setpag support, libraries at DIR]),
70
[if test x"$withval" != xno ; then
71
if test x"$withval" != xyes ; then
72
LDFLAGS="-L$withval/lib $LDFLAGS"
74
AC_CHECK_LIB([afsauthent], [setpag],
75
[LIBS="-lafsauthent -lafsrpc -lpthread $LIBS"
76
AC_DEFINE([HAVE_SETPAG], 1,
77
[Define to 1 if you have the AFS setpag function.])],
78
[AC_MSG_ERROR([setpag function not found])],
82
30
dnl Allow the user to disable Kerberos v4 support. Useful for building
83
31
dnl against just Heimdal, without KTH Kerberos.
93
41
AC_SUBST([K4START])
94
42
AC_SUBST([K4START_MAN])
96
dnl Check to see if we need to use our local lifetime function. All of this
97
dnl machinery is annoying, but required because AC_REPLACE_FUNCS doesn't take
98
dnl an argument for extra libraries to check.
44
dnl Check for the Kerberos v5 libraries and for portability between krb5 and
45
dnl Heimdal when getting initial tickets.
100
LIBS="$KRBLIBS $LIBS"
47
RRA_LIB_KRB5([krb5], [true])
48
AC_CHECK_FUNCS([krb5_get_init_creds_opt_set_default_flags krb5_err])
53
dnl If we're building k4start, check for the Kerberos v4 libraries and add our
54
dnl local lifetime implementation if needed.
101
56
if test x"$K4START" != x ; then
58
RRA_LIB_KRB5([krb4], [true])
102
59
AC_CHECK_FUNCS([krb_life_to_time], , [AC_LIBOBJ([lifetime])])
65
dnl See if AFS setpag support is desired.
66
AC_ARG_WITH([afs-setpag],
67
AC_HELP_STRING([--with-afs-setpag=DIR],
68
[Enable AFS setpag support, libraries at DIR]),
69
[if test x"$withval" != xno ; then
70
if test x"$withval" != xyes ; then
71
LDFLAGS="-L$withval/lib $LDFLAGS"
73
AC_CHECK_LIB([afsauthent], [lsetpag],
74
[AFSLIBS="-lafsauthent -lafsrpc"
75
AC_DEFINE([HAVE_LSETPAG], 1,
76
[Define to 1 if you have the AFS lsetpag function.])],
77
[AC_CHECK_LIB([kafs], [k_setpag],
79
AC_CHECK_HEADERS([kafs.h])
80
AC_DEFINE([HAVE_K_SETPAG], 1,
81
[Define to 1 if you have the k_setpag function.])],
82
[AC_MSG_ERROR([setpag function not found])])],
106
87
dnl Checks for header files.
107
AC_CHECK_HEADERS([kerberosIV/krb.h])
89
AC_CHECK_HEADERS([sys/time.h])
109
91
dnl Checks for types.
110
92
AC_CHECK_TYPES([long long])
111
AC_CHECK_TYPES([krb5_realm], , , [#include <krb5.h>])
113
94
dnl Checks for functions.
114
95
AC_CHECK_FUNCS([setsid])
115
96
AC_REPLACE_FUNCS([daemon mkstemp])
117
dnl Check for Heimdal functions and different generations of Kerberos v5
120
LIBS="$KRB5LIBS $LIBS"
121
AC_CHECK_FUNCS([initialize_krb5_error_table])
122
AC_CHECK_FUNCS([krb5_free_keytab_entry_contents])
123
AC_CHECK_FUNCS([krb5_get_init_creds_opt_set_default_flags])
126
98
dnl Output the results.
127
99
AC_CONFIG_HEADER([config.h])
128
100
AC_CONFIG_FILES([Makefile])