From patchwork Tue Mar 13 02:30:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 10277723 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 2301E601A0 for ; Tue, 13 Mar 2018 02:30:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06D9A28FC8 for ; Tue, 13 Mar 2018 02:30:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDD6D28FD1; Tue, 13 Mar 2018 02:30:53 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 5109328FC8 for ; Tue, 13 Mar 2018 02:30:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932242AbeCMCax (ORCPT ); Mon, 12 Mar 2018 22:30:53 -0400 Received: from merlin.infradead.org ([205.233.59.134]:49462 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932211AbeCMCaw (ORCPT ); Mon, 12 Mar 2018 22:30:52 -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=daPAqIV8XZn592D1Y4I6HLyou2bi8nPCN4oPn1QoHOw=; b=fAvA0FQoWoVS1C3GfhnX7HvV5X ArJ0jVU/7TsUBRNOD+6o7Q7pYFGepGxkT6WOCJjbQc0FCaYFSJKrvsPcCD5jEbf4z9fjYv84Q5Awv nalcud4WcS2/FWysFvBvy7jVA2r8OyiQfima4PsNnQ6nz8A7Sih1Zp5PvgcbEGgRJIuGm4y3gLgwM I5kKCvFjshNPjJuXXfpjIM4FuLLTSEDhwy08Gsa3cPNpApM5CgcnYFTHNBy1EmzpjJsaDP9Hvc8s9 G41hwh1es+jqks7iUf94NYSs+Cr0/hzxOX/G6lWVtcLa+MjKWOWZuuJIcFDwnqfvwbfyMBCGLG03h 9c9QdqJw==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1evZiE-0000ee-Q8; Tue, 13 Mar 2018 02:30:50 +0000 To: linux-kbuild , Masahiro Yamada Cc: LKML , =?UTF-8?Q?Bj=c3=b8rn_Forsman?= From: Randy Dunlap Subject: [PATCH v2] kbuild: check for pkg-config on make {menu,n,g,x}config Message-ID: <9e9438b0-568a-8dc0-dad6-d29b6e39e53a@infradead.org> Date: Mon, 12 Mar 2018 19:30:47 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.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, but none of these check that pkg-config itself is present. Add a check for all 4 of these targets. Fixes kernel bugzilla #77511: https://bugzilla.kernel.org/show_bug.cgi?id=77511 Signed-off-by: Randy Dunlap --- v2: use 'command -v' instead of 'which' I'm also OK with just documenting the pkg-config requirement in Documentation/Changes (= Documentation/process/changes.rst). scripts/kconfig/Makefile | 15 ++++++++++++++- scripts/kconfig/check-pkgconfig.sh | 12 ++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) -- 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 --- lnx-416-rc3.orig/scripts/kconfig/Makefile +++ lnx-416-rc3/scripts/kconfig/Makefile @@ -160,6 +160,9 @@ help: @echo ' xenconfig - Enable additional options for xen dom0 and guest kernel support' @echo ' tinyconfig - Configure the tiniest possible kernel' +# pkg-config check +check-pkgconfig := $(srctree)/$(src)/check-pkgconfig.sh + # lxdialog stuff check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh @@ -205,7 +208,17 @@ $(addprefix $(obj)/, mconf.o $(lxdialog) $(obj)/dochecklxdialog: $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf) -always := dochecklxdialog +# Check that we have pkg-config (used by each of menu/n/g/xconfig) +PHONY += $(obj)/docheckpkgconfig +$(addprefix $(obj)/, mconf.o): $(obj)/docheckpkgconfig +$(addprefix $(obj)/, nconf.o): $(obj)/docheckpkgconfig +$(addprefix $(obj)/, gconf.o): $(obj)/docheckpkgconfig +$(addprefix $(obj)/, qconf.o): $(obj)/docheckpkgconfig + +$(obj)/docheckpkgconfig: + $(Q)$(CONFIG_SHELL) $(check-pkgconfig) + +always := docheckpkgconfig dochecklxdialog # Add environment specific flags HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS)) --- /dev/null +++ lnx-416-rc3/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