4 dnl Kerberos autoconf glue
7 AC_DEFUN([OPENAFS_KRB5CONF],[
9 AC_ARG_VAR(KRB5CFLAGS, [C flags to compile Kerberos 5 programs])
10 AC_ARG_VAR(KRB5LIBS, [Libraries and flags to compile Kerberos 5 programs])
11 AC_ARG_VAR(KRB5_CONFIG, [Location of krb5-config script])
13 AC_ARG_WITH([krb5-conf],
14 AC_HELP_STRING([--with-krb5-config[=krb5-config-location]],
15 [Use a krb5-config script to configure Kerberos]),
16 [if test X$withval != Xno; then
18 if test X$withval = Xyes; then
19 AC_PATH_PROG(KRB5_CONFIG, krb5-config, not_found)
20 if test X$KRB5_CONFIG = Xnot_found; then
21 AC_MSG_ERROR([cannot find krb5-config script, you must configure Kerberos manually])
26 KRB5CFLAGS=`$KRB5_CONFIG --cflags krb5`
28 if test $retval -ne 0; then
29 AC_MSG_ERROR([$KRB5_CONFIG failed with an error code of $retval])
31 KRB5LIBS=`$KRB5_CONFIG --libs krb5`
33 if test $retval -ne 0; then
34 AC_MSG_ERROR([$KRB5_CONFIG failed with an error code of $retval])
36 AC_MSG_RESULT([Adding $KRB5CFLAGS to KRB5CFLAGS])
37 AC_MSG_RESULT([Adding $KRB5LIBS to KRB5LIBS])
41 AC_HELP_STRING([--with-krb5],
42 [Support for Kerberos 5 (manual configuration)]),
43 [if test X$conf_krb5 = XYES; then
44 AC_MSG_ERROR([--with-krb5-config and --with-krb5 are mutually exclusive, choose only one])
46 if test "X$KRB5CFLAGS" = X; then
47 AC_MSG_WARN([KRB5CFLAGS is not set])
49 if test "X$KRB5LIBS" = X; then
50 AC_MSG_WARN([KRB5LIBS is not set])
55 if test X$conf_krb5 = XYES; then
56 AC_MSG_RESULT([Configuring support for Kerberos 5 utilities])
59 CFLAGS="$CFLAGS KRB5CFLAGS"
61 LIBS="$LIBS $KRB5LIBS"
62 AC_CHECK_FUNCS([add_to_error_table])