mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
Add -Wdeclaration-after-statement to CFLAGS only if the
compiler supports it. Move test-gcc-flag function to Config.mk where it can be used by any component of the build. Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
1 parent
1366ee55cc
commit
9d401b35f0
2 files changed
+4
-4
No files matched your search
@@ -8,7 +8,6 @@ XEN_TARGET_X86_PAE ?= n
|
||||
# Tools to run on system hosting the build
|
||||
HOSTCC = gcc
|
||||
HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
|
||||
HOSTCFLAGS += -Wdeclaration-after-statement
|
||||
|
||||
AS = $(CROSS_COMPILE)as
|
||||
LD = $(CROSS_COMPILE)ld
|
||||
@@ -39,7 +38,10 @@ EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
|
||||
EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBDIR)
|
||||
endif
|
||||
|
||||
CFLAGS += -Wdeclaration-after-statement
|
||||
test-gcc-flag = $(shell $(CC) -v --help 2>&1 | grep -q " $(1) " && echo $(1))
|
||||
|
||||
HOSTCFLAGS += $(call test-gcc-flag,-Wdeclaration-after-statement)
|
||||
CFLAGS += $(call test-gcc-flag,-Wdeclaration-after-statement)
|
||||
|
||||
LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i))
|
||||
CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
|
||||
|
||||