From 0dd06cbcb952f6a2893487d4e81d3dadb8135173 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 5 Feb 2018 17:12:39 +0000 Subject: [PATCH] srpt/Makefile: Improve MOFED detection further Ensure that MOFED is detected correctly on Debian systems on which the rpm command has been installed ("alien" package). git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7362 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/srpt/Makefile b/srpt/Makefile index c1326cd2c..2c3c4750e 100644 --- a/srpt/Makefile +++ b/srpt/Makefile @@ -72,10 +72,10 @@ ifeq ($(OFED_FLAVOR),MOFED) # header files use the LINUX_BACKPORT() macro without including # , include that header file explicitly. OFED_KERNEL_DIR:=/usr/src/ofa_kernel/default -OFED_VERS=$(shell rpm -q --qf '%{version}\n' mlnx-ofa_kernel-devel 2>/dev/null; dpkg-query -W --showformat='$${Version}\n' mlnx-ofed-kernel-dkms) +OFED_VERS=$(shell rpm -q --qf '%{version}\n' mlnx-ofa_kernel-devel 2>/dev/null | grep -v ' '; dpkg-query -W --showformat='$${Version}\n' mlnx-ofed-kernel-dkms 2>/dev/null) OFED_CFLAGS:=-I$(OFED_KERNEL_DIR)/include -include "linux/compat-2.6.h" -OFED_CFLAGS+=-DMOFED_MAJOR=$(shell echo $(OFED_VERS) | cut -f1 -d.) -OFED_CFLAGS+=-DMOFED_MINOR=$(shell echo $(OFED_VERS) | cut -f2 -d.) +OFED_CFLAGS+=-DMOFED_MAJOR=$(shell echo "$(OFED_VERS)" | sed 's/\([0-9]\+\)[^0-9]\+\([0-9]\+\).*/\1/g') +OFED_CFLAGS+=-DMOFED_MINOR=$(shell echo "$(OFED_VERS)" | sed 's/\([0-9]\+\)[^0-9]\+\([0-9]\+\).*/\2/g') else # OFED 1.5 OFED_KERNEL_DIR:=/usr/src/ofa_kernel