From patchwork Mon Jun 4 02:59:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 10445683 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4646A60234 for ; Mon, 4 Jun 2018 03:00:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36D0F287EF for ; Mon, 4 Jun 2018 03:00:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B0A428B27; Mon, 4 Jun 2018 03:00:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 950F9287EF for ; Mon, 4 Jun 2018 03:00:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751445AbeFDDAH (ORCPT ); Sun, 3 Jun 2018 23:00:07 -0400 Received: from merlin.infradead.org ([205.233.59.134]:58134 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751412AbeFDDAH (ORCPT ); Sun, 3 Jun 2018 23:00:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Subject:From:Cc:To:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=vLBTpSVBy0RwD6BhD+XmJVI3QcCGzpyESi1MIndvvkw=; b=rsIvvARX8CgHfJBXD+mvzSum19 Ae88p7YX996JN5B9NeiY6XW1WpFnCjqaLrGzk7g9OT6WQd2MwPVXBiHGACTT1T1ytGin3se/cSb2b KcQH0fhY72Va2YYO3JA5R2fzZTyRHthAU0bPmZOjgYZb2tyrzvF5gtNxDv7XEvjoyhQd7Jpk1fCKE 8Pztk54omE/cA1KKy96cmrNja/ImU+zAF7Ox+e4dB4cvXfX+GqkgaAHdsDzZpcyQNLlIKsso9h1IP N74RSmzVJddMxd3kcYK6vImpvZ1b7gnkvfYHTT52gtElMSORxnXHDzOk81hfVVErUrrUgdphAlPlv yjNqjadQ==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=dragon.dunlab) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fPfiw-000893-Fm; Mon, 04 Jun 2018 02:59:58 +0000 To: linux-kbuild , LKML Cc: =?UTF-8?Q?Bj=c3=b8rn_Forsman?= , Masahiro Yamada , Sam Ravnborg From: Randy Dunlap Subject: [PATCH v3] kbuild: check for pkg-config on make {menu,n,g.x}config Message-ID: Date: Sun, 3 Jun 2018 19:59:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Randy Dunlap Each of 'make {menu,n,g,x}config' uses (needs) pkg-config to make sure that other required files are present and to determine build flags settings, but none of these check that pkg-config itself is present. Add a check for all 4 of these targets and update Documentation/process/changes.rst to mention 'pkg-config'. Fixes kernel bugzilla #77511: https://bugzilla.kernel.org/show_bug.cgi?id=77511 Signed-off-by: Randy Dunlap Cc: Bjørn Forsman --- Strictly speaking, pkg-config is not required if someone is only using 'make {menu,n}config' since there are fallbacks for those two targets. Documentation/process/changes.rst | 8 ++++++++ scripts/kconfig/Makefile | 6 ++++++ scripts/kconfig/check-pkgconfig.sh | 12 ++++++++++++ 3 files changed, 26 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- linux-next-20180601.orig/scripts/kconfig/Makefile +++ linux-next-20180601/scripts/kconfig/Makefile @@ -214,11 +214,17 @@ $(obj)/gconf.o: $(obj)/.gconf-cfg $(obj)/zconf.tab.o: $(obj)/zconf.lex.c # check if necessary packages are available, and configure build flags +# pkg-config check +define check_pkg_config + $(CONFIG_SHELL) $(srctree)/scripts/kconfig/check-pkgconfig.sh FORCE +endef + define filechk_conf_cfg $(CONFIG_SHELL) $< endef $(obj)/.%conf-cfg: $(src)/%conf-cfg.sh FORCE + $(call check_pkg_config) $(call filechk,conf_cfg) clean-files += .*conf-cfg --- /dev/null +++ linux-next-20180601/scripts/kconfig/check-pkgconfig.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# Check for pkg-config presence + +pkgcfg=`command -v pkg-config` + +if [ "$pkgcfg" = "" ]; then + echo "'make *config' requires 'pkg-config'. Please install it." 1>&2 + exit 1 # error +fi + +exit 0 --- linux-next-20180601.orig/Documentation/process/changes.rst +++ linux-next-20180601/Documentation/process/changes.rst @@ -81,6 +81,14 @@ The build system has, as of 4.13, switch rather than incremental linking (`ld -r`) for built-in.a intermediate steps. This requires binutils 2.20 or newer. +pkg-config +---------- + +The build system, as of 4.18, requires pkg-config to check for installed +kconfig tools and to determine flags settings for use in +'make {menu,n,g,x}config'. Previously pkg-config was being used but not +verified or documented. + Flex ----