blob: f67880993190065d4aa90bb6b6ac373308b493b1 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From 0be174dbedd861d7694b0c7799fe26be31eb32b0 Mon Sep 17 00:00:00 2001
2From: Benjamin Marzinski <bmarzins@redhat.com>
3Date: Fri, 26 May 2017 17:52:57 -0500
4Subject: [PATCH 08/14] libmultipath: change how RADOS checker is enabled
5
6Instead of making the user call "make", "make install" and "make clean"
7with ENABLE_RADOS set correctly, have the makefile check if
8/usr/include/rados/librados.h exists, just like it checks if specific
9functions exist in a file.
10
11Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
12---
13 Makefile.inc | 13 +++++++++++++
14 libmultipath/checkers/Makefile | 3 ++-
15 2 files changed, 15 insertions(+), 1 deletion(-)
16
17diff --git a/Makefile.inc b/Makefile.inc
18index 2591fa9..e084fd1 100644
19--- a/Makefile.inc
20+++ b/Makefile.inc
21@@ -109,5 +109,18 @@ check_func = \
22 echo "$$found" \
23 )
24
25+# Checker whether a file with name $1 exists
26+check_file = $(shell \
27+ if [ -f "$1" ]; then \
28+ found=1; \
29+ status="yes"; \
30+ else \
31+ found=0; \
32+ status="no"; \
33+ fi; \
34+ echo 1>&2 "Checking if $1 exists ... $$status"; \
35+ echo "$$found" \
36+ )
37+
38 %.o: %.c
39 $(CC) $(CFLAGS) -c -o $@ $<
40diff --git a/libmultipath/checkers/Makefile b/libmultipath/checkers/Makefile
41index 732ca9d..bce6b8b 100644
42--- a/libmultipath/checkers/Makefile
43+++ b/libmultipath/checkers/Makefile
44@@ -14,7 +14,8 @@ LIBS= \
45 libcheckemc_clariion.so \
46 libcheckhp_sw.so \
47 libcheckrdac.so
48-ifneq ($(ENABLE_RADOS),0)
49+
50+ifneq ($(call check_file,/usr/include/rados/librados.h),0)
51 LIBS += libcheckrbd.so
52 endif
53
54--
552.8.1
56