From patchwork Fri May 18 04:52:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 136234 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp769458lji; Thu, 17 May 2018 21:54:59 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrjuKaBGKLTzsgsVfggfRdyu+JhUuljvVttXpeZ3aCbM+VpEn85M1ko4TTwBecB5fBo9IGh X-Received: by 2002:a17:902:224:: with SMTP id 33-v6mr7818399plc.309.1526619299020; Thu, 17 May 2018 21:54:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526619299; cv=none; d=google.com; s=arc-20160816; b=EZ+/ZEyxr5pZrv+TOVd7l3lRwPYUBxZ+gz5h4plB3Ve/Qk6LeSfehrNA86IQc+B4wB nTaS2Dv7z0SQvAHIvNQUYg7SrSSef9wxGMBLi/U3d3es56ZALkDgVmbOm23AW/uc2/0F Iw5/Jm/IMpjmuFBheVAPnhG9nAdza/UeziMWRuOFKhPbhGJcP6yLunRjnbuSTEnebVja ZYcl+KwKllXHFlAq4QI1c3fBWHBJ+zPSxmQh9G/FeR+gKyJhTpeVSMewL0AH4dK9ClxZ PmHhRHyJC4xK1N70pKD300HkRoKZVNYq4bCDJlHveVTfCMc2MGT2y5b6tNooccvy841p XpdA== 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=uYeq6Oq3GKmMosJdwBTiXkDOeMk6/EvaPEoaDyClgqo=; b=W4qhzBiffFS94Ef2pBSghqrqdMLlsmjk960Fi3AgggmTpH2+HE/4/idvZClyjYn7vE PDqNjR33bmaMz5YWzgtBMgAvE45HP6xgXcKMGhccV1vAJJKU83GoNbW0RDJGAQC4Xfte +BL4eX7F/PTbo4aN/98Bz3nYUYBYVLE0xZixDI/OjcOk8uJzow+Ad+ffQcp2T36OG0wm NcjoQrmVt74rONl12YWSXCCPRLTgw3m/NQQqDgi+CyY8CSzXp0tPdGaOB7jzV5tM3Ymv WRm4OZ0shhJUx8O7mAL07FYh29rDw1oC0oTaqG+0L3Tm4bdiWEa9rmQfd42agHkyfwso RXhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=rHgp82iI; 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 k7-v6si6780972pls.368.2018.05.17.21.54.58; Thu, 17 May 2018 21:54:59 -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=rHgp82iI; 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 S1751458AbeERExw (ORCPT + 29 others); Fri, 18 May 2018 00:53:52 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:33676 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750959AbeERExu (ORCPT ); Fri, 18 May 2018 00:53:50 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id w4I4qbKI013482; Fri, 18 May 2018 13:52:41 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com w4I4qbKI013482 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526619161; bh=uYeq6Oq3GKmMosJdwBTiXkDOeMk6/EvaPEoaDyClgqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rHgp82iIFhAbG0fRiQ09lIOwPedAWf+2yzznc8YQwJqeYq1W8eAdV63x3HpDaNP0P KG2KVgMUj4k53+aHk5m1DlRNX6Li38vUIJNKYTZDY7MILL5KMRY6/6h61GZDGCd7S3 nUerplSIjyOVv9XAnn7bpLCB8Lfxby3lelSL7jzDz5oUSNO7rJEL5g8AemYrCxTvBE LP2K/5o1l6jAn1h6s8vovtOfvt6g2y5Ma+mYQm+crcBAjQVWMnz8HffJMpLuIxcdvh ZLvE/9ZHDZjZ+aA6LFXytXeif5EI/b8ZJTI4z6YPvVHNwGnN/Xy1bN8c1I/XCA1cW6 W/2bmsNTF51qg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Ulf Magnusson , Randy Dunlap , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 5/5] kconfig: refactor ncurses package checks for building nconf Date: Fri, 18 May 2018 13:52:26 +0900 Message-Id: <1526619146-1895-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526619146-1895-1-git-send-email-yamada.masahiro@socionext.com> References: <1526619146-1895-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 Building nconf requires ncurses, but its presence is not checked. Check and configure necessary packages as in the other GUI frontends. Signed-off-by: Masahiro Yamada --- scripts/kconfig/Makefile | 16 ++++++++-------- scripts/kconfig/nconf-cfg.sh | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 scripts/kconfig/nconf-cfg.sh -- 2.7.4 diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 25a3d25..b90e801 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -176,15 +176,12 @@ help: # =========================================================================== # Shared Makefile for the various kconfig executables: # conf: Used for defconfig, oldconfig and related targets -# nconf: Used for the nconfig target. -# Utilizes ncurses # object files used by all kconfig flavours conf-objs := conf.o zconf.tab.o -nconf-objs := nconf.o zconf.tab.o nconf.gui.o kxgettext-objs := kxgettext.o zconf.tab.o -hostprogs-y := conf nconf kxgettext +hostprogs-y := conf kxgettext targets += zconf.lex.c clean-files += gconf.glade.h @@ -199,10 +196,13 @@ HOST_EXTRACXXFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTC HOSTCFLAGS_zconf.lex.o := -I$(src) HOSTCFLAGS_zconf.tab.o := -I$(src) -HOSTLOADLIBES_nconf = $(shell \ - pkg-config --libs menuw panelw ncursesw 2>/dev/null \ - || pkg-config --libs menu panel ncurses 2>/dev/null \ - || echo "-lmenu -lpanel -lncurses" ) +# nconf: Used for the nconfig target based on ncurses +hostprogs-y += nconf +nconf-objs := nconf.o zconf.tab.o nconf.gui.o + +HOSTLOADLIBES_nconf = $(shell . $(obj)/.nconf-cfg && echo $$libs) + +$(obj)/nconf.o: $(obj)/.nconf-cfg # mconf: Used for the menuconfig target based on lxdialog hostprogs-y += mconf diff --git a/scripts/kconfig/nconf-cfg.sh b/scripts/kconfig/nconf-cfg.sh new file mode 100644 index 0000000..9def36f --- /dev/null +++ b/scripts/kconfig/nconf-cfg.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 + +PKG="menuw panelw ncursesw" +PKG2="menu panel ncurses" + +if pkg-config --exists $PKG; then + echo libs=\"$(pkg-config --libs $PKG)\" + exit 0 +fi + +if pkg-config --exists $PKG2; then + echo libs=\"$(pkg-config --libs $PKG2)\" + exit 0 +fi + +echo >&2 "*" +echo >&2 "* Unable to find the ncurses." +echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev" +echo >&2 "* depending on your distribution)" +echo >&2 "*" +exit 1