From patchwork Sun May 20 08:16:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 136416 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3213567lji; Sun, 20 May 2018 01:19:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrsOKDzXHsQNRxjczPQLHA0z4HS1/rhOSkm45z4Bik/+VqFm2cxZDlCU2FHmgjC1UXap8cA X-Received: by 2002:a17:902:781:: with SMTP id 1-v6mr16162487plj.150.1526804348958; Sun, 20 May 2018 01:19:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526804348; cv=none; d=google.com; s=arc-20160816; b=vBBKUhFqeZiaAXuVH1tH6m8510h1ktDoiyfnfsvn+BsOZ4hcvOns92BC8Cbtcr8dgG kt1pHt+IhzFGDEdMROY81J6f52pY7MujDYAbNk7casLh1dqrSLRK5fnCMcvQBIIAcNuV zYBfASRgemM9pG4UvDEBHKxJPBcie38gc1XJN3L++YRtJxEyVBvzuYSadKRo/Aj+hvH2 l9hRavO6PHhVrcxLBv5CSIEmCRzfv62ITrPDjqmtCJoKWiZMLwb1ePB80tmtzW4ZorMw GX2jAax6zFSX5Oue3hLDVvXl/ACjYZNweQJz3a1Jj4lTBk62tma1iIlH6eSpGlyv4rMK JS3A== 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=cFuulU0EvgcKmE6y67UHQ6vtpm2XlccdG+UJtLul/qU=; b=WlDZVHpl+wH3TUtWfHIDjbkBGGC9ob+QDkxg+g7QJZR66241dS1LsKMHF6IbimN3ZK StmS+iZjsM+IyDqlNz05jte+DYrcJDxxi/Fdcer8b+QE6ti8lXJ8feaEqrwq7uasW3nT AbfqC616zXC549paMSb04m7x7Z8e5+1qjewoXXLhyV6pZIeBklFRxjWwYJnBXkxfJih5 Oh4pCl0uiq3jzNDtcQSxK9EW2KWrXS5y1nwmpt7gndU6yKZ8qu7F/xuSsbe5b14HCbNy M9j0Hw8tWhEXHkMB/kgEcBz2hU+LucNn34gRyxSUOv6VRlGGx3A6e1y4RNQA0HXHvDkm CNrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=zGzEoc+s; 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 j10-v6si11557279pfn.87.2018.05.20.01.19.08; Sun, 20 May 2018 01:19:08 -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=zGzEoc+s; 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 S1752564AbeETITG (ORCPT + 29 others); Sun, 20 May 2018 04:19:06 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:22125 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751410AbeETISp (ORCPT ); Sun, 20 May 2018 04:18:45 -0400 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-07.nifty.com with ESMTP id w4K8H4h1004008; Sun, 20 May 2018 17:17:06 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w4K8H4h1004008 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526804226; bh=cFuulU0EvgcKmE6y67UHQ6vtpm2XlccdG+UJtLul/qU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zGzEoc+szs9ahnfn8gwGtMQKW7pFlFiVWPsXGu8EMffBO2k1VCg9GInxm17PFgb58 PFsICQJnZ5IQAwHLRE307fHAI6pUJi5rgDObgrAgH+GRp9Ri8WQel44EMmIaSXWqoJ +wnWP55+WGD+HnjMAwE8nKL8DHxbw7xjrMH6ixkMvraWJExmNo5m3t/1raObi8Pjeh 9LcSidAsf9haZr96RObqv9SteHwQQdOgyV19CopdKOM4Wgaiq8fpfpLFdA9GXVNwkv oDCDB+JoeXIDOXkQ2UTo6EYoywWa4RvlnoXzJ7fvyZXtgCLZooXS95uKXuZHPLFtby 9wFWfonA7V+Ng== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: "Luis R . Rodriguez" , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] kbuild: do not display CHK for filechk Date: Sun, 20 May 2018 17:16:49 +0900 Message-Id: <1526804213-8238-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526804213-8238-1-git-send-email-yamada.masahiro@socionext.com> References: <1526804213-8238-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 filechk displays two short logs; CHK for creating a temporary file, and UPD for really updating the target. IMHO, the build system can be quiet when the target file has not been updated. Signed-off-by: Masahiro Yamada --- Changes in v2: None scripts/Kbuild.include | 1 - 1 file changed, 1 deletion(-) -- 2.7.4 diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 50cee53..c7fedc5 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -57,7 +57,6 @@ kecho := $($(quiet)kecho) # to specify a valid file as first prerequisite (often the kbuild file) define filechk $(Q)set -e; \ - $(kecho) ' CHK $@'; \ mkdir -p $(dir $@); \ $(filechk_$(1)) < $< > $@.tmp; \ if [ -r $@ ] && cmp -s $@ $@.tmp; then \ From patchwork Sun May 20 08:16:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 136417 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3213622lji; Sun, 20 May 2018 01:19:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrcETcohvwZTwINHJkro844qV2k6Jq99mQcU5YUQsCYKTZ4ALoFvU8NI9Eafia4sUnSA5Z+ X-Received: by 2002:a62:12d4:: with SMTP id 81-v6mr15789688pfs.243.1526804354032; Sun, 20 May 2018 01:19:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526804354; cv=none; d=google.com; s=arc-20160816; b=spoMCxon5bcmeYRGS/GwhwdiZEyPjK8H+AK4Zk1/m/rS4XgvgUYGu1T2fqyimnT51c y5FQ/wnsAQqzrW0Azxfa+DXroN2BqBVbZoxo6qRDaqi+YfG54v5wjp1lDNxDI+gh0wNi AFvDmOkjGMKnsVWZtdfZs1oY/4p4fkmhRCE6hY7zBgF9LArAqRRD8QiPZifsD/KggnNi S5ol1DkL3v5AFIF9OAXU0P19HSpfOiqNPNl/Rz72DYP3qldNqouEj7bzqcl6wuCRA1zR uAmsK8SOXh7T2AQBKxzbqqTTYzCx8CiWFsV8ygxIcnQbc3zDdJynYI9Lzcmry2G1A5so Vi8A== 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=gW3sIH1xa3weBIcrcZ6+uFcEALNZMgNpMXy03jEkPYc=; b=ocufFJrx3lPMV5O1yhIvTPlqwB/MNZe7os3gFfyYG2MX6AeUzcygb8yY7CeLIf7RrS GbjMg3P08uONdmZMzT6uzEjZj02z1Hl9jcSFhf8YbD5PLnC6AQHWLGcKx/sL4bMXcx4z Q8+w218Aer9p29qrZFkhB6P2oUBRIup1KSfvVAI3mJsWgSvYG9yU3n/HInswnAvVk3GM 0UE/+wGvGx7B45hV6cAVRaCw6riHc2xaFGUuDF6bpUE7oAWx6UPlz1tO2MTS1PDH3yEi dtmD/Ki/YTkqTyXyv0UIg0aLIK8ZHLUX4ZIuJj4GeWeyYK4zZ3nCPlOi65t9assXm3d3 wwUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Bd/rXcwW; 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 a5-v6si1029818plp.178.2018.05.20.01.19.13; Sun, 20 May 2018 01:19:14 -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=Bd/rXcwW; 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 S1752585AbeETITL (ORCPT + 29 others); Sun, 20 May 2018 04:19:11 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:22123 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750966AbeETISp (ORCPT ); Sun, 20 May 2018 04:18:45 -0400 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-07.nifty.com with ESMTP id w4K8H4h2004008; Sun, 20 May 2018 17:17:06 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w4K8H4h2004008 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526804227; bh=gW3sIH1xa3weBIcrcZ6+uFcEALNZMgNpMXy03jEkPYc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bd/rXcwWaCRZXMMoXYz+VZQl/F8D5o9AtBOzf8Lqxel+BHvtUIERnmdgahGAh0Veq UemKWn/ivuzHF5nJF7MJnNlXLegwtMxv9lYcMR0apiQCND4MU9EyqIblCEDG/oVup2 g3N2E7HYc5HpKJW09bGGSSzd0urzu+0Hl66VTNQHpncyg1/67pLVjz844N3tsSCBKx iWniHeyK7MSFEiKeloQ6LT5JZ+SV+LTQsP+hiaEEyHOmsY7gEvjs4ZElw8XNeGiKJ8 jzcGfKtWdMcYm+FsrgLl4SHEYWd2voxbP6Jp6oqeajUMrn6pMAAU4TY6D6xiw/3EoV IbJpwDzy7+jog== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: "Luis R . Rodriguez" , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] kconfig: refactor Qt package checks for building qconf Date: Sun, 20 May 2018 17:16:50 +0900 Message-Id: <1526804213-8238-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526804213-8238-1-git-send-email-yamada.masahiro@socionext.com> References: <1526804213-8238-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 Currently, the necessary package checks for building qconf is surrounded by ifeq ($(MAKECMDGOALS),xconfig) ... endif. Then, Make will restart when .tmp_qtcheck is generated. To simplify the Makefile, move the scripting to a separate file, and use filechk. The shell script is executed everytime xconfig is run, but it is not a costly script. Signed-off-by: Masahiro Yamada Tested-by: Randy Dunlap Acked-by: Randy Dunlap --- Changes in v2: None scripts/kconfig/Makefile | 73 +++++++++++++++++--------------------------- scripts/kconfig/qconf-cfg.sh | 25 +++++++++++++++ 2 files changed, 53 insertions(+), 45 deletions(-) create mode 100755 scripts/kconfig/qconf-cfg.sh -- 2.7.4 diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 5def877..e9a87bf 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -188,8 +188,6 @@ HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \ # Utilizes ncurses # mconf: Used for the menuconfig target # Utilizes the lxdialog package -# qconf: Used for the xconfig target -# Based on Qt which needs to be installed to compile it # gconf: Used for the gconfig target # Based on GTK+ which needs to be installed to compile it # object files used by all kconfig flavours @@ -201,14 +199,12 @@ conf-objs := conf.o zconf.tab.o mconf-objs := mconf.o zconf.tab.o $(lxdialog) nconf-objs := nconf.o zconf.tab.o nconf.gui.o kxgettext-objs := kxgettext.o zconf.tab.o -qconf-cxxobjs := qconf.o -qconf-objs := zconf.tab.o gconf-objs := gconf.o zconf.tab.o -hostprogs-y := conf nconf mconf kxgettext qconf gconf +hostprogs-y := conf nconf mconf kxgettext gconf targets += zconf.lex.c -clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck +clean-files := .tmp_gtkcheck clean-files += gconf.glade.h clean-files += config.pot linux.pot @@ -228,9 +224,6 @@ HOST_EXTRACXXFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTC HOSTCFLAGS_zconf.lex.o := -I$(src) HOSTCFLAGS_zconf.tab.o := -I$(src) -HOSTLOADLIBES_qconf = $(KC_QT_LIBS) -HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) - HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \ -Wno-missing-prototypes @@ -241,34 +234,22 @@ 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" ) -$(obj)/qconf.o: $(obj)/.tmp_qtcheck - -ifeq ($(MAKECMDGOALS),xconfig) -$(obj)/.tmp_qtcheck: $(src)/Makefile --include $(obj)/.tmp_qtcheck - -# Qt needs some extra effort... -$(obj)/.tmp_qtcheck: - @set -e; $(kecho) " CHECK qt"; \ - if pkg-config --exists Qt5Core; then \ - cflags="-std=c++11 -fPIC `pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets`"; \ - libs=`pkg-config --libs Qt5Core Qt5Gui Qt5Widgets`; \ - moc=`pkg-config --variable=host_bins Qt5Core`/moc; \ - elif pkg-config --exists QtCore; then \ - cflags=`pkg-config --cflags QtCore QtGui`; \ - libs=`pkg-config --libs QtCore QtGui`; \ - moc=`pkg-config --variable=moc_location QtCore`; \ - else \ - echo >&2 "*"; \ - echo >&2 "* Could not find Qt via pkg-config."; \ - echo >&2 "* Please install either Qt 4.8 or 5.x. and make sure it's in PKG_CONFIG_PATH"; \ - echo >&2 "*"; \ - exit 1; \ - fi; \ - echo "KC_QT_CFLAGS=$$cflags" > $@; \ - echo "KC_QT_LIBS=$$libs" >> $@; \ - echo "KC_QT_MOC=$$moc" >> $@ -endif + +# qconf: Used for the xconfig target based on Qt +hostprogs-y += qconf +qconf-cxxobjs := qconf.o +qconf-objs := zconf.tab.o + +HOSTLOADLIBES_qconf = $(shell . $(obj)/.qconf-cfg && echo $$libs) +HOSTCXXFLAGS_qconf.o = $(shell . $(obj)/.qconf-cfg && echo $$cflags) + +$(obj)/qconf.o: $(obj)/.qconf-cfg $(obj)/qconf.moc + +quiet_cmd_moc = MOC $@ + cmd_moc = $(shell . $(obj)/.qconf-cfg && echo $$moc) -i $< -o $@ + +$(obj)/%.moc: $(src)/%.h $(obj)/.qconf-cfg + $(call cmd,moc) $(obj)/gconf.o: $(obj)/.tmp_gtkcheck @@ -298,15 +279,17 @@ endif $(obj)/zconf.tab.o: $(obj)/zconf.lex.c -$(obj)/qconf.o: $(obj)/qconf.moc - -quiet_cmd_moc = MOC $@ - cmd_moc = $(KC_QT_MOC) -i $< -o $@ - -$(obj)/%.moc: $(src)/%.h $(obj)/.tmp_qtcheck - $(call cmd,moc) - # Extract gconf menu items for i18n support $(obj)/gconf.glade.h: $(obj)/gconf.glade $(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \ $(obj)/gconf.glade + +# check if necessary packages are available, and configure build flags +define filechk_conf_cfg + $(CONFIG_SHELL) $< +endef + +$(obj)/.%conf-cfg: $(src)/%conf-cfg.sh FORCE + $(call filechk,conf_cfg) + +clean-files += .*conf-cfg diff --git a/scripts/kconfig/qconf-cfg.sh b/scripts/kconfig/qconf-cfg.sh new file mode 100755 index 0000000..0862e15 --- /dev/null +++ b/scripts/kconfig/qconf-cfg.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 + +PKG="Qt5Core Qt5Gui Qt5Widgets" +PKG2="QtCore QtGui" + +if pkg-config --exists $PKG; then + echo cflags=\"-std=c++11 -fPIC $(pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets)\" + echo libs=\"$(pkg-config --libs $PKG)\" + echo moc=\"$(pkg-config --variable=host_bins Qt5Core)/moc\" + exit 0 +fi + +if pkg-config --exists $PKG2; then + echo cflags=\"$(pkg-config --cflags $PKG2)\" + echo libs=\"$(pkg-config --libs $PKG2)\" + echo moc=\"$(pkg-config --variable=moc_location QtCore)\" + exit 0 +fi + +echo >&2 "*" +echo >&2 "* Could not find Qt via pkg-config." +echo >&2 "* Please install either Qt 4.8 or 5.x. and make sure it's in PKG_CONFIG_PATH" +echo >&2 "*" +exit 1 From patchwork Sun May 20 08:16:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 136414 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3213334lji; Sun, 20 May 2018 01:18:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrsHSWHYm4rNjFofULVD/A3NAs0Payuf4uiJXrfyIRlwfldi6hk6CgfPr8u6M3ssYCkUEUP X-Received: by 2002:a65:5308:: with SMTP id m8-v6mr12668220pgq.42.1526804332149; Sun, 20 May 2018 01:18:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526804332; cv=none; d=google.com; s=arc-20160816; b=0D2YA559/31XwnRmRFV1cHNyXWTl/nAGOM+QSq+0mh1JZPmGGzsNTc6pDcO8UuctLC H1pOv0vbuc09OIY9mZ2m/wA8HyqiU8oPTRWeZGTQw4K2UtYksrJCNlL6YS9hMbuKkZ3h dbo777JmAk25DxK4zAmMEQn8akya5OwKsmyro9F1vhbvMlx9KMJmjicrcOjXs6qJQLCF YUCcdp1EkvBvGWgOEq0BnEh1dZZ/Gf4qZOHhnEV9feRvd+fpXxPw2bn30Ykh4zlkYn9l UgsGZOWDTf44iQbiiZkiYqEew/LR16bfmiJnMM8F3Zh50qZkf9kcYDwfhB8oZtJtBOAo 7fkA== 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=Gjjb/GZTnJz5pb/inBPLOzczX07aTFYn2M73JQNERJA=; b=WylSx6aKPexDbP+c/6ApF5Ti2pIqeB4rKrfzdJ0jEtcFvd7Dyeb0LHrcIHR4gSx0+9 i2j53ZG1yhIkU9Sv14Pa84AhVVoW6Ta4BoA9TZ/jBu3ADnHLE2w3EIiZgUByQV5AcRaT KrfyBIUSBBqUWxBoKzIsvJaMIQzRyeEZd7OUdFgo21A/xt8+0c8YVcB8qSXb6BMipA5k KLteHVvM14UqBti0yxrSEfMvZlzod2xIAMvMciDvdYueFEq3DJ7G3qYnbt6i0gqJy9VL eiuDvh/jNmSiIrasm91uQa2K2ryzH3uNc4D0MMw2DU0pSNNoIF0wWu3oYtMfp2F9coDg u89w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=cnu8rgZY; 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 e2-v6si9165184pga.647.2018.05.20.01.18.51; Sun, 20 May 2018 01:18:52 -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=cnu8rgZY; 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 S1751727AbeETISt (ORCPT + 29 others); Sun, 20 May 2018 04:18:49 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:22129 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750932AbeETISp (ORCPT ); Sun, 20 May 2018 04:18:45 -0400 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-07.nifty.com with ESMTP id w4K8H4h3004008; Sun, 20 May 2018 17:17:07 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w4K8H4h3004008 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526804227; bh=Gjjb/GZTnJz5pb/inBPLOzczX07aTFYn2M73JQNERJA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cnu8rgZYTuWW3504g7hHGl89hW3I3j4HBgokKmtp0eNi89q8yuHPx/RS/L38IL5dI rcxclJt9a4u4p92ghZvtblBaBu2qEZXqjwou6Ap+CM2O5DBOZcWzujTYfoBiF09X1x vlPluXBPIBvfGwvGPjtOp+KQ/Tn503xVQRtty4agalqtURf1uDrxW9nlYLV/i+Ltpw 3OtxZzqb9aOuRt02yqR8vzgYeisQGKfu2WCCegLu5Ro41NceD5ZYbOy2JXyGLBelDH kvuN2BjIypxRCC7uC3koPETSW6Wa17P0gXBJ9TPpYiIA9v1d/95dd1b+iQYTOLgsl9 M16jPQ66yD0tA== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: "Luis R . Rodriguez" , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v2 3/5] kconfig: refactor GTK+ package checks for building gconf Date: Sun, 20 May 2018 17:16:51 +0900 Message-Id: <1526804213-8238-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526804213-8238-1-git-send-email-yamada.masahiro@socionext.com> References: <1526804213-8238-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 Refactor the package checks for gconf in the same way as for qconf. Signed-off-by: Masahiro Yamada Tested-by: Randy Dunlap Acked-by: Randy Dunlap --- Changes in v2: None scripts/kconfig/Makefile | 43 +++++++++---------------------------------- scripts/kconfig/gconf-cfg.sh | 23 +++++++++++++++++++++++ 2 files changed, 32 insertions(+), 34 deletions(-) create mode 100755 scripts/kconfig/gconf-cfg.sh -- 2.7.4 diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index e9a87bf..c222745 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -188,8 +188,6 @@ HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \ # Utilizes ncurses # mconf: Used for the menuconfig target # Utilizes the lxdialog package -# gconf: Used for the gconfig target -# Based on GTK+ which needs to be installed to compile it # object files used by all kconfig flavours lxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o @@ -199,12 +197,10 @@ conf-objs := conf.o zconf.tab.o mconf-objs := mconf.o zconf.tab.o $(lxdialog) nconf-objs := nconf.o zconf.tab.o nconf.gui.o kxgettext-objs := kxgettext.o zconf.tab.o -gconf-objs := gconf.o zconf.tab.o -hostprogs-y := conf nconf mconf kxgettext gconf +hostprogs-y := conf nconf mconf kxgettext targets += zconf.lex.c -clean-files := .tmp_gtkcheck clean-files += gconf.glade.h clean-files += config.pot linux.pot @@ -224,10 +220,6 @@ HOST_EXTRACXXFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTC HOSTCFLAGS_zconf.lex.o := -I$(src) HOSTCFLAGS_zconf.tab.o := -I$(src) -HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` -HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \ - -Wno-missing-prototypes - HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) HOSTLOADLIBES_nconf = $(shell \ @@ -251,31 +243,14 @@ quiet_cmd_moc = MOC $@ $(obj)/%.moc: $(src)/%.h $(obj)/.qconf-cfg $(call cmd,moc) -$(obj)/gconf.o: $(obj)/.tmp_gtkcheck - -ifeq ($(MAKECMDGOALS),gconfig) --include $(obj)/.tmp_gtkcheck - -# GTK+ needs some extra effort, too... -$(obj)/.tmp_gtkcheck: - @if `pkg-config --exists gtk+-2.0 gmodule-2.0 libglade-2.0`; then \ - if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then \ - touch $@; \ - else \ - echo >&2 "*"; \ - echo >&2 "* GTK+ is present but version >= 2.0.0 is required."; \ - echo >&2 "*"; \ - false; \ - fi \ - else \ - echo >&2 "*"; \ - echo >&2 "* Unable to find the GTK+ installation. Please make sure that"; \ - echo >&2 "* the GTK+ 2.0 development package is correctly installed..."; \ - echo >&2 "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \ - echo >&2 "*"; \ - false; \ - fi -endif +# gconf: Used for the gconfig target based on GTK+ +hostprogs-y += gconf +gconf-objs := gconf.o zconf.tab.o + +HOSTLOADLIBES_gconf = $(shell . $(obj)/.gconf-cfg && echo $$libs) +HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags) + +$(obj)/gconf.o: $(obj)/.gconf-cfg $(obj)/zconf.tab.o: $(obj)/zconf.lex.c diff --git a/scripts/kconfig/gconf-cfg.sh b/scripts/kconfig/gconf-cfg.sh new file mode 100755 index 0000000..533b3d8 --- /dev/null +++ b/scripts/kconfig/gconf-cfg.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 + +PKG="gtk+-2.0 gmodule-2.0 libglade-2.0" + +if ! pkg-config --exists $PKG; then + echo >&2 "*" + echo >&2 "* Unable to find the GTK+ installation. Please make sure that" + echo >&2 "* the GTK+ 2.0 development package is correctly installed." + echo >&2 "* You need $PKG" + echo >&2 "*" + exit 1 +fi + +if ! pkg-config --atleast-version=2.0.0 gtk+-2.0; then + echo >&2 "*" + echo >&2 "* GTK+ is present but version >= 2.0.0 is required." + echo >&2 "*" + exit 1 +fi + +echo cflags=\"$(pkg-config --cflags $PKG)\" +echo libs=\"$(pkg-config --libs $PKG)\" From patchwork Sun May 20 08:16:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 136419 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3213997lji; Sun, 20 May 2018 01:19:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqi5uzLbVZ+mFvH2Qhe2qvDHIG1Cwgj/KWmAZyuogXFAXjO7Zqo2lIFnG+O2gX86py2sW+G X-Received: by 2002:a17:902:20c9:: with SMTP id v9-v6mr16051987plg.206.1526804388131; Sun, 20 May 2018 01:19:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526804388; cv=none; d=google.com; s=arc-20160816; b=JucNVhbuJqYXV8W5cHt+XlAJlttHPyLw5/6VRUL+nXAZKaGSpTf2sjTZzfn9JlrzTP US5RHSEwCEhvInVi7VjYI5sgkmvXKzGRB352yh3NAIYUuQHiwBoSfICPFksqQafWPQKC ZBcIMgW2o6cmSdUHIn6rmU/vQ7wCvF4YcR3QwTH5KHssDNMXNqx/dI3GnxPePzuTUM9R zEmo3Mp3/UNK9pbQviEHs13ToK7zrJpLsl8xCvEVgVrNg8lCYThNjAwlCWJgPmMfN09d xll9GMyCYLaof8yrk3Df1cJaMdoMGNfX8Q0OD+cxyAksVBn4tGuElpTnaJ3bD7vLz1XH pABw== 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=7Zs6fZ01yIJSDMmCl+VFb0qiFM0Vky72s4Dsl0tcHb0=; b=OGum/jLYKaa3KbTd6NmY9hXnUvsJ0VzzWSclQzWcArtZc2FHVyV345poFl1wbAawJO TLMhD4bxylPJ38MAJZTL2RbHFxTv7wArIrukYFjlVFkZeLmf6ALjBXOjLzf3whrSCclh gkpdey5EQJvzCEmDyau7RztfU7cgMUioCbPDfoRvIqtWFE7jDGf2tSND56Kvqr04f268 /n8vOUSQSEaGvM18yfyLc9qaxsIhLW4mV7vI07gVgS42dxaPHDbFg6Jq7ie1DR29yN+H 8j17QCL18aSnRQkIv91pAqCia8HbV1nTEgtiiL+aY60pPH/IgP0z4/POcEqXR5smHHeW 0Xaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=BBa8pr/o; 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 b1-v6si11684774pla.570.2018.05.20.01.19.47; Sun, 20 May 2018 01:19:48 -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=BBa8pr/o; 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 S1752611AbeETITl (ORCPT + 29 others); Sun, 20 May 2018 04:19:41 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:22785 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752550AbeETITG (ORCPT ); Sun, 20 May 2018 04:19:06 -0400 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-07.nifty.com with ESMTP id w4K8H4h4004008; Sun, 20 May 2018 17:17:08 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w4K8H4h4004008 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526804228; bh=7Zs6fZ01yIJSDMmCl+VFb0qiFM0Vky72s4Dsl0tcHb0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BBa8pr/o5+2cX5GMwiJtVDubYO/CzfGjBPLf73z8CkbVria5SwQln9m/bbWDpkUvJ /ucrIzhcOtnMfPygMd+0IFxakZ6/2Kse/pBfs57NWTCSziIISLUCQS/hpRe2KIlF/h iWZp2lKoVFZWTpu17oLDQFN8y5+hoRxNOM3e5aCj4HZKk33YAOGeMoQSVmLes04jVU HwFfh/cif2SNGMOOIrSrUg7TNF0ajllSmwxK02NFT/t9PskghHBa50db0s1YnIhzLw Rq/iyARLLuAA5Ufla/Uqnok56J6Sh/WlX2uWqdpT4ZP2Nl+R8f8znir0pNXQxur+pd uh7++PC8npo2Q== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: "Luis R . Rodriguez" , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Masahiro Yamada , linux-kernel@vger.kernel.org, Thomas Gleixner , Philippe Ombredanne , Greg Kroah-Hartman , Arvind Prasanna Subject: [PATCH v2 4/5] kconfig: refactor ncurses package checks for building mconf Date: Sun, 20 May 2018 17:16:52 +0900 Message-Id: <1526804213-8238-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526804213-8238-1-git-send-email-yamada.masahiro@socionext.com> References: <1526804213-8238-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 The mconf (or its infrastructure, lxdiaglog) depends on ncurses. Move and rename check-lxdialog.sh to mconf-cfg.sh to make it work in the same way as for qconf and gconf. According to Randy's report, we still need to carry the fallback code in case the pkg-config fails to find ncurses. Signed-off-by: Masahiro Yamada --- Changes in v2: - Restore fallback detection for openSUSE etc. scripts/kconfig/Makefile | 44 +++++--------- scripts/kconfig/lxdialog/check-lxdialog.sh | 93 ------------------------------ scripts/kconfig/lxdialog/dialog.h | 2 +- scripts/kconfig/mconf-cfg.sh | 38 ++++++++++++ 4 files changed, 55 insertions(+), 122 deletions(-) delete mode 100755 scripts/kconfig/lxdialog/check-lxdialog.sh create mode 100755 scripts/kconfig/mconf-cfg.sh -- 2.7.4 diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index c222745..25a3d25 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -173,60 +173,48 @@ help: @echo ' xenconfig - Enable additional options for xen dom0 and guest kernel support' @echo ' tinyconfig - Configure the tiniest possible kernel' -# lxdialog stuff -check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh - -# Use recursively expanded variables so we do not call gcc unless -# we really need to do so. (Do not call gcc as part of make mrproper) -HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \ - -DLOCALE - # =========================================================================== # Shared Makefile for the various kconfig executables: # conf: Used for defconfig, oldconfig and related targets # nconf: Used for the nconfig target. # Utilizes ncurses -# mconf: Used for the menuconfig target -# Utilizes the lxdialog package # object files used by all kconfig flavours -lxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o -lxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o - conf-objs := conf.o zconf.tab.o -mconf-objs := mconf.o zconf.tab.o $(lxdialog) nconf-objs := nconf.o zconf.tab.o nconf.gui.o kxgettext-objs := kxgettext.o zconf.tab.o -hostprogs-y := conf nconf mconf kxgettext +hostprogs-y := conf nconf kxgettext targets += zconf.lex.c clean-files += gconf.glade.h clean-files += config.pot linux.pot -# Check that we have the required ncurses stuff installed for lxdialog (menuconfig) -PHONY += $(obj)/dochecklxdialog -$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/dochecklxdialog -$(obj)/dochecklxdialog: - $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf) - -always := dochecklxdialog - # Add environment specific flags -HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS)) -HOST_EXTRACXXFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCXX) $(HOSTCXXFLAGS)) - +HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS)) \ + -DLOCALE +HOST_EXTRACXXFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCXX) $(HOSTCXXFLAGS)) \ + -DLOCALE # generated files seem to need this to find local include files HOSTCFLAGS_zconf.lex.o := -I$(src) HOSTCFLAGS_zconf.tab.o := -I$(src) -HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) - 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" ) +# mconf: Used for the menuconfig target based on lxdialog +hostprogs-y += mconf +lxdialog := checklist.o inputbox.o menubox.o textbox.o util.o yesno.o +mconf-objs := mconf.o zconf.tab.o $(addprefix lxdialog/, $(lxdialog)) + +HOSTLOADLIBES_mconf = $(shell . $(obj)/.mconf-cfg && echo $$libs) +$(foreach f, mconf.o $(lxdialog), \ + $(eval HOSTCFLAGS_$f = $$(shell . $(obj)/.mconf-cfg && echo $$$$cflags))) + +$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/.mconf-cfg + # qconf: Used for the xconfig target based on Qt hostprogs-y += qconf qconf-cxxobjs := qconf.o diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh deleted file mode 100755 index 6c0bcd9..0000000 --- a/scripts/kconfig/lxdialog/check-lxdialog.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 -# Check ncurses compatibility - -# What library to link -ldflags() -{ - pkg-config --libs ncursesw 2>/dev/null && exit - pkg-config --libs ncurses 2>/dev/null && exit - for ext in so a dll.a dylib ; do - for lib in ncursesw ncurses curses ; do - $cc -print-file-name=lib${lib}.${ext} | grep -q / - if [ $? -eq 0 ]; then - echo "-l${lib}" - exit - fi - done - done - exit 1 -} - -# Where is ncurses.h? -ccflags() -{ - if pkg-config --cflags ncursesw 2>/dev/null; then - echo '-DCURSES_LOC="" -DNCURSES_WIDECHAR=1' - elif pkg-config --cflags ncurses 2>/dev/null; then - echo '-DCURSES_LOC=""' - elif [ -f /usr/include/ncursesw/curses.h ]; then - echo '-I/usr/include/ncursesw -DCURSES_LOC=""' - echo ' -DNCURSES_WIDECHAR=1' - elif [ -f /usr/include/ncurses/ncurses.h ]; then - echo '-I/usr/include/ncurses -DCURSES_LOC=""' - elif [ -f /usr/include/ncurses/curses.h ]; then - echo '-I/usr/include/ncurses -DCURSES_LOC=""' - elif [ -f /usr/include/ncurses.h ]; then - echo '-DCURSES_LOC=""' - else - echo '-DCURSES_LOC=""' - fi -} - -# Temp file, try to clean up after us -tmp=.lxdialog.tmp -trap "rm -f $tmp" 0 1 2 3 15 - -# Check if we can link to ncurses -check() { - $cc -x c - -o $tmp 2>/dev/null <<'EOF' -#include CURSES_LOC -main() {} -EOF - if [ $? != 0 ]; then - echo " *** Unable to find the ncurses libraries or the" 1>&2 - echo " *** required header files." 1>&2 - echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2 - echo " *** " 1>&2 - echo " *** Install ncurses (ncurses-devel or libncurses-dev " 1>&2 - echo " *** depending on your distribution) and try again." 1>&2 - echo " *** " 1>&2 - exit 1 - fi -} - -usage() { - printf "Usage: $0 [-check compiler options|-ccflags|-ldflags compiler options]\n" -} - -if [ $# -eq 0 ]; then - usage - exit 1 -fi - -cc="" -case "$1" in - "-check") - shift - cc="$@" - check - ;; - "-ccflags") - ccflags - ;; - "-ldflags") - shift - cc="$@" - ldflags - ;; - "*") - usage - exit 1 - ;; -esac diff --git a/scripts/kconfig/lxdialog/dialog.h b/scripts/kconfig/lxdialog/dialog.h index fcffd5b..52e30a0 100644 --- a/scripts/kconfig/lxdialog/dialog.h +++ b/scripts/kconfig/lxdialog/dialog.h @@ -35,7 +35,7 @@ #ifdef __sun__ #define CURS_MACROS #endif -#include CURSES_LOC +#include /* * Colors in ncurses 1.9.9e do not work properly since foreground and diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh new file mode 100755 index 0000000..f5fe183 --- /dev/null +++ b/scripts/kconfig/mconf-cfg.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 + +PKG="ncursesw" +PKG2="ncurses" + +if pkg-config --exists $PKG; then + echo cflags=\"-DNCURSES_WIDECHAR=1 $(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 +fi + +# Unfortunately, some distributions (e.g. openSUSE) cannot find ncurses +# by pkg-config. +if [ -f /usr/include/ncursesw/ncurses.h ]; then + echo cflags=\"-DNCURSES_WIDECHAR=1 -I/usr/include/ncursesw\" + echo libs=\"-lncursesw\" + exit 0 +fi + +if [ -f /usr/include/ncurses.h ]; then + echo cflags=\"\" + echo libs=\"-lncurses\" + 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 From patchwork Sun May 20 08:16:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 136415 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3213511lji; Sun, 20 May 2018 01:19:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrDOwtx/jkSe1suTUNDtzQQGSjXlHMEtZf7H5IX25uvDpXwcgJ8qlEc3QaLXHcQbYorwx20 X-Received: by 2002:a17:902:6ac6:: with SMTP id i6-v6mr16369984plt.31.1526804345035; Sun, 20 May 2018 01:19:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526804345; cv=none; d=google.com; s=arc-20160816; b=po9aCsuMjVtJ3gTKWvDQbGsOeIHS3k7dnVakiN4yL784TVcgpfEtHtRxcJ0aEWsTiu lEb75MtqwjhsqvAchkH2iXzwagIke+TBcIX8S2J060l7TnHiJRxDkLA8DVlKDt+r7HU6 bLozXC+sySj2KYAmfLaZBbrNl/W9LcQVVwSae41BNflk18HUqWHAxGFxX+19RdRnUNdA eQfbJZ8R2I5gAa6gx+9wRNmKywA3np6Lg1EpCGi0iS0rEHdfkiSlJvT82swjGlAUYE42 5e3KJJyJWzyHq2KoDvd8vI/0AAH37aD8QLNYU07ufICqWZaT121YwRPcAy5vaayU5Avr AA2w== 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=ADGuTHjs9MGaTk4AR46UNaqCWbIPH9cNIfOzx/hWGpg=; b=EwxR5AOvNnTmH/RlHiiGmk/4NWK3psWJxTn2OPNFHSry/OQD6kagvXp0TIFghTpRyL m+CrKwy6upLz4Ob2Lj47W0YkCRJt/6kiuhXuBSFrS2ukhZwRvC5dXmvquEcNM99jZ3yG cIzwBwZ+h8T0z48GIOFEak0ZVAITnS2+mOF7VcilFSjVwBaivnFJ9+FVNt+PyaBl/jAd o7SJSERRUScxGN56R6nsNWLHJNUGUEmYM/n5j2E6IR/trn9LyrnlyfbcN/tIMV6vk5XN 9YTDpcVN9Q9eUqDzLwr9KDicgiNocufgPJcOPXLbanL2BAdEjLuYlkI+Wptiu9XQGT9b +Hzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=WldDayOR; 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 e2-v6si9165184pga.647.2018.05.20.01.19.04; Sun, 20 May 2018 01:19:05 -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=WldDayOR; 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 S1752537AbeETITD (ORCPT + 29 others); Sun, 20 May 2018 04:19:03 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:22132 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751451AbeETISp (ORCPT ); Sun, 20 May 2018 04:18:45 -0400 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-07.nifty.com with ESMTP id w4K8H4h5004008; Sun, 20 May 2018 17:17:09 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w4K8H4h5004008 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526804229; bh=ADGuTHjs9MGaTk4AR46UNaqCWbIPH9cNIfOzx/hWGpg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WldDayOR4JqbeCEuAKyTYkabtnoCEFp8x3WhVhoctw3M7xmZhRfi3nPofr48jn+S5 DVXRQU5wfmUGTLeVHjvSj0cOm5AuVs8JskEiKGLtlP6oBYa0F6mXdSVNsSWL1D3c/T wR1R5Ctpqs5V09hjhC5ua7rofd+OWHEbKBy725FAu32UXH37LOwSKPaVQ0jlhfVAtm bmIX9t5IERa92pQ0hckdBsoyil/z0GjbiEl2NXmpHIM+YmJqIw3CkxvwWA+pakkCrE kRP0l6xWojQOD14/djT4w6LdDANlfLZNYxnNmz1Hoo2mftYYBSKIvQZnXhf7tBV95m QPoJZGieD/KKg== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: "Luis R . Rodriguez" , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v2 5/5] kconfig: refactor ncurses package checks for building nconf Date: Sun, 20 May 2018 17:16:53 +0900 Message-Id: <1526804213-8238-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526804213-8238-1-git-send-email-yamada.masahiro@socionext.com> References: <1526804213-8238-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 by a shell script like the other GUI frontends. Signed-off-by: Masahiro Yamada --- Changes in v2: - Add fallback code in case distributions cannot find ncurses by pkg-config. scripts/kconfig/Makefile | 16 ++++++++-------- scripts/kconfig/nconf-cfg.sh | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 42 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..8eb7948 --- /dev/null +++ b/scripts/kconfig/nconf-cfg.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 + +PKG="ncursesw menuw panelw" +PKG2="ncurses menu panel" + +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 + +# Unfortunately, some distributions (e.g. openSUSE) cannot find ncurses +# by pkg-config. +if [ -f /usr/include/ncursesw/ncurses.h ]; then + echo libs=\"-lncursesw -lmenuw -lpanelw\" + exit 0 +fi + +if [ -f /usr/include/ncurses.h ]; then + echo libs=\"-lncurses -lmenu -lpanel\" + 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