From 6f8d628d77e39e128cf31af261a62acc47a38754 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Sun, 11 Oct 2015 07:35:41 -0400 Subject: [PATCH] re-enable compile time option checking and make it conditional When building a sinle application, use the compiler option checking macro, disable macro if running sanity checks to speed up build time. Change-Id: I63b17f4bd9fdff9030f1b2550ec8b05ee0bc2df2 Signed-off-by: Anas Nashif --- scripts/Kbuild.include | 20 +++++++++++--------- scripts/sanitycheck | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index a6ab07b38bf..e9c55e6ac5d 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -86,17 +86,19 @@ TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/) # Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise) # Exit code chooses option. "$$TMP" is can be used as temporary file and # is automatically cleaned up. -# try-run = $(shell set -e; \ -# TMP="$(TMPOUT).$$$$.tmp"; \ -# TMPO="$(TMPOUT).$$$$.o"; \ -# if ($(1)) >/dev/null 2>&1; \ -# then echo "$(2)"; \ -# else echo "$(3)"; \ -# fi; \ -# rm -f "$$TMP" "$$TMPO") +ifndef DISABLE_TRYRUN try-run = $(shell set -e; \ + TMP="$(TMPOUT).$$$$.tmp"; \ + TMPO="$(TMPOUT).$$$$.o"; \ + if ($(1)) >/dev/null 2>&1; \ + then echo "$(2)"; \ + else echo "$(3)"; \ + fi; \ + rm -f "$$TMP" "$$TMPO") +else +try-run = $(shell set -e; \ echo "$(2)";) - +endif # as-option # Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,) diff --git a/scripts/sanitycheck b/scripts/sanitycheck index bb621fe7ad4..05bc8bbbc24 100755 --- a/scripts/sanitycheck +++ b/scripts/sanitycheck @@ -100,6 +100,7 @@ import time import csv import glob +os.environ["DISABLE_TRYRUN"] = "1" if "ZEPHYR_BASE" not in os.environ: sys.stderr.write("$ZEPHYR_BASE environment variable undefined.\n") exit(1)