Problem: gssapi search in autoconf does not use pkgconfig

Solution: use it before falling back to headers checks
This commit is contained in:
Luca Boccassi 2017-08-18 16:24:51 +01:00
parent 7be3efc936
commit b7346f8e00
2 changed files with 11 additions and 4 deletions

View File

@ -307,6 +307,11 @@ src_libzmq_la_CPPFLAGS += ${pgm_CFLAGS}
src_libzmq_la_LIBADD += ${pgm_LIBS}
endif
if BUILD_GSSAPI
src_libzmq_la_CPPFLAGS += ${gssapi_krb5_CFLAGS}
src_libzmq_la_LIBADD += ${gssapi_krb5_LIBS}
endif
if ENABLE_PERF
noinst_PROGRAMS = \
perf/local_lat \

View File

@ -442,10 +442,12 @@ AC_ARG_WITH([libgssapi_krb5], [AS_HELP_STRING([--with-libgssapi_krb5],
# conditionally require libgssapi_krb5
if test "x$require_libgssapi_krb5_ext" != "xno"; then
AC_CHECK_HEADERS(gssapi/gssapi_generic.h)
AC_SEARCH_LIBS([gss_init_sec_context], [gssapi_krb5 gssapi],
AC_DEFINE(HAVE_LIBGSSAPI_KRB5, [1], [Enabled GSSAPI security]),
AC_MSG_ERROR(libgssapi_krb5 is needed for GSSAPI security))
PKG_CHECK_MODULES([gssapi_krb5], [krb5-gssapi], [], [
AC_CHECK_HEADERS(gssapi/gssapi_generic.h)
AC_SEARCH_LIBS([gss_init_sec_context], [gssapi_krb5 gssapi],
AC_DEFINE(HAVE_LIBGSSAPI_KRB5, [1], [Enabled GSSAPI security]),
AC_MSG_ERROR(libgssapi_krb5 is needed for GSSAPI security))
])
fi
AM_CONDITIONAL(BUILD_GSSAPI, test "x$require_libgssapi_krb5_ext" != "xno")