diff options
author | Kevin McCarthy <kevin@8t8.us> | 2021-01-03 15:33:46 -0800 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2021-01-03 15:37:22 -0800 |
commit | a3db7ccb0e9b7bcb63bb5ae161217a020d2b85e6 (patch) | |
tree | 921f9cf5a41023b351947825bd1563623fb45571 /m4 | |
parent | e4a8abe80f7c3dfc06da1e4bf2cb1d607cae60fc (diff) |
Add configure checks for gssapi library and functions.
rkta on irc reported a build failure because the gss headers were not
present. Add explicit checks for the required headers. Also add a
check for gss_init_sec_context() when using the output of krb-config
to configure flags.
Abort configure if the library/header checks don't pass. It would
previously continue on, setting USE_GSS and need_gss, which would just
result in a build error.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/gssapi.m4 | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/m4/gssapi.m4 b/m4/gssapi.m4 index 0e0194e6..01a12f53 100644 --- a/m4/gssapi.m4 +++ b/m4/gssapi.m4 @@ -13,6 +13,7 @@ AC_DEFUN([MUTT_AM_PATH_GSSAPI], saved_CPPFLAGS="$CPPFLAGS" saved_LDFLAGS="$LDFLAGS" saved_LIBS="$LIBS" + dnl First try krb5-config if test "$GSSAPI_PREFIX" != "yes" then @@ -29,9 +30,13 @@ AC_DEFUN([MUTT_AM_PATH_GSSAPI], "Kerberos 5 "*) GSSAPI_IMPL="MIT";; ?eimdal*) GSSAPI_IMPL="Heimdal";; *) GSSAPI_IMPL="Unknown";; - esac + esac + dnl check to make sure the library exists + LIBS="$saved_LIBS $GSSAPI_LIBS" + AC_CHECK_FUNC([gss_init_sec_context], [], [GSSAPI_IMPL="none"]) + + dnl No krb5-config, run the old code else - dnl No krb5-config, run the old code if test "$GSSAPI_PREFIX" != "yes" then GSSAPI_CFLAGS="-I$GSSAPI_PREFIX/include" @@ -71,6 +76,17 @@ AC_DEFUN([MUTT_AM_PATH_GSSAPI], fi fi + dnl Check headers exist + if test "$GSSAPI_IMPL" != "none" + then + CPPFLAGS="$saved_CPPFLAGS $GSSAPI_CFLAGS" + if test "$GSSAPI_IMPL" != "Heimdal" + then + AC_CHECK_HEADER([gssapi/gssapi_generic.h], [], [GSSAPI_IMPL="none"], []) + fi + AC_CHECK_HEADER([gssapi/gssapi.h], [], [GSSAPI_IMPL="none"], []) + fi + CPPFLAGS="$saved_CPPFLAGS" LDFLAGS="$saved_LDFLAGS" LIBS="$saved_LIBS" |