mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-17 12:46:27 +00:00
srpt/Makefile: Add support for detecting MOFED on Debian systems
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7355 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
+14
-14
@@ -53,16 +53,16 @@ SRC_FILES=$(wildcard */*.[ch])
|
||||
MODULE_SYMVERS:=$(shell if [ -e "$(KDIR)/Module.symvers" ]; then \
|
||||
echo Module.symvers; else echo Modules.symvers; fi)
|
||||
|
||||
# Name of the OFED kernel RPM.
|
||||
OFED_KERNEL_IB_RPM:=$(shell for r in mlnx-ofa_kernel compat-rdma kernel-ib; do rpm -q $$r 2>/dev/null | grep -q "^$$r" && echo $$r && break; done)
|
||||
# Name of the OFED kernel package.
|
||||
OFED_KERNEL_IB_PKG:=$(shell for r in mlnx-ofa_kernel compat-rdma kernel-ib; do rpm -q $$r 2>/dev/null | grep -q "^$$r" && echo "$$r" && break; done; for p in mlnx-ofed-kernel-dkms; do dpkg-query -s "$$p" >/dev/null 2>&1 && echo "$$p" && break; done)
|
||||
|
||||
# Name of the OFED kernel development RPM.
|
||||
OFED_KERNEL_IB_DEVEL_RPM:=$(shell for r in mlnx-ofa_kernel-devel compat-rdma-devel kernel-ib-devel; do rpm -q $$r 2>/dev/null | grep -q "^$$r" && echo $$r && break; done)
|
||||
# Name of the OFED kernel development package.
|
||||
OFED_KERNEL_IB_DEVEL_PKG:=$(shell for r in mlnx-ofa_kernel-devel compat-rdma-devel kernel-ib-devel; do rpm -q $$r 2>/dev/null | grep -q "^$$r" && echo "$$r" && break; done; for p in mlnx-ofed-kernel-dkms; do dpkg-query -s "$$p" >/dev/null 2>&1 && echo "$$p" && break; done)
|
||||
|
||||
OFED_FLAVOR=$(shell if [ -e /usr/bin/ofed_info ]; then /usr/bin/ofed_info 2>/dev/null | head -n1 | sed -n 's/^\(MLNX_OFED\|OFED-internal\).*/MOFED/p;s/^OFED-.*/OFED/p'; else echo in-tree; fi)
|
||||
|
||||
ifneq ($(OFED_KERNEL_IB_RPM),)
|
||||
ifeq ($(OFED_KERNEL_IB_RPM),compat-rdma)
|
||||
ifneq ($(OFED_KERNEL_IB_PKG),)
|
||||
ifeq ($(OFED_KERNEL_IB_PKG),compat-rdma)
|
||||
# OFED 3.x
|
||||
OFED_KERNEL_DIR:=/usr/src/compat-rdma
|
||||
OFED_CFLAGS:=-I$(OFED_KERNEL_DIR)/include
|
||||
@@ -72,7 +72,7 @@ ifeq ($(OFED_FLAVOR),MOFED)
|
||||
# header files use the LINUX_BACKPORT() macro without including
|
||||
# <linux/compat-2.6.h>, 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)
|
||||
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_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.)
|
||||
@@ -126,17 +126,17 @@ uninstall:
|
||||
-/sbin/depmod -b $(INSTALL_MOD_PATH)/ -a $(KVER)
|
||||
|
||||
check:
|
||||
@if [ -n "$(OFED_KERNEL_IB_RPM)" ]; then \
|
||||
if [ -z "$(OFED_KERNEL_IB_DEVEL_RPM)" ]; then \
|
||||
echo "Error: the OFED package $(OFED_KERNEL_IB_RPM)-devel has" \
|
||||
"not yet been installed."; \
|
||||
@if [ -n "$(OFED_KERNEL_IB_PKG)" ]; then \
|
||||
if [ -z "$(OFED_KERNEL_IB_DEVEL_PKG)" ]; then \
|
||||
echo "Error: the OFED development package has not yet been" \
|
||||
"installed."; \
|
||||
false; \
|
||||
else \
|
||||
echo " Building against $(OFED_FLAVOR) $(OFED_KERNEL_IB_RPM)" \
|
||||
"InfiniBand kernel headers."; \
|
||||
echo " Building against $(OFED_FLAVOR) $(OFED_KERNEL_IB_PKG)" \
|
||||
"$(OFED_VERS) InfiniBand kernel headers."; \
|
||||
fi \
|
||||
else \
|
||||
if [ -n "$(OFED_KERNEL_IB_DEVEL_RPM)" ]; then \
|
||||
if [ -n "$(OFED_KERNEL_IB_DEVEL_PKG)" ]; then \
|
||||
echo "Error: the OFED kernel package has not yet been" \
|
||||
"installed."; \
|
||||
false; \
|
||||
|
||||
Reference in New Issue
Block a user