Skip to content

Commit a435389

Browse files
committed
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 <[email protected]> Reviewed-by: Kees Cook <[email protected]>
1 parent 2a61f47 commit a435389

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

init/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ config DEFCONFIG_LIST
88
default ARCH_DEFCONFIG
99
default "arch/$(ARCH)/defconfig"
1010

11+
config CC_IS_GCC
12+
def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
13+
14+
config GCC_VERSION
15+
int
16+
default $(shell,$(srctree)/scripts/gcc-version.sh -p $(CC) | sed 's/^0*//') if CC_IS_GCC
17+
default 0
18+
1119
config CONSTRUCTORS
1220
bool
1321
depends on !UML

0 commit comments

Comments
 (0)