Skip to contentSkip to conversation

configure: Fix libnfs cflags and libs

PATCH Applied Damien Le Moal 3 participants 3 messages May 14, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 configure: Fix libnfs cflags and libs

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.

---
Changes from v1:
* Modified CI install action as suggested by Vincent

 ci/actions-install.sh | 2 ++
 configure             | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
ci/actions-install.sh +2 -0
index ad352317..30b815f3 100755
@@ -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
configure +2 -2
index 715f0602..986eb0a6 100755
@@ -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"
Signature · 1 line
2.49.0
Applied
#2 lore raw
In reply to Damien Le Moal
Quoted 47 lines · Damien Le Moal

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.

---
Changes from v1:
* Modified CI install action as suggested by Vincent

  ci/actions-install.sh | 2 ++
  configure             | 4 ++--
  2 files changed, 4 insertions(+), 2 deletions(-)
ci/actions-install.sh +2 -0
index ad352317..30b815f3 100755
@@ -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
configure +0 -0
index 715f0602..986eb0a6 100755

configure print_config "DAOS File System (dfs) Engine" "$dfs" · line 2368

Quoted 10 lines
configure +2 -2
@@ -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"

Applied. Thanks.

Vincent