From d1ff4e9197299133dc403c446affda3820151455 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 3 May 2021 14:03:19 +1000 Subject: [PATCH] check for gssapi_krb5.h and gssapi/gssapi_krb5.h --- configure | 35 +++++++++++++++++++++++++++++------ configure.ac | 20 ++++++++++++++++---- 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/configure b/configure index bbee60e776..cf9dcb1144 100755 --- a/configure +++ b/configure @@ -16248,8 +16248,13 @@ fi done if test "" = "$ISC_PLATFORM_GSSAPIHEADER"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: krb5-config: gssapi.h not found" >&5 -printf "%s\n" "krb5-config: gssapi.h not found" >&6; } + case "$use_gssapi" in + auto|yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: krb5-config: gssapi.h not found" >&5 +printf "%s\n" "krb5-config: gssapi.h not found" >&6; };; + *) + as_fn_error $? "krb5-config: gssapi.h not found" "$LINENO" 5;; + esac CPPFLAGS="$saved_cppflags" use_gssapi="yes" else @@ -16267,11 +16272,29 @@ fi done if test "" = "$ISC_PLATFORM_KRB5HEADER"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: krb5-config: krb5.h not found" >&5 -printf "%s\n" "krb5-config: krb5.h not found" >&6; } + case "$use_gssapi" in + auto|yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: krb5-config: krb5.h not found" >&5 +printf "%s\n" "krb5-config: krb5.h not found" >&6; };; + *) + as_fn_error $? "krb5-config: krb5.h not found" "$LINENO" 5;; + esac CPPFLAGS="$saved_cppflags" use_gssapi="yes" else + for ac_header in gssapi_krb5.h gssapi/gssapi_krb5.h +do : + as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + ISC_PLATFORM_GSSAPI_KRB5_HEADER="#define ISC_PLATFORM_GSSAPI_KRB5_HEADER <$ac_header>" +fi + +done CPPFLAGS="$saved_cppflags" saved_libs="$LIBS" LIBS=$gssapi_libs @@ -16306,9 +16329,9 @@ printf "%s\n" "krb5-config: linked" >&6; } case "$use_gssapi" in auto|yes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: krb5-config: could not determine proper GSSAPI linkage" >&5 -printf "%s\n" "krb5-config: could not determine proper GSSAPI linkage" >&6; } ;; +printf "%s\n" "krb5-config: could not determine proper GSSAPI linkage" >&6; };; *) - as_fn_error $? "krb5-config: could not determine proper GSSAPI linkage" "$LINENO" 5 ;; + as_fn_error $? "krb5-config: could not determine proper GSSAPI linkage" "$LINENO" 5;; esac ;; esac diff --git a/configure.ac b/configure.ac index 5972ca33fb..43bb7b8b9b 100644 --- a/configure.ac +++ b/configure.ac @@ -930,17 +930,29 @@ case "$use_gssapi" in AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h, [ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"]) if test "" = "$ISC_PLATFORM_GSSAPIHEADER"; then - AC_MSG_RESULT([krb5-config: gssapi.h not found]) + case "$use_gssapi" in + auto|yes) + AC_MSG_RESULT([krb5-config: gssapi.h not found]);; + *) + AC_MSG_ERROR([krb5-config: gssapi.h not found]);; + esac CPPFLAGS="$saved_cppflags" use_gssapi="yes" else AC_CHECK_HEADERS(krb5/krb5.h krb5.h, [ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"]) if test "" = "$ISC_PLATFORM_KRB5HEADER"; then - AC_MSG_RESULT([krb5-config: krb5.h not found]) + case "$use_gssapi" in + auto|yes) + AC_MSG_RESULT([krb5-config: krb5.h not found]);; + *) + AC_MSG_ERROR([krb5-config: krb5.h not found]);; + esac CPPFLAGS="$saved_cppflags" use_gssapi="yes" else + AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h, + [ISC_PLATFORM_GSSAPI_KRB5_HEADER="#define ISC_PLATFORM_GSSAPI_KRB5_HEADER <$ac_header>"]) CPPFLAGS="$saved_cppflags" saved_libs="$LIBS" LIBS=$gssapi_libs @@ -955,9 +967,9 @@ case "$use_gssapi" in no) case "$use_gssapi" in auto|yes) - AC_MSG_RESULT([krb5-config: could not determine proper GSSAPI linkage]) ;; + AC_MSG_RESULT([krb5-config: could not determine proper GSSAPI linkage]);; *) - AC_MSG_ERROR([krb5-config: could not determine proper GSSAPI linkage]) ;; + AC_MSG_ERROR([krb5-config: could not determine proper GSSAPI linkage]);; esac ;; esac