Allow install SCST in any location

Currently the install location of SCST is pretty much hard coded into 
the Makefiles to be /usr/local.

I am custom building a system for ZFS & SCST and I want to install in 
/usr instead of /usr/local.

Currently I am doing a “find . -name Makefile -exec sed -i 's:/usr/local:/usr:g'
{} \;” to accommodate this.

This patch fixes it.

From Sietse van Zanen <sietse@wizdom.nu>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4791 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2013-03-08 21:25:45 +00:00
parent 9ea9eec4ef
commit 369863f015
13 changed files with 71 additions and 21 deletions

View File

@@ -26,6 +26,10 @@
# - install and uninstall must be made as root
#
ifndef PREFIX
PREFIX=/usr/local
endif
ifeq ($(KVER),)
ifeq ($(KDIR),)
KVER = $(shell uname -r)
@@ -58,9 +62,9 @@ include $(SUBDIRS)/Makefile_in-tree
else
SCST_INC_DIR := $(shell if [ -e "$$PWD/../scst" ]; \
then echo "$$PWD/../scst/include"; \
else echo "/usr/local/include/scst"; fi)
else echo "$(PREFIX)/include/scst"; fi)
SCST_DIR := $(shell if [ -e "$$PWD/../scst" ]; then echo "$$PWD/../scst/src"; \
else echo "/usr/local/include/scst"; fi)
else echo "$(PREFIX)/include/scst"; fi)
all: Modules.symvers Module.symvers
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \

View File

@@ -5,19 +5,23 @@
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (not a .c file).
ifndef PREFIX
PREFIX=/usr/local
endif
SHELL=/bin/bash
SUBDIRS := $(shell pwd)
SCST_INC_DIR := $(shell if [ -e "$$PWD/../scst" ]; \
then echo "$$PWD/../scst/include"; \
else echo "/usr/local/include/scst"; fi)
else echo "$(PREFIX)/include/scst"; fi)
SCST_DIR := $(shell if [ -e "$$PWD/../scst" ]; then echo "$$PWD/../scst/src"; \
else echo "/usr/local/include/scst"; fi)
SBINDIR := /usr/local/sbin
else echo "$(PREFIX)/include/scst"; fi)
SBINDIR := $(PREFIX)/sbin
INITDIR := /etc/init.d
RCDIR := /etc/rc.d
MANDIR := /usr/local/man
MANDIR := $(PREFIX)/man
KMOD := $(shell pwd)/kernel
INCDIR := $(shell pwd)/include

View File

@@ -15,6 +15,10 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
ifndef PREFIX
PREFIX=/usr/local
endif
SRCS_D = iscsid.c iscsi_scstd.c conn.c session.c target.c message.c ctldev.c \
log.c chap.c event.c param.c config.c isns.c md5.c sha1.c \
misc.c
@@ -24,7 +28,7 @@ SRCS_ADM = iscsi_adm.c param.c
OBJS_ADM = $(SRCS_ADM:.c=.o)
SCST_INC_DIR := ../../scst/include
#SCST_INC_DIR := /usr/local/include/scst
#SCST_INC_DIR := $(PREFIX)/include/scst
CFLAGS += -O2 -fno-inline -Wall -Wextra -Wstrict-prototypes -Wno-sign-compare \
-Wimplicit-function-declaration -Wno-unused-parameter \

View File

@@ -20,7 +20,11 @@
# - install and uninstall must be made as root
#
#SCST_INC_DIR := /usr/local/include/scst
ifndef PREFIX
PREFIX=/usr/local
endif
#SCST_INC_DIR := $(PREFIX)/include/scst
#SCST_DIR := $(SCST_INC_DIR)
SCST_INC_DIR := $(SUBDIRS)/../scst/include
SCST_DIR := $(shell pwd)/../scst/src

View File

@@ -25,6 +25,9 @@
# - install and uninstall must be made as root
#
ifndef PREFIX
PREFIX=/usr/local
endif
ifeq ($(KVER),)
ifeq ($(KDIR),)
@@ -38,7 +41,7 @@ endif
export PWD := $(shell pwd)
export LIBSAS := m
#SCST_INC_DIR := /usr/local/include/scst
#SCST_INC_DIR := $(PREFIX)/include/scst
#SCST_DIR := $(SCST_INC_DIR)
SCST_INC_DIR := $(SUBDIRS)/../scst/include
SCST_DIR := $(shell pwd)/../scst/src

View File

@@ -28,6 +28,10 @@
# - install and uninstall must be made as root
#
ifndef PREFIX
PREFIX=/usr/local
endif
SHELL=/bin/bash
EXTRA_CFLAGS += -I$(SCST_INC_DIR)
@@ -69,10 +73,10 @@ else
SCST_INC_DIR := $(shell if [ -e "$$PWD/../../scst" ]; \
then echo "$$PWD/../../scst/include"; \
else echo "/usr/local/include/scst"; fi)
else echo "$(PREFIX)/include/scst"; fi)
SCST_DIR := $(shell if [ -e "$$PWD/../../scst" ]; \
then echo "$$PWD/../../scst/src"; \
else echo "/usr/local/include/scst"; fi)
else echo "$(PREFIX)/include/scst"; fi)
ifneq ($(BUILD_2X_MODULE),)
# We need to make qla2xxx_scst before Module.symvers

View File

@@ -28,6 +28,10 @@
# - install and uninstall must be made as root
#
ifndef PREFIX
PREFIX=/usr/local
endif
SHELL=/bin/bash
DEV_HANDLERS_DIR = dev_handlers
@@ -118,7 +122,7 @@ INSTALL_DIR := $(DESTDIR)/lib/modules/$(shell uname -r)/extra
else
INSTALL_DIR := $(DESTDIR)/lib/modules/$(KVER)/extra
endif
INSTALL_DIR_H := $(DESTDIR)/usr/local/include/scst
INSTALL_DIR_H := $(DESTDIR)$(PREFIX)/include/scst
enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi)

View File

@@ -2,6 +2,10 @@
# A Makefile for the scst-local ...
#
ifndef PREFIX
PREFIX=/usr/local
endif
SHELL=/bin/bash
KMOD := $(shell pwd)/kernel
@@ -34,10 +38,10 @@ else
SCST_INC_DIR := $(shell if [ -e "$$PWD/../scst" ]; \
then echo "$$PWD/../scst/include"; \
else echo "/usr/local/include/scst"; fi)
else echo "$(PREFIX)/include/scst"; fi)
SCST_DIR := $(shell if [ -e "$$PWD/../scst" ]; \
then echo "$$PWD/../scst/src"; \
else echo "/usr/local/include/scst"; fi)
else echo "$(PREFIX)/include/scst"; fi)
all: Modules.symvers Module.symvers
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \

View File

@@ -1,10 +1,14 @@
ifndef PREFIX
PREFIX=/usr/local
endif
SCSTADMIN_DIR = $(shell if [ ! -h scstadmin ]; then \
rm -f scstadmin; \
ln -s scstadmin.sysfs scstadmin; \
fi; \
echo scstadmin)
MANDIR := $(DESTDIR)/usr/local/man
MANDIR := $(DESTDIR)$(PREFIX)/man
INITDIR := $(shell if [ -f /etc/slackware-version ]; then \
echo /etc/rc.d; \
else \

View File

@@ -1,7 +1,11 @@
ifndef PREFIX
PREFIX=/usr/local
endif
MODULE_VERSION = 0.8.22
TOOL = scstadmin
SBINDIR := $(PREFIX)/usr/local/sbin
SBINDIR := $(PREFIX)$(PREFIX)/sbin
all: perl-module

View File

@@ -1,7 +1,11 @@
ifndef PREFIX
PREFIX=/usr/local
endif
MODULE_VERSION = 0.9.10
TOOL = scstadmin
SBINDIR := /usr/local/sbin
SBINDIR := $(PREFIX)/sbin
all: perl-module

View File

@@ -1,13 +1,16 @@
#
# Makefile for ib_srpt.ko.
#
ifndef PREFIX
PREFIX=/usr/local
endif
SCST_INC_DIR := $(shell if [ -e "$$PWD/../scst" ]; \
then echo "$$PWD/../scst/include"; \
else echo "/usr/local/include/scst"; fi)
else echo "$(PREFIX)/include/scst"; fi)
SCST_SYMVERS_DIR := $(shell if [ -e $$PWD/../scst ]; then \
echo $$PWD/../scst/src; \
else echo /usr/local/include/scst; fi)
else echo $(PREFIX)/include/scst; fi)
SUBDIRS := $(shell pwd)
ifeq ($(KVER),)

View File

@@ -15,6 +15,10 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
ifndef PREFIX
PREFIX=/usr/local
endif
SHELL=/bin/bash
SRCS_F = fileio.c common.c debug.c crc32.c
@@ -24,8 +28,8 @@ OBJS_F = $(SRCS_F:.c=.o)
#OBJS_C = $(SRCS_C:.c=.o)
SCST_INC_DIR := ../../scst/include
#SCST_INC_DIR := /usr/local/include/scst
INSTALL_DIR := /usr/local/bin/scst
#SCST_INC_DIR := $(PREFIX)/include/scst
INSTALL_DIR := $(PREFIX)/bin/scst
CFLAGS += -O2 -Wall -Wextra -Wno-unused-parameter -Wstrict-prototypes \
-I$(SCST_INC_DIR) -D_GNU_SOURCE -D__USE_FILE_OFFSET64 \