Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1293145imm; Sun, 2 Sep 2018 17:43:24 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZM4JzFiCCUVgCdF7NqxRy4Q93+ET/L08SsuUmWTjPOQRZ+mptmiqtqN+oYUdPi7BdbtG8s X-Received: by 2002:a17:902:aa49:: with SMTP id c9-v6mr1811468plr.195.1535935404572; Sun, 02 Sep 2018 17:43:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535935404; cv=none; d=google.com; s=arc-20160816; b=CJYzKMz+1Zvz/fF60DvTq0m7wByNrBstMRSJICDu+rcW5KYbGyI6Kx2ChFShrfxNEF BLiZRjxxUzKhkOMsnYMRPAcWl6Dol7iQMKb+Uajly4r2/wjVA2+8J4wUETLcqg5pocXI yzeIr9svs9BIdC8gShBHjCMqaX7WWJL7wW8FgBA+TAFzm8VSUAXaPC+78uFqzJeqwsPv fHBnKfrRxBfzt8FokB1wMOKFJTczwNiGBpVdI5+1AGL5vOVkQzia6zm6q1Mhj1vqZ2fz dV6yYMfhhlShdw+ecMB0gJwG2y2uQPFVz4Bld7tfi+pN3h/E1u5z/gw++TJX45qDTZMx 9gNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=UuEUtaGF2n8Is/biPI+g3R2SjlZ0EFQFeDUb8ZXx1Lw=; b=DHVTACjnCwi3A1Rt/YhgUyR6j9e0RjZejq7JkMxvH7KENF5O6WZhdh3pnTzlXZmvdl tnh39QpSnJOwA9zh2Cw4MrElYPpBVjTWPMgXl/07uIYjdkoxIB4LRTE/2Wb4yhsDTADv JgUsrITlrgTmPmNgq2WCjdOFE9thtL5/aF1kQ/9u8U5vV6K4JFk7sBWGhjFzgavyWxbt dZ+W8wX3nMDewbapJ1DBxYlhwzacH0QdmB4MQqpt6cb2sEUj3TwP/lzz/7lIg/47kpAv OljcJYVmsCgOzdceDXpv7enbaNnge96lOuo2doXunT3dCndcCuDQtz/Fr8RtLPthk+ZF UZLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=WKzrJQTc; 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 d1-v6si15791582pgj.353.2018.09.02.17.42.44; Sun, 02 Sep 2018 17:43:24 -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=WKzrJQTc; 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 S1725888AbeICE4M (ORCPT + 99 others); Mon, 3 Sep 2018 00:56:12 -0400 Received: from conssluserg-01.nifty.com ([210.131.2.80]:42989 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725762AbeICE4L (ORCPT ); Mon, 3 Sep 2018 00:56:11 -0400 Received: from mail-vk0-f52.google.com (mail-vk0-f52.google.com [209.85.213.52]) (authenticated) by conssluserg-01.nifty.com with ESMTP id w830cCLx013268; Mon, 3 Sep 2018 09:38:13 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com w830cCLx013268 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1535935093; bh=UuEUtaGF2n8Is/biPI+g3R2SjlZ0EFQFeDUb8ZXx1Lw=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=WKzrJQTcGPDBYWHi5OVeY2agH3vZ3VFxGJ4uh24i25OYnoS7mgiVY8j1UZhEWUXLe mZMbDbXaofartSatHra/ZYf6z9xW98QpV0X0fPvmdqtu9o7UeeQvF1bjxGkupSNKdg tUc95Yp1yS2jlRLevWhuGnad8pm6FNyVr6VX7YxoBi7F6dBQpkRm4OECQH6tcjcgTP K2iqg9+9Fb3E9IwfY8wBSYD7QmTrbkT0ZVcCnUzcTY1W+5gX0FEgy2MqMaEs/Jkq6f IUVlobQ7U6nSkpfxWB+FamoJvIZsot5Ri6UloZcMTQw8XYob84fTzialpy/xi0Fs2k UOMizgrfZKw4A== X-Nifty-SrcIP: [209.85.213.52] Received: by mail-vk0-f52.google.com with SMTP id 125-v6so7201779vke.11; Sun, 02 Sep 2018 17:38:13 -0700 (PDT) X-Gm-Message-State: APzg51A5jTqP6SqR8OsWxH3ld7sLLX8/QXqlZxwjstiE1OXu8HlB1gO9 rOsWl8OHsWuDpRXj0nByDDnGyvCkbHoFvYJv08k= X-Received: by 2002:a1f:3e47:: with SMTP id l68-v6mr14115810vka.42.1535935092014; Sun, 02 Sep 2018 17:38:12 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:7103:0:0:0:0:0 with HTTP; Sun, 2 Sep 2018 17:37:31 -0700 (PDT) In-Reply-To: <1535708095-15847-1-git-send-email-yamada.masahiro@socionext.com> References: <1535708095-15847-1-git-send-email-yamada.masahiro@socionext.com> From: Masahiro Yamada Date: Mon, 3 Sep 2018 09:37:31 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kconfig: do not require pkg-config on make {menu,n}config To: Linux Kbuild mailing list Cc: Meelis Roos , Randy Dunlap , Masahiro Yamada , Linux Kernel Mailing List , Jonathan Corbet , "open list:DOCUMENTATION" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-08-31 18:34 GMT+09:00 Masahiro Yamada : > Meelis Roos reported a {menu,n}config regression: > > "I have libncurses devel package installed in the default system > location (as do 99%+ on actual developers probably) and in this > case, pkg-config is useless. pkg-config is needed only when > libraries and headers are installed in non-default locations but > it is bad to require installation of pkg-config on all the machines > where make menuconfig would be possibly run." > > For {menu,n}config, do not use pkg-config if it is not installed. > For {g,x}config, keep checking pkg-config since we really rely on it > for finding the installation paths of the required packages. > > Fixes: 4ab3b80159d4 ("kconfig: check for pkg-config on make {menu,n,g,x}config") > Reported-by: Meelis Roos > Signed-off-by: Masahiro Yamada > --- Applied to linux-kbuild/fixes. > Documentation/process/changes.rst | 2 +- > scripts/kconfig/Makefile | 1 - > scripts/kconfig/check-pkgconfig.sh | 8 -------- > scripts/kconfig/gconf-cfg.sh | 7 +++++++ > scripts/kconfig/mconf-cfg.sh | 25 ++++++++++++++----------- > scripts/kconfig/nconf-cfg.sh | 25 ++++++++++++++----------- > scripts/kconfig/qconf-cfg.sh | 7 +++++++ > 7 files changed, 43 insertions(+), 32 deletions(-) > delete mode 100644 scripts/kconfig/check-pkgconfig.sh > > diff --git a/Documentation/process/changes.rst b/Documentation/process/changes.rst > index 61f918b..d1bf143 100644 > --- a/Documentation/process/changes.rst > +++ b/Documentation/process/changes.rst > @@ -86,7 +86,7 @@ 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 > +'make {g,x}config'. Previously pkg-config was being used but not > verified or documented. > > Flex > diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile > index 4a7bd21..67ed9f6 100644 > --- a/scripts/kconfig/Makefile > +++ b/scripts/kconfig/Makefile > @@ -221,7 +221,6 @@ $(obj)/zconf.tab.o: $(obj)/zconf.lex.c > > # check if necessary packages are available, and configure build flags > define filechk_conf_cfg > - $(CONFIG_SHELL) $(srctree)/scripts/kconfig/check-pkgconfig.sh; \ > $(CONFIG_SHELL) $< > endef > > diff --git a/scripts/kconfig/check-pkgconfig.sh b/scripts/kconfig/check-pkgconfig.sh > deleted file mode 100644 > index 7a1c40b..0000000 > --- a/scripts/kconfig/check-pkgconfig.sh > +++ /dev/null > @@ -1,8 +0,0 @@ > -#!/bin/sh > -# SPDX-License-Identifier: GPL-2.0 > -# Check for pkg-config presence > - > -if [ -z $(command -v pkg-config) ]; then > - echo "'make *config' requires 'pkg-config'. Please install it." 1>&2 > - exit 1 > -fi > diff --git a/scripts/kconfig/gconf-cfg.sh b/scripts/kconfig/gconf-cfg.sh > index 533b3d8..480ecd8 100755 > --- a/scripts/kconfig/gconf-cfg.sh > +++ b/scripts/kconfig/gconf-cfg.sh > @@ -3,6 +3,13 @@ > > PKG="gtk+-2.0 gmodule-2.0 libglade-2.0" > > +if [ -z "$(command -v pkg-config)" ]; then > + echo >&2 "*" > + echo >&2 "* 'make gconfig' requires 'pkg-config'. Please install it." > + echo >&2 "*" > + exit 1 > +fi > + > if ! pkg-config --exists $PKG; then > echo >&2 "*" > echo >&2 "* Unable to find the GTK+ installation. Please make sure that" > diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh > index e6f9fac..c812872d 100755 > --- a/scripts/kconfig/mconf-cfg.sh > +++ b/scripts/kconfig/mconf-cfg.sh > @@ -4,20 +4,23 @@ > PKG="ncursesw" > PKG2="ncurses" > > -if pkg-config --exists $PKG; then > - echo cflags=\"$(pkg-config --cflags $PKG)\" > - echo libs=\"$(pkg-config --libs $PKG)\" > - exit 0 > -fi > +if [ -n "$(command -v pkg-config)" ]; then > + if pkg-config --exists $PKG; then > + echo cflags=\"$(pkg-config --cflags $PKG)\" > + echo libs=\"$(pkg-config --libs $PKG)\" > + exit 0 > + fi > > -if pkg-config --exists $PKG2; then > - echo cflags=\"$(pkg-config --cflags $PKG2)\" > - echo libs=\"$(pkg-config --libs $PKG2)\" > - exit 0 > + if pkg-config --exists $PKG2; then > + echo cflags=\"$(pkg-config --cflags $PKG2)\" > + echo libs=\"$(pkg-config --libs $PKG2)\" > + exit 0 > + fi > fi > > -# Unfortunately, some distributions (e.g. openSUSE) cannot find ncurses > -# by pkg-config. > +# Check the default paths in case pkg-config is not installed. > +# (Even if it is installed, some distributions such as openSUSE cannot > +# find ncurses by pkg-config.) > if [ -f /usr/include/ncursesw/ncurses.h ]; then > echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncursesw\" > echo libs=\"-lncursesw\" > diff --git a/scripts/kconfig/nconf-cfg.sh b/scripts/kconfig/nconf-cfg.sh > index 42f5ac7..001559e 100644 > --- a/scripts/kconfig/nconf-cfg.sh > +++ b/scripts/kconfig/nconf-cfg.sh > @@ -4,20 +4,23 @@ > PKG="ncursesw menuw panelw" > PKG2="ncurses menu panel" > > -if pkg-config --exists $PKG; then > - echo cflags=\"$(pkg-config --cflags $PKG)\" > - echo libs=\"$(pkg-config --libs $PKG)\" > - exit 0 > -fi > +if [ -n "$(command -v pkg-config)" ]; then > + if pkg-config --exists $PKG; then > + echo cflags=\"$(pkg-config --cflags $PKG)\" > + echo libs=\"$(pkg-config --libs $PKG)\" > + exit 0 > + fi > > -if pkg-config --exists $PKG2; then > - echo cflags=\"$(pkg-config --cflags $PKG2)\" > - echo libs=\"$(pkg-config --libs $PKG2)\" > - exit 0 > + if pkg-config --exists $PKG2; then > + echo cflags=\"$(pkg-config --cflags $PKG2)\" > + echo libs=\"$(pkg-config --libs $PKG2)\" > + exit 0 > + fi > fi > > -# Unfortunately, some distributions (e.g. openSUSE) cannot find ncurses > -# by pkg-config. > +# Check the default paths in case pkg-config is not installed. > +# (Even if it is installed, some distributions such as openSUSE cannot > +# find ncurses by pkg-config.) > if [ -f /usr/include/ncursesw/ncurses.h ]; then > echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncursesw\" > echo libs=\"-lncursesw -lmenuw -lpanelw\" > diff --git a/scripts/kconfig/qconf-cfg.sh b/scripts/kconfig/qconf-cfg.sh > index 0862e15..02ccc0a 100755 > --- a/scripts/kconfig/qconf-cfg.sh > +++ b/scripts/kconfig/qconf-cfg.sh > @@ -4,6 +4,13 @@ > PKG="Qt5Core Qt5Gui Qt5Widgets" > PKG2="QtCore QtGui" > > +if [ -z "$(command -v pkg-config)" ]; then > + echo >&2 "*" > + echo >&2 "* 'make xconfig' requires 'pkg-config'. Please install it." > + echo >&2 "*" > + exit 1 > +fi > + > if pkg-config --exists $PKG; then > echo cflags=\"-std=c++11 -fPIC $(pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets)\" > echo libs=\"$(pkg-config --libs $PKG)\" > -- > 2.7.4 > -- Best Regards Masahiro Yamada