direct-io.hg

changeset 7975:b6ebabe4658a

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>
author kaf24@firebug.cl.cam.ac.uk
date Wed Nov 23 11:15:18 2005 +0100 (2005-11-23)
parents 393256b2ead0
children be41d7631c2f 9cc161c08b59
files Config.mk xen/Rules.mk
line diff
     1.1 --- a/Config.mk	Tue Nov 22 19:10:50 2005 +0100
     1.2 +++ b/Config.mk	Wed Nov 23 11:15:18 2005 +0100
     1.3 @@ -8,7 +8,6 @@ XEN_TARGET_X86_PAE  ?= n
     1.4  # Tools to run on system hosting the build
     1.5  HOSTCC     = gcc
     1.6  HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
     1.7 -HOSTCFLAGS += -Wdeclaration-after-statement
     1.8  
     1.9  AS         = $(CROSS_COMPILE)as
    1.10  LD         = $(CROSS_COMPILE)ld
    1.11 @@ -39,7 +38,10 @@ EXTRA_INCLUDES += $(EXTRA_PREFIX)/includ
    1.12  EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBDIR)
    1.13  endif
    1.14  
    1.15 -CFLAGS += -Wdeclaration-after-statement 
    1.16 +test-gcc-flag = $(shell $(CC) -v --help 2>&1 | grep -q " $(1) " && echo $(1))
    1.17 +
    1.18 +HOSTCFLAGS += $(call test-gcc-flag,-Wdeclaration-after-statement)
    1.19 +CFLAGS     += $(call test-gcc-flag,-Wdeclaration-after-statement)
    1.20  
    1.21  LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) 
    1.22  CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
     2.1 --- a/xen/Rules.mk	Tue Nov 22 19:10:50 2005 +0100
     2.2 +++ b/xen/Rules.mk	Wed Nov 23 11:15:18 2005 +0100
     2.3 @@ -43,8 +43,6 @@ CFLAGS += -DACM_SECURITY
     2.4  endif
     2.5  ALL_OBJS += $(BASEDIR)/arch/$(TARGET_ARCH)/arch.o
     2.6  
     2.7 -test-gcc-flag = $(shell $(CC) -v --help 2>&1 | grep -q " $(1) " && echo $(1))
     2.8 -
     2.9  include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
    2.10  
    2.11  ifneq ($(debug),y)