From f7f3247ee2a358d000dc62526a721c1a249354ee Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Tue, 7 Nov 2023 10:18:32 -0800 Subject: [PATCH] LU-17257 build: use pkg-config to find krb5 libdir This patch fixes kerberos5.m4 to use pkg-config to find krb5 libdir instead of looking for the krb5 libraries in a static list of path. Test-Parameters: trivial kerberos=true testlist=sanity-krb5 Change-Id: Ia15812932942171b019f3e73034a78f9185c16ce Signed-off-by: Jian Yu Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53010 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Sebastien Buisson Reviewed-by: Aurelien Degremont Reviewed-by: Oleg Drokin --- lustre/autoconf/kerberos5.m4 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lustre/autoconf/kerberos5.m4 b/lustre/autoconf/kerberos5.m4 index cb1b33f..b4ee59a 100644 --- a/lustre/autoconf/kerberos5.m4 +++ b/lustre/autoconf/kerberos5.m4 @@ -34,12 +34,10 @@ AC_DEFUN([AC_KERBEROS_V5],[ KRBLIBS=`$K5CONFIG --libs gssapi` K5VERS=`$K5CONFIG --version | head -n 1 | awk '{split($(4),v,"."); if (v@<:@"3"@:>@ == "") v@<:@"3"@:>@ = "0"; print v@<:@"1"@:>@v@<:@"2"@:>@v@<:@"3"@:>@ }'` AC_DEFINE_UNQUOTED(KRB5_VERSION, $K5VERS, [Define this as the Kerberos version number]) + sub_dir=`pkg-config --variable=libdir krb5 | sed "s#^$dir/##"` if test -f $dir/include/gssapi/gssapi_krb5.h -a \ - \( -f $dir/lib/libgssapi_krb5.a -o \ - -f $dir/lib64/libgssapi_krb5.a -o \ - -f $dir/lib64/libgssapi_krb5.so -o \ - -f $dir/lib/x86_64-linux-gnu/libgssapi_krb5.so -o \ - -f $dir/lib/libgssapi_krb5.so \) ; then + \( -f $dir/$sub_dir/libgssapi_krb5.a -o \ + -f $dir/$sub_dir/libgssapi_krb5.so \) ; then KRBDIR="$dir" dnl If we are using MIT K5 1.3.1 and before, we *MUST* use the dnl private function (gss_krb5_ccache_name) to get correct -- 1.8.3.1