From patchwork Sun Mar 11 20:12:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 10274907 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 25B0D6055C for ; Sun, 11 Mar 2018 20:13:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0139D28D4C for ; Sun, 11 Mar 2018 20:13:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA1A828D51; Sun, 11 Mar 2018 20:13:31 +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 D83CA28D4C for ; Sun, 11 Mar 2018 20:13:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932163AbeCKUM5 (ORCPT ); Sun, 11 Mar 2018 16:12:57 -0400 Received: from merlin.infradead.org ([205.233.59.134]:35512 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932144AbeCKUM5 (ORCPT ); Sun, 11 Mar 2018 16:12:57 -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=73dGU6PEOlofS0RPrHZERP4BMOp+0w+H1WqYqhsPpZk=; b=k5rq4yDZmNXFNa4hrWJnfr5t5X JiCNsr1EIQzFmZ6aNpf8g5ahvTnH+JXwkYz5ohQwc0HLHFlctLLzhjMqTzV+ZWELimHqhdUzjS1Fl 0LXo5edbUuzjdAwPfKCEpk4k2EmlSpiIztGHVHQnjfhBvG3BEBe2XsjBnjkqgk5t+mzsD2tyB3gyn DRJwgXeJQrY1VutymyK+G83CLqn+5rOwp2u8cujHaIrmeOPBjjAREQTOfS0rQlUmSlCRa/fbT6dt/ eMi7C5tTszbfAqk/Gn7fT3pIMcfJ5XWpCHAeKJ8qStheVHTY0y7JclEM61mtUOWzAFReIL4eSSXAm 9GW+7Tmw==; 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.89 #1 (Red Hat Linux)) id 1ev7Kx-0002pp-63; Sun, 11 Mar 2018 20:12:55 +0000 To: linux-kbuild , Masahiro Yamada Cc: LKML From: Randy Dunlap Subject: [PATCH] kbuild: check for pkg-config on make menu/n/g/xconfig Message-ID: <09cf5537-b2d7-5bf5-0c0b-d0b765e1e75b@infradead.org> Date: Sun, 11 Mar 2018 13:12:51 -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 --- I'm also OK with just documenting the pkg-config requirement in Documentation/Changes (= Documentation/process/changes.rst). + chmod +x scripts/kconfig/check-pkgconfig.sh scripts/kconfig/Makefile | 15 ++++++++++++++- scripts/kconfig/check-pkgconfig.sh | 13 +++++++++++++ 2 files changed, 27 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,13 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# Check for pkg-config presence + +pkgcfg=`which pkg-config >/dev/null 2>&1` +found=$? + +if [ $found -ne 0 ]; then + echo "'make *config' requires 'pkg-config'. Please install it." 1>&2 + exit 1 # error +fi + +exit 0