Make SCST interface compatibility more robust

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5668 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2014-07-10 01:00:29 +00:00
parent 56d89d0258
commit 3eb2b2bb7e
4 changed files with 23 additions and 4 deletions

View File

@@ -250,7 +250,7 @@ static inline bool list_entry_in_list(const struct list_head *entry)
}
#define SCST_INTERFACE_VERSION \
SCST_VERSION_STRING "$Revision$" SCST_CONST_VERSION
SCST_VERSION_STRING SCST_INTF_VER SCST_CONST_VERSION
#define SCST_LOCAL_NAME "scst_local"

View File

@@ -35,6 +35,8 @@
#include <errno.h>
#endif
#include "scst_itf_ver.h"
/*
* Version numbers, the same as for the kernel.
*
@@ -51,7 +53,7 @@
#define SCST_VERSION_NAME "3.1.0-pre1"
#define SCST_VERSION_STRING SCST_VERSION_NAME SCST_VERSION_STRING_SUFFIX
#define SCST_CONST_VERSION "$Revision$"
#define SCST_CONST_VERSION SCST_CONST_INTF_VER
/*** Shared constants between user and kernel spaces ***/

View File

@@ -32,7 +32,7 @@
#define DEV_USER_PATH "/dev/"
#define DEV_USER_VERSION_NAME SCST_VERSION_NAME
#define DEV_USER_VERSION \
DEV_USER_VERSION_NAME "$Revision$" SCST_CONST_VERSION
DEV_USER_VERSION_NAME DEV_USER_INTF_VER SCST_CONST_VERSION
#define SCST_USER_PARSE_STANDARD 0
#define SCST_USER_PARSE_CALL 1

View File

@@ -73,7 +73,23 @@ ifeq ($(INSTALL_MOD_PATH),)
export INSTALL_MOD_PATH := $(DESTDIR)
endif
all:
ifeq ($(SCST_INC_DIR),)
SCST_INC_DIR := ../include
endif
SCST_INTF_VER_FILE := $(SCST_INC_DIR)/scst_itf_ver.h
$(SCST_INTF_VER_FILE): $(SCST_INC_DIR)/scst.h $(SCST_INC_DIR)/scst_const.h $(SCST_INC_DIR)/scst_user.h
echo "/* Autogenerated, don't edit */" >$(SCST_INTF_VER_FILE)
echo "" >>$(SCST_INTF_VER_FILE)
echo -n "#define SCST_INTF_VER " >>$(SCST_INTF_VER_FILE)
echo "\"`sha1sum $(SCST_INC_DIR)/scst.h|awk '{printf $$1}'`\"" >>$(SCST_INTF_VER_FILE)
echo -n "#define SCST_CONST_INTF_VER " >>$(SCST_INTF_VER_FILE)
echo "\"`sha1sum $(SCST_INC_DIR)/scst_const.h|awk '{printf $$1}'`\"" >>$(SCST_INTF_VER_FILE)
echo -n "#define DEV_USER_INTF_VER " >>$(SCST_INTF_VER_FILE)
echo "\"`sha1sum $(SCST_INC_DIR)/scst_user.h|awk '{printf $$1}'`\"" >>$(SCST_INTF_VER_FILE)
all: $(SCST_INTF_VER_FILE)
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_DEV=m
scst:
@@ -171,6 +187,7 @@ clean:
cd $(DEV_HANDLERS_DIR) && $(MAKE) $@
extraclean: clean
rm -f $(SCST_INTF_VER_FILE)
cd $(DEV_HANDLERS_DIR) && $(MAKE) $@
rm -f *.orig *.rej