build: AC_PACKAGE_WANT_GDBM, fall back to compat if libgdbm detection fails

We currently check if libgdbm_compat contains the required symbols
even if libgdbm does. Let's fall back only when necessary (which is
pretty much always anyway).

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Jeff Mahoney
2018-03-15 17:54:53 -04:00
committed by Eryu Guan
parent 81d27bdc0a
commit 156dafb888
+8 -9
View File
@@ -30,16 +30,15 @@ AC_DEFUN([AC_PACKAGE_WANT_GDBM],
if test $found = true; then
libgdbm="${libgdbm} -lgdbm"
fi
else
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="false",-lgdbm)
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 -lgdbm"
if test $found = true ; then
libgdbm="${libgdbm} -lgdbm_compat -lgdbm"
fi
fi
fi