Received: by 10.223.185.116 with SMTP id b49csp1045648wrg; Fri, 16 Feb 2018 11:24:25 -0800 (PST) X-Google-Smtp-Source: AH8x227TLXoWdmUfKrUh5Mme0dlEvT3JbPCN1iUvBWnXY1sTWUlfQyyUE1sDhMJx8b+pyOPFBhcx X-Received: by 10.99.4.66 with SMTP id 63mr5919830pge.93.1518809065053; Fri, 16 Feb 2018 11:24:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518809065; cv=none; d=google.com; s=arc-20160816; b=COMpIhqY18A4wkl/CBAd4jOWt0CZTR6XA/53KdlDxGNnuJxo8nLi1sNvpszEMLKhC9 nXoZZ8SbIb5FrenbPGzciYQ0tksZJa//OtewroLWooRUoYKe2ChzGgcEIKO/Knw/ch+n +KzxdS2znSd1DmjL/faocY+RWJdfYU5wXKeYxp0uPWWUQaHkMhkleNpyKthJOgVfD2Sn WlJCTUIjyjwXDgs5+nz6R/BA9T6dz0EuELIvVXeXgoWM00bVssuO5CCKoLIxg7iqt05Q j2zCCvWfkIDY5g4HGeX0HWK6WbchWWrjfbsVWbuXvkjzs6ZVaLJnv6mT45pR11nggufR 4ocQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=WqMC/J/ZklNycTvQVm5mFpJGFmWJQ7pZGdtACgEPnzo=; b=dmGMjCxHqtXzkz0YbxCrHsfa9h2h5UxG9UmJGX9ozWIKnP+6yCsPoUe8yoiq0VO4Yv uQBLjpC5Nw2S6fvKN+vtHwkF/Ee+hzCIfLEHu7howYDos/cSKugWkHcrHjOJiDMwoq1K PiILMrMqPUbgvv6DWPoI0GxEUiv8hCF5XWlZAzc487ubMSaXuHVBXAFr5qEjhPaJ1uUH hp2GIQPG+HNqIJ1xDAjYRsGTEf9UbgofQdELFax23BXya/A5TPYJN68g5/ebMydtKuA2 zqtNOuRon9BZ/avtwMRhgp/0o3vUBjqFyHMbuJ9SqPUmQ4DexvuPCbXubYXh9fCt6vyo BfFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=RpwtBOh3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y72-v6si4097236plh.556.2018.02.16.11.24.10; Fri, 16 Feb 2018 11:24:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=RpwtBOh3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751794AbeBPSr6 (ORCPT + 99 others); Fri, 16 Feb 2018 13:47:58 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:57773 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752671AbeBPSlS (ORCPT ); Fri, 16 Feb 2018 13:41:18 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-07.nifty.com with ESMTP id w1GIdBTI013418; Sat, 17 Feb 2018 03:39:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w1GIdBTI013418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1518806367; bh=WqMC/J/ZklNycTvQVm5mFpJGFmWJQ7pZGdtACgEPnzo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RpwtBOh33Agt9ZKHvyEquggMIqXrQpHtZ9JjdzB9YLlGxIBCaflbp8OrVKeHX5X2A GWivO+Nkwp/h2D/p4Q+RNiS934RWXKKP87Qy6OrqcJKt8anno0fuNnNFsbPbLZkMDn t/mq/dmdpvUl2OT4zLK+IQ+8+IzsQgODR3Jb+xoovhq9I//rHElqFdxWb3CzR+Di4O YbwX0xPx6GzGsIiwEeIXXoTiMFoek2GXnW2G/6lNeiaYzLCWGfTuO0hx6616LFP4Gh 1+oDynqXTiFXk0iOMsjCY5MqlfhXoPyM7ah4KgjSk8gowhFHDEmNej3ydksuOTi4bM Pq66aLgAhEgOQ== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org, Linus Torvalds Cc: Greg Kroah-Hartman , Arnd Bergmann , Kees Cook , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Michal Marek , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 15/23] kconfig: add CC_IS_GCC and GCC_VERSION Date: Sat, 17 Feb 2018 03:38:43 +0900 Message-Id: <1518806331-7101-16-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518806331-7101-1-git-send-email-yamada.masahiro@socionext.com> References: <1518806331-7101-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This will be useful to specify the required compiler version, like this: config FOO bool "Use Foo" depends on GCC_VERSION >= 408000 help This feature requires GCC 4.8 or newer. Signed-off-by: Masahiro Yamada --- init/Kconfig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/init/Kconfig b/init/Kconfig index 837a584..f2da5e9 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -12,6 +12,15 @@ config cc-option string macro $(shell $CC -Werror $(1) -c -x c /dev/null -o /dev/null) +config CC_IS_GCC + bool + default $(shell $CC --version | grep -q gcc) + +config GCC_VERSION + int + default $(shell-stdout $srctree/scripts/gcc-version.sh -p $CC | sed 's/^0*//') if CC_IS_GCC + default 0 + config CONSTRUCTORS bool depends on !UML -- 2.7.4