summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-05-28 18:22:01 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-06-08 18:56:01 +0900
commita4353898980cc46b28c03fc401d4d916d82c6f4f (patch)
tree4dd1672d9992cd8d4cfc85b6e7889f2dbad6a1e6 /init
parent2a61f4747eeaa85ce26ca9fbd81421b15facd018 (diff)
downloadlinux-rpi3-a4353898980cc46b28c03fc401d4d916d82c6f4f.tar.gz
linux-rpi3-a4353898980cc46b28c03fc401d4d916d82c6f4f.tar.bz2
linux-rpi3-a4353898980cc46b28c03fc401d4d916d82c6f4f.zip
kconfig: add CC_IS_GCC and GCC_VERSION
This will be useful to specify the required compiler version, like this: config FOO bool "Use Foo" depends on GCC_VERSION >= 40800 help This feature requires GCC 4.8 or newer. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig8
1 files changed, 8 insertions, 0 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 22ca30f6a6bd..66c8fd1f1d8e 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -8,6 +8,14 @@ config DEFCONFIG_LIST
default ARCH_DEFCONFIG
default "arch/$(ARCH)/defconfig"
+config CC_IS_GCC
+ def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
+
+config GCC_VERSION
+ int
+ default $(shell,$(srctree)/scripts/gcc-version.sh -p $(CC) | sed 's/^0*//') if CC_IS_GCC
+ default 0
+
config CONSTRUCTORS
bool
depends on !UML