diff options
-rw-r--r-- | config/Config-kernel.in | 4 | ||||
-rw-r--r-- | include/kernel-defaults.mk | 4 | ||||
-rw-r--r-- | tools/Makefile | 1 | ||||
-rw-r--r-- | tools/sparse/Makefile | 22 |
4 files changed, 31 insertions, 0 deletions
diff --git a/config/Config-kernel.in b/config/Config-kernel.in index a475e9aae2..dd83cf9e7c 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -144,6 +144,10 @@ config USE_RFKILL bool "Enable rfkill support" default RFKILL_SUPPORT +config USE_SPARSE + bool "Enable sparse check during kernel build" + default n + # # CGROUP support symbols # diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index caaa09d51d..322aeed5fa 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -24,6 +24,10 @@ ifneq (,$(KERNEL_CC)) KERNEL_MAKEOPTS += CC="$(KERNEL_CC)" endif +ifdef CONFIG_USE_SPARSE + KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse +endif + export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include # defined in quilt.mk diff --git a/tools/Makefile b/tools/Makefile index 428cf0bedb..75d2b0d892 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -38,6 +38,7 @@ tools-$(CONFIG_TARGET_ar71xx) += lzma-old squashfs tools-y += lzma squashfs4 tools-$(BUILD_B43_TOOLS) += b43-tools tools-$(BUILD_PPL_CLOOG) += ppl cloog +tools-$(CONFIG_USE_SPARSE) += sparse # builddir dependencies $(curdir)/bison/compile := $(curdir)/flex/install diff --git a/tools/sparse/Makefile b/tools/sparse/Makefile new file mode 100644 index 0000000000..6cdeed5cca --- /dev/null +++ b/tools/sparse/Makefile @@ -0,0 +1,22 @@ +# +# Copyright (C) 2014 Qualcomm-Atheros Inc. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=sparse +PKG_VERSION:=0.5.0 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@KERNEL/software/devel/sparse/dist/ +PKG_MD5SUM:=68bc834c57836251fbee55a7707bab39 + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/host-build.mk + +define Host/Install + $(INSTALL_BIN) $(HOST_BUILD_DIR)/sparse $(STAGING_DIR_HOST)/bin +endef + +$(eval $(call HostBuild)) |