From patchwork Fri Apr 13 05:06:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 133338 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp348200ljb; Thu, 12 Apr 2018 22:14:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+EKf0hONPW9qMjMkX5MhMuyQJQG8ZmGEs+2wJ/aLCV0ayfv6jTx61tmmSNLwtmXL68JoNk X-Received: by 2002:a17:902:e5:: with SMTP id a92-v6mr3860439pla.26.1523596473467; Thu, 12 Apr 2018 22:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523596473; cv=none; d=google.com; s=arc-20160816; b=jBW/eVMjhaW1pMgu1yC26rYNDhFfdTYZec+cPxGbyaKiTWtoHG6k+lEI1gh9afAH5q pwPiGtpfUUE7OPr6bElec0rRt3y4n2i4et3h0qS0+EAJwwlnBYH3KAvBWZ26xrQ/6jzl oA7WqQJTCtmslcvSqgirCjpmzUWBBIcRKvpvBWCGmEuNyOu7DLtiBxF0UVAPTuDe5QLg IAXofCSU+jZ0ohJ8kHr8dkhiKtVry8k3nRSM90wee5D8aYGk8lF9ozuGaw28nmnbSC/J C9K5PVhcvgu8c07eGC/UKU6+19oyznCK35+LodrbpfO+/Lcie+2U9UYGBmraQGGbnid6 ZwRQ== 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=lwfyJVwMZs6q+YvqxKJT8CiT1MHim80CvXV5gKwCRMg=; b=nIKZkODsqge/dvrX1k2Z1A2+qCs/MkgW++xA3QlvixJcbOF4y4BQq1vubPXJSNoFTN 9AFpHiKfRmJ40Kp+T7uuoPr57xifIgvfmxkVYx+IeRy3/1w7hzxV99o6EvNewVDLLL47 GZI6ti7C9IFnDAULPPsYwZ24VvQs+oe2Dw00m+ZalWpN6pUf8fIdNmKTaH/7ce3w49oL oGgJjwqTjhRkcjJKzfTBRJPT6CLWquH8utOMFb/o15b5AZBsmg7tAl5uM0Phnd3as26l PO/Ar3NkcPbe1HiBuehgdN4/T3I2f0tED5kwR+sRXZfMrqSDQeDqLJVo8OJF9d4yIY3w rMpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=He2cCuzv; 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 30-v6si4922707plb.316.2018.04.12.22.14.33; Thu, 12 Apr 2018 22:14:33 -0700 (PDT) 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=He2cCuzv; 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 S1753672AbeDMFOD (ORCPT + 29 others); Fri, 13 Apr 2018 01:14:03 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:54460 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751035AbeDMFIP (ORCPT ); Fri, 13 Apr 2018 01:08:15 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id w3D56lgE029209; Fri, 13 Apr 2018 14:07:05 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w3D56lgE029209 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1523596026; bh=lwfyJVwMZs6q+YvqxKJT8CiT1MHim80CvXV5gKwCRMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=He2cCuzvMsuywPlYi7vUttS/+7BCi2yfRDrpiClRnPzay6O4cBPR0Gpiftk5MoFfK 8O1jyvbchEQ0uivxQOjZYzF42Zq0V7zUV7emkSZG0pUgSkjSDE64ski55pzU48lcSj OSDb9ZfpFl6A/3hr3Or3ntSpthn4EqIzZ+letJ65ZdIkKfu9IwMBug5g/HLQaIBVjn NwIy+sP8zgcJsUCg0xC6PDqarmi1ojXcNpSuLSft4OZspepxJ9lr6vGOK7UePQq5GD Ve0n0zCelgFbjYYyDekAZr2nex278ZCZsbNKppIj1Q9olcqplM62bOsHP4aQsEA2LY 9Yl0z/GYDL+1Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Linus Torvalds , Sam Ravnborg , Ulf Magnusson , Nicholas Piggin , Kees Cook , Emese Revfy , x86@kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 20/30] kconfig: add basic helper macros to scripts/Kconfig.include Date: Fri, 13 Apr 2018 14:06:29 +0900 Message-Id: <1523595999-27433-21-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523595999-27433-1-git-send-email-yamada.masahiro@socionext.com> References: <1523595999-27433-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 Kconfig got text processing tools like we see in Make. Add Kconfig helper macros to scripts/Kconfig.include like we collect Makefile macros in scripts/Kbuild.include. Signed-off-by: Masahiro Yamada Reviewed-by: Kees Cook Reviewed-by: Ulf Magnusson --- Changes in v3: - Move helpers to scripts/Kconfig.include Changes in v2: None Kconfig | 2 ++ MAINTAINERS | 1 + scripts/Kconfig.include | 17 +++++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 scripts/Kconfig.include -- 2.7.4 diff --git a/Kconfig b/Kconfig index 5b55d87..a90d9f9 100644 --- a/Kconfig +++ b/Kconfig @@ -7,4 +7,6 @@ mainmenu "Linux/$(ARCH) $(KERNELVERSION) Kernel Configuration" comment "Compiler: $(CC_VERSION_TEXT)" +source "scripts/Kconfig.include" + source "arch/$(SRCARCH)/Kconfig" diff --git a/MAINTAINERS b/MAINTAINERS index b9dab38..d962f4a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7624,6 +7624,7 @@ L: linux-kbuild@vger.kernel.org S: Maintained F: Documentation/kbuild/kconfig* F: scripts/kconfig/ +F: scripts/Kconfig.include KDUMP M: Dave Young diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include new file mode 100644 index 0000000..cac7a81 --- /dev/null +++ b/scripts/Kconfig.include @@ -0,0 +1,17 @@ +# Kconfig helper macros + +# Convenient variables +comma := , +quote := " +squote := ' +empty := +space := $(empty) $(empty) + +# y if the command exits with 0, n otherwise +success = $(shell ($(1)) >/dev/null 2>&1 && echo y || echo n) + +# y if the given compiler flag is supported, n otherwise +cc-option = $(success $(CC) -Werror $(1) -c -x c /dev/null -o /dev/null) + +# y if the given linker flag is supported, n otherwise +ld-option = $(success $(LD) -v $(1))