From patchwork Fri Feb 16 18:38:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 128628 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp870844ljc; Fri, 16 Feb 2018 10:49:43 -0800 (PST) X-Google-Smtp-Source: AH8x226snhxQ+HEMD2/0Lcso0oTRdaGCdUl120zDD1RNxJkAS0/LiZHNS/v0v1MqTAQPxnG8c/3g X-Received: by 10.98.223.93 with SMTP id u90mr1963121pfg.13.1518806983746; Fri, 16 Feb 2018 10:49:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518806983; cv=none; d=google.com; s=arc-20160816; b=P3Nz0rLVnmk7MKxVtdY+N9jYRWt1jDr1W45cwBrd4Efm3LQTBCKzoaIXCOSKWlZEV6 K4r/gRfrPC4GuS+KsFwvQiRP2EqkJ1mkptw0yDUeYBGZkO2TVbOog/AVn9QTlsoxDddj oBaOZMPll+13fj8UUooTB8W3TFL4CeQl782ZiJuPCCUw7i0SeuDDLAHui13WzpTLw197 QwBAm+RKda68ijyn+gG+OKzys/ZkDm7viDWWe83ZKjHNZTCy2uslPt0H2kEIelQrpDfd /XIUaQ8orh+c1PwoVU7+4eOY7ZlP9o9uEbxrhKCWJ6/P1/7kBpdbu+ETwKD7gf6x7lzs eOJQ== 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 f5si12574pgr.235.2018.02.16.10.49.43; Fri, 16 Feb 2018 10:49:43 -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 S1751862AbeBPSr6 (ORCPT + 28 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(+) -- 2.7.4 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