diff --git a/iscsi-scst/kernel/Makefile b/iscsi-scst/kernel/Makefile index c68afabce..0b95fbc77 100644 --- a/iscsi-scst/kernel/Makefile +++ b/iscsi-scst/kernel/Makefile @@ -22,10 +22,12 @@ cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) +enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi) EXTRA_CFLAGS += -I$(src)/../include -I$(SCST_INC_DIR) -EXTRA_CFLAGS += -Wextra $(call cc-option,-Wno-old-style-declaration) \ - -Wno-unused-parameter -Wno-missing-field-initializers +EXTRA_CFLAGS += $(call enable-Wextra,-Wextra \ + $(call cc-option,-Wno-old-style-declaration) \ + -Wno-unused-parameter -Wno-missing-field-initializers) EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS #EXTRA_CFLAGS += -DCONFIG_SCST_TRACING diff --git a/scst/src/Makefile b/scst/src/Makefile index b21a60d3a..035c7e53f 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -118,8 +118,10 @@ INSTALL_DIR := $(DESTDIR)/lib/modules/$(KVER)/extra endif INSTALL_DIR_H := $(DESTDIR)/usr/local/include/scst -EXTRA_CFLAGS += -I$(SCST_INC_DIR) -Wextra -Wno-unused-parameter \ - -Wno-missing-field-initializers +enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi) + +EXTRA_CFLAGS += -I$(SCST_INC_DIR) $(call enable-Wextra,-Wextra \ + -Wno-unused-parameter -Wno-missing-field-initializers) #EXTRA_CFLAGS += -DCONFIG_SCST_STRICT_SERIALIZING diff --git a/scst/src/dev_handlers/Makefile b/scst/src/dev_handlers/Makefile index 45e92e719..5e3ce6326 100644 --- a/scst/src/dev_handlers/Makefile +++ b/scst/src/dev_handlers/Makefile @@ -69,8 +69,10 @@ else INSTALL_DIR := /lib/modules/$(KVER)/extra endif -EXTRA_CFLAGS += -I$(SUBDIRS) -I$(SCST_INC_DIR) -Wextra -Wno-unused-parameter \ - -Wno-missing-field-initializers +enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi) + +EXTRA_CFLAGS += -I$(SUBDIRS) -I$(SCST_INC_DIR) $(call enable-Wextra,-Wextra \ + -Wno-unused-parameter -Wno-missing-field-initializers) EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS diff --git a/scst_local/Makefile b/scst_local/Makefile index 644902064..4c8f4ef96 100644 --- a/scst_local/Makefile +++ b/scst_local/Makefile @@ -8,8 +8,11 @@ SCST_INC_DIR := $(SUBDIRS)/../scst/include/ SCST_DIR := $(shell pwd)/../scst/src KMOD := $(shell pwd)/kernel +enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi) + EXTRA_CFLAGS += -I$(SCST_INC_DIR) -I$(SCST_DIR) -EXTRA_CFLAGS += -Wextra -Wno-unused-parameter -Wno-missing-field-initializers +EXTRA_CFLAGS += $(call enable-Wextra,-Wextra -Wno-unused-parameter\ + -Wno-missing-field-initializers) #EXTRA_CFLAGS += -DCONFIG_SCST_LOCAL_FORCE_DIRECT_PROCESSING