summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@kernel.org>2017-12-12 16:45:14 -0800
committerEryu Guan <eguan@redhat.com>2017-12-15 15:16:28 +0800
commit2353022e570f53982721386f3055a303f20cbe6c (patch)
tree0c87c1f3813c9c07c21df35ef2a88f0180a99452 /m4
parent07350fc7583d26f183091e8cc32617e9bd8f37bb (diff)
build: update AC_PACKAGE_WANT_GDBM() and src/dbtest.c to build
Modern gdbm-devel packages bundle together gdbm.h and ndbm.h. The old m4 macro had detection support for some old gdbm libraries but not for new ones. We fix compilation of src/dbtest.c by making the autoconf helper check for this new arrangement: If both gdbm.h and ndbm.h are found define set both gdbm_ndbm_=true, and have_db=true, and define HAVE_GDBM_H. The src/dbtest.c already had a HAVE_GDBM_H but there was never a respective autoconf settter for it. We can just re-use this and fix it for new arrangement. Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
Diffstat (limited to 'm4')
-rw-r--r--m4/package_gdbmdev.m48
1 files changed, 8 insertions, 0 deletions
diff --git a/m4/package_gdbmdev.m4 b/m4/package_gdbmdev.m4
index 734a192b..e9634316 100644
--- a/m4/package_gdbmdev.m4
+++ b/m4/package_gdbmdev.m4
@@ -28,6 +28,14 @@ AC_DEFUN([AC_PACKAGE_WANT_GDBM],
AC_CHECK_HEADER(gdbm/ndbm.h, [ gdbm_ndbm_=true; have_db=true ], [ gdbm_ndbm_=false; have_db=false ])
if test $gdbm_ndbm_ = true; then
AC_DEFINE(HAVE_GDBM_NDBM_H_, [1], [Define to 1 if you have the <gdbm/ndbm.h> header file.])
+ else
+ AC_CHECK_HEADER(gdbm.h, [ gdbm_ndbm_=true; have_db=true ], [ gdbm_ndbm_=false; have_db=false ])
+ AC_CHECK_HEADER(ndbm.h, [ ndbm_=true ], [ ndbm_=false ])
+ if test $gdbm_ndbm_ = true; then
+ if test $ndbm_ = true; then
+ AC_DEFINE(HAVE_GDBM_H, [1], [Define to 1 if you have both <gdbm.h> and <ndbm.h> header files.])
+ fi
+ fi
fi
fi