blob: b4a189c95a8a6ab628c93480e4a920a68768356b [file] [log] [blame]
Emese Revfy6b90bd42016-05-24 00:09:38 +02001ifdef CONFIG_GCC_PLUGINS
2 __PLUGINCC := $(call cc-ifversion, -ge, 0408, $(HOSTCXX), $(HOSTCC))
3 PLUGINCC := $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-plugin.sh "$(__PLUGINCC)" "$(HOSTCXX)" "$(CC)")
4
Emese Revfy0dae7762016-05-24 00:10:35 +02005 gcc-plugin-$(CONFIG_GCC_PLUGIN_CYC_COMPLEXITY) += cyc_complexity_plugin.so
Emese Revfy6b90bd42016-05-24 00:09:38 +02006 GCC_PLUGINS_CFLAGS := $(addprefix -fplugin=$(objtree)/scripts/gcc-plugins/, $(gcc-plugin-y))
7
8 export PLUGINCC GCC_PLUGINS_CFLAGS GCC_PLUGIN
9
10 ifeq ($(PLUGINCC),)
11 ifneq ($(GCC_PLUGINS_CFLAGS),)
12 ifeq ($(call cc-ifversion, -ge, 0405, y), y)
13 PLUGINCC := $(shell $(CONFIG_SHELL) -x $(srctree)/scripts/gcc-plugin.sh "$(__PLUGINCC)" "$(HOSTCXX)" "$(CC)")
14 $(warning warning: your gcc installation does not support plugins, perhaps the necessary headers are missing?)
15 else
16 $(warning warning: your gcc version does not support plugins, you should upgrade it to gcc 4.5 at least)
17 endif
18 endif
19 endif
20
21 KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
22 GCC_PLUGIN := $(gcc-plugin-y)
23
24endif