Whamcloud - gitweb
LU-17257 build: use pkg-config to find krb5 libdir 10/53010/3
authorJian Yu <yujian@whamcloud.com>
Tue, 7 Nov 2023 18:18:32 +0000 (10:18 -0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 18 Nov 2023 21:47:15 +0000 (21:47 +0000)
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 <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53010
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Aurelien Degremont <adegremont@nvidia.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/kerberos5.m4

index cb1b33f..b4ee59a 100644 (file)
@@ -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