Skip to contentSkip to conversation

xfstests: fix up autoconf test for libgdbm_compat when building statically

PATCH New Theodore Ts'o 1 participant 1 message Aug 9, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: fix up autoconf test for libgdbm_compat when building statically

When building statically, -lgdbm_compat will not automatically pull in -lgdbm. So this needs to be specified explicitly in AC_CHECK_LIB and in the list of libraries passed to the linker.

---
 m4/package_gdbmdev.m4 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
m4/package_gdbmdev.m4 +5 -5
index ae76e34..734a192 100644
@@ -45,13 +45,13 @@ AC_DEFUN([AC_PACKAGE_WANT_GDBM],
       fi
 
       found="no"
-      AC_CHECK_LIB(gdbm_compat,dbm_open,found=true,found=false)
-      AC_CHECK_LIB(gdbm_compat,dbm_fetch,,found=false)
-      AC_CHECK_LIB(gdbm_compat,dbm_store,,found=false)
-      AC_CHECK_LIB(gdbm_compat,dbm_close,,found="no")
+      AC_CHECK_LIB(gdbm_compat,dbm_open,found=true,found=false,-lgdbm)
+      AC_CHECK_LIB(gdbm_compat,dbm_fetch,,found=false,-lgdbm)
+      AC_CHECK_LIB(gdbm_compat,dbm_store,,found=false,-lgdbm)
+      AC_CHECK_LIB(gdbm_compat,dbm_close,,found="no",-lgdbm)
 
       if test $found = true ; then
-        libgdbm="${libgdbm} -lgdbm_compat"
+        libgdbm="${libgdbm} -lgdbm_compat -lgdbm"
       fi
     fi
 
Signature · 1 line
2.0.0