From patchwork Wed Dec 13 00:45:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 10108527 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DADA8602B3 for ; Wed, 13 Dec 2017 00:47:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCA8328563 for ; Wed, 13 Dec 2017 00:47:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1E80288DF; Wed, 13 Dec 2017 00:47:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7879728563 for ; Wed, 13 Dec 2017 00:47:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753159AbdLMAql (ORCPT ); Tue, 12 Dec 2017 19:46:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:37286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752956AbdLMAp2 (ORCPT ); Tue, 12 Dec 2017 19:45:28 -0500 Received: from garbanzo.do-not-panic.com (c-73-15-241-2.hsd1.ca.comcast.net [73.15.241.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D33E621869; Wed, 13 Dec 2017 00:45:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D33E621869 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=mcgrof@kernel.org From: "Luis R. Rodriguez" To: fstests@vger.kernel.org Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, "Luis R. Rodriguez" 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 Message-Id: <20171213004519.29340-5-mcgrof@kernel.org> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20171213004519.29340-1-mcgrof@kernel.org> References: <20171213004519.29340-1-mcgrof@kernel.org> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 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 and 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 #elif HAVE_GDBM_H #include +#include #elif HAVE_NDBM_H #include #else