From 3dd25eeb49d6865f874ffb5d2f962667897e37ba Mon Sep 17 00:00:00 2001 From: bvassche Date: Mon, 4 May 2009 18:55:50 +0000 Subject: [PATCH] Prepend the OFED kernel header paths before the regular kernel header path when compiling on a system where OFED has been installed. git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@819 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/Makefile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/srpt/Makefile b/srpt/Makefile index 228f5fa..9e8ec1d 100644 --- a/srpt/Makefile +++ b/srpt/Makefile @@ -27,6 +27,14 @@ OFED_KERNEL_IB_RPM_INSTALLED:=$(shell if rpm -q kernel-ib >/dev/null 2>&1; then # Whether or not the OFED kernel-ib-devel RPM has been installed. OFED_KERNEL_IB_DEVEL_RPM_INSTALLED:=$(shell if rpm -q kernel-ib-devel >/dev/null 2>&1; then echo true; else echo false; fi) +ifeq ($(OFED_KERNEL_IB_DEVEL_RPM_INSTALLED),true) +# Read OFED's config.mk, which contains the definition of the variable +# BACKPORT_INCLUDES. +include /usr/src/ofa_kernel/config.mk +endif + +OFED_CFLAGS:=$(shell if $(OFED_KERNEL_IB_DEVEL_RPM_INSTALLED); then echo $(BACKPORT_INCLUDES) -I/usr/src/ofa_kernel/include; fi) + # Path of the OFED ib_srpt.ko kernel module. OFED_SRPT_PATH:=/lib/modules/$(KVER)/updates/kernel/drivers/infiniband/ulp/srpt/ib_srpt.ko @@ -35,7 +43,8 @@ OFED_SRPT_INSTALLED:=$(shell if [ -e $(OFED_SRPT_PATH) ]; then echo true; else e all: src/$(MODULE_SYMVERS) - $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src modules + $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src \ + EXTRA_PRE_CFLAGS="$(OFED_CFLAGS)" modules install: all src/ib_srpt.ko @eval `sed -n 's/#define UTS_RELEASE /KERNELRELEASE=/p' $(KDIR)/include/linux/version.h $(KDIR)/include/linux/utsrelease.h 2>/dev/null`; \ @@ -56,6 +65,11 @@ src/Module.symvers src/Modules.symvers: $(SCST_DIR)/$(MODULE_SYMVERS) echo "Error: OFED has been built with srpt=y in ofed.conf."; \ echo "Rebuild OFED with srpt=n."; \ false; \ + elif ! grep -wq '^c_flags .*EXTRA_PRE_CFLAGS' \ + $(KDIR)/scripts/Makefile.lib; then \ + echo "Error: $(KDIR)/scripts/Makefile.lib has not yet" \ + "been patched."; \ + false; \ else \ ( \ grep -v drivers/infiniband/ $<; \ -- 2.17.1