From patchwork Fri Jun 2 03:09:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 9761463 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 9A506602BC for ; Fri, 2 Jun 2017 03:09:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E5A81FFB1 for ; Fri, 2 Jun 2017 03:09:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82FF4201B0; Fri, 2 Jun 2017 03:09:30 +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=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 392511FFB1 for ; Fri, 2 Jun 2017 03:09:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 10DF3C057EC9; Fri, 2 Jun 2017 03:09:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 10DF3C057EC9 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 10DF3C057EC9 Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A1B087978; Fri, 2 Jun 2017 03:09:28 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 46F614BB7F; Fri, 2 Jun 2017 03:09:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5239QDv007467 for ; Thu, 1 Jun 2017 23:09:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1231678011; Fri, 2 Jun 2017 03:09:26 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from redhat.com (octiron.msp.redhat.com [10.15.80.209]) by smtp.corp.redhat.com (Postfix) with SMTP id C63F57800F; Fri, 2 Jun 2017 03:09:22 +0000 (UTC) Received: by redhat.com (sSMTP sendmail emulation); Thu, 01 Jun 2017 22:09:19 -0500 From: "Benjamin Marzinski" To: device-mapper development Date: Thu, 1 Jun 2017 22:09:09 -0500 Message-Id: <1496372952-27110-3-git-send-email-bmarzins@redhat.com> In-Reply-To: <1496372952-27110-1-git-send-email-bmarzins@redhat.com> References: <1496372952-27110-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: dm-devel@redhat.com Cc: Martin Wilck Subject: [dm-devel] [PATCH 2/5] libmultipath: change how RADOS checker is enabled X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 02 Jun 2017 03:09:29 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP Instead of making the user call "make", "make install" and "make clean" with ENABLE_RADOS set correctly, have the makefile check if /usr/include/rados/librados.h exists, just like it checks if specific functions exist in a file. Signed-off-by: Benjamin Marzinski --- Makefile.inc | 13 +++++++++++++ libmultipath/checkers/Makefile | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc index 1815f9a..ec41dbf 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -109,5 +109,18 @@ check_func = \ echo "$$found" \ ) +# Checker whether a file with name $1 exists +check_file = $(shell \ + if [ -f "$1" ]; then \ + found=1; \ + status="yes"; \ + else \ + found=0; \ + status="no"; \ + fi; \ + echo 1>&2 "Checking if $1 exists ... $$status"; \ + echo "$$found" \ + ) + %.o: %.c $(CC) $(CFLAGS) -c -o $@ $< diff --git a/libmultipath/checkers/Makefile b/libmultipath/checkers/Makefile index 732ca9d..bce6b8b 100644 --- a/libmultipath/checkers/Makefile +++ b/libmultipath/checkers/Makefile @@ -14,7 +14,8 @@ LIBS= \ libcheckemc_clariion.so \ libcheckhp_sw.so \ libcheckrdac.so -ifneq ($(ENABLE_RADOS),0) + +ifneq ($(call check_file,/usr/include/rados/librados.h),0) LIBS += libcheckrbd.so endif