configure: Fix libnfs cflags and libs
authorDamien Le Moal <dlemoal@kernel.org>
Wed, 14 May 2025 07:07:54 +0000 (16:07 +0900)
committerVincent Fu <vincent.fu@samsung.com>
Wed, 14 May 2025 10:56:13 +0000 (06:56 -0400)
libnfs version 16 requires the gnutls library. Without specifying at
least -lgnutls, builds fail:

  LINK fio
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/15/../../../../lib64/libnfs.so: undefined reference to `gnutls_certificate_set_x509_trust_dir'
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/15/../../../../lib64/libnfs.so: undefined reference to `gnutls_transport_set_int2'
...

Modify the configure script to add cflags and library options for gnutls
to correctly build libnfs engine.

Also make sure that the CI install the gnutls library header files.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20250514070754.38281-1-dlemoal@kernel.org
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
ci/actions-install.sh
configure

index ad3523174c746a34546e4062af179984ce064f17..30b815f3a8a20ac5a6f0893c52502d645fb39306 100755 (executable)
@@ -32,6 +32,7 @@ DPKGCFG
         libcunit1-dev
         libcurl4-openssl-dev
         libfl-dev
+       libgnutls28-dev
         libnuma-dev
        libnfs-dev
         valgrind
@@ -106,6 +107,7 @@ install_fedora() {
         bison-devel
         git
         flex-devel
+       gnutls-devel
         gperftools
         isa-l-devel
         kernel-devel
index 715f060235ad8f692b2d22cebd4e7de5638007a2..986eb0a681488ee4ff5d31acb403247ebdca867c 100755 (executable)
--- a/configure
+++ b/configure
@@ -2361,8 +2361,8 @@ print_config "DAOS File System (dfs) Engine" "$dfs"
 if test "$libnfs" != "no" ; then
   if $(pkg-config libnfs > /dev/null 2>&1); then
     libnfs="yes"
-    libnfs_cflags=$(pkg-config --cflags libnfs)
-    libnfs_libs=$(pkg-config --libs libnfs)
+    libnfs_cflags=$(pkg-config --cflags libnfs gnutls)
+    libnfs_libs=$(pkg-config --libs libnfs gnutls)
   else
     if test "$libnfs" = "yes" ; then
       feature_not_found "libnfs" "libnfs"