From: "Luis R. Rodriguez" <mcgrof@kernel.org>
To: fstests@vger.kernel.org
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
"Luis R. Rodriguez" <mcgrof@kernel.org>
Subject: [PATCH 4/9] build: update AC_PACKAGE_WANT_GDBM() and src/dbtest.c to build
Date: Tue, 12 Dec 2017 16:45:14 -0800 [thread overview]
Message-ID: <20171213004519.29340-5-mcgrof@kernel.org> (raw)
In-Reply-To: <20171213004519.29340-1-mcgrof@kernel.org>
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 gdbm.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>
---
m4/package_gdbmdev.m4 | 8 ++++++++
src/dbtest.c | 1 +
2 files changed, 9 insertions(+)
diff --git a/m4/package_gdbmdev.m4 b/m4/package_gdbmdev.m4
index 734a192baf4d..e96343168478 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
diff --git a/src/dbtest.c b/src/dbtest.c
index ec8db0b93a4e..f45db4ac2b19 100644
--- a/src/dbtest.c
+++ b/src/dbtest.c
@@ -24,6 +24,7 @@
#include <gdbm-ndbm.h>
#elif HAVE_GDBM_H
#include <gdbm.h>
+#include <ndbm.h>
#elif HAVE_NDBM_H
#include <ndbm.h>
#else
--
2.15.0
next prev parent reply other threads:[~2017-12-13 0:45 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-13 0:45 [PATCH 0/9] fstests: few updates Luis R. Rodriguez
2017-12-13 0:45 ` [PATCH 1/9] generic/381: use username fsgqa-381 Luis R. Rodriguez
2017-12-13 2:11 ` Theodore Ts'o
2017-12-13 21:41 ` Dave Chinner
2017-12-13 0:45 ` [PATCH 2/9] README: document group fsgqa is required Luis R. Rodriguez
2017-12-13 0:45 ` [PATCH 3/9] generic/group: add 304 to dedupe group Luis R. Rodriguez
2017-12-13 0:45 ` Luis R. Rodriguez [this message]
2017-12-14 5:51 ` [PATCH 4/9] build: update AC_PACKAGE_WANT_GDBM() and src/dbtest.c to build Eryu Guan
2017-12-14 17:55 ` Luis R. Rodriguez
2017-12-15 7:14 ` Eryu Guan
2018-03-15 21:25 ` Jeff Mahoney
2017-12-13 0:45 ` [PATCH 5/9] tests/xfs/group: add group for tests which require a logdev Luis R. Rodriguez
2017-12-13 21:50 ` Dave Chinner
2017-12-13 23:00 ` Luis R. Rodriguez
2017-12-13 23:39 ` Dave Chinner
2017-12-14 17:48 ` Luis R. Rodriguez
2017-12-13 0:45 ` [PATCH 6/9] tests/ext4/group: " Luis R. Rodriguez
2017-12-13 0:45 ` [PATCH 7/9] tests/xfs/group: add realtimedev group Luis R. Rodriguez
2017-12-13 0:45 ` [PATCH 8/9] tests/xfs/group: add group for tests which require mkfs v4_5 Luis R. Rodriguez
2017-12-13 21:55 ` Dave Chinner
2017-12-13 0:45 ` [PATCH 9/9] tests/xfs/group: add injection group Luis R. Rodriguez
2017-12-13 21:52 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171213004519.29340-5-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).