]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
have --with-gssapi={auto|yes} try krb5-config
authorMark Andrews <marka@isc.org>
Mon, 3 May 2021 02:14:13 +0000 (12:14 +1000)
committerMark Andrews <marka@isc.org>
Wed, 30 Jun 2021 02:14:08 +0000 (12:14 +1000)
configure
configure.ac

index 71766b052d048a8f758938db2d9379c861869bc8..bbee60e77609491a79dad11caf49fdf8758cfcd4 100755 (executable)
--- a/configure
+++ b/configure
 # first try using krb5-config, if that does not work then fall back to "yes" method.
 
 case "$use_gssapi" in
-*/krb5-config|krb5-config)
+*/krb5-config|krb5-config|auto|yes)
     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: trying $use_gssapi" >&5
 printf "%s\n" "trying $use_gssapi" >&6; }
-    if test krb5-config = "$use_gssapi"
+    if test krb5-config = "$use_gssapi" -o auto = "$use_gssapi" -o yes = "$use_gssapi"
     then
-       # Extract the first word of "$use_gssapi", so it can be a program name with args.
-set dummy $use_gssapi; ac_word=$2
+       # Extract the first word of "krb5-config", so it can be a program name with args.
+set dummy krb5-config; ac_word=$2
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 printf %s "checking for $ac_word... " >&6; }
 if test ${ac_cv_path_KRB5_CONFIG+y}
 rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
                case $gssapi_linked in
-                   yes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: krb5-config: linked" >&5
-printf "%s\n" "krb5-config: linked" >&6; };;
-                   no)  { 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; }
-                       use_gssapi="yes"
+                   yes)
+                       use_gssapi=krb5-config
+                       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: krb5-config: linked" >&5
+printf "%s\n" "krb5-config: linked" >&6; }
+                       ;;
+                   no)
+                       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; } ;;
+                       *)
+                           as_fn_error $? "krb5-config: could not determine proper GSSAPI linkage" "$LINENO" 5 ;;
+                       esac
                        ;;
                esac
                LIBS=$saved_libs
            fi
         fi
     else
-        use_gssapi="yes"
+       case "$use_gssapi" in
+       auto|yes)
+           { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: krb5-config: not found" >&5
+printf "%s\n" "krb5-config: not found" >&6; }
+           ;;
+       *)
+            as_fn_error $? "krb5-config: not found" "$LINENO" 5
+           ;;
+       esac
     fi
     if test "yes" = "$use_gssapi"; then
        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GSSAPI library, non krb5-config method" >&5
index c7038b8a55ed26c9957007eebe529bebd5be1874..5972ca33fb9396c8df2ef8706485e3a664e555a8 100644 (file)
@@ -913,11 +913,11 @@ AC_ARG_WITH(gssapi,
 # first try using krb5-config, if that does not work then fall back to "yes" method.
 
 case "$use_gssapi" in
-*/krb5-config|krb5-config)
+*/krb5-config|krb5-config|auto|yes)
     AC_MSG_RESULT(trying $use_gssapi)
-    if test krb5-config = "$use_gssapi"
+    if test krb5-config = "$use_gssapi" -o auto = "$use_gssapi" -o yes = "$use_gssapi"
     then
-       AC_PATH_PROG(KRB5_CONFIG, $use_gssapi)
+       AC_PATH_PROG(KRB5_CONFIG, krb5-config)
     else
        KRB5_CONFIG="$use_gssapi"
     fi
@@ -948,15 +948,31 @@ case "$use_gssapi" in
                AC_TRY_LINK( , [gss_acquire_cred();krb5_init_context()],
                    gssapi_linked=yes, gssapi_linked=no)
                case $gssapi_linked in
-                   yes) AC_MSG_RESULT([krb5-config: linked]);;
-                   no)  AC_MSG_ERROR([krb5-config: could not determine proper GSSAPI linkage])
+                   yes)
+                       use_gssapi=krb5-config
+                       AC_MSG_RESULT([krb5-config: linked])
+                       ;;
+                   no)
+                       case "$use_gssapi" in
+                       auto|yes)
+                           AC_MSG_RESULT([krb5-config: could not determine proper GSSAPI linkage]) ;;
+                       *)
+                           AC_MSG_ERROR([krb5-config: could not determine proper GSSAPI linkage]) ;;
+                       esac
                        ;;
                esac
                LIBS=$saved_libs
            fi
         fi
     else
-        AC_MSG_ERROR([krb5-config not found])
+       case "$use_gssapi" in
+       auto|yes)
+           AC_MSG_RESULT([krb5-config: not found])
+           ;;
+       *)
+            AC_MSG_ERROR([krb5-config: not found])
+           ;;
+       esac
     fi
     if test "yes" = "$use_gssapi"; then
        AC_MSG_CHECKING([for GSSAPI library, non krb5-config method])