From patchwork Fri May 18 04:52:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 136230 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp768982lji; Thu, 17 May 2018 21:54:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoy9AEXSOHRLR9yHtWn6gTlT0iH9JODadO7K5RDcQfCjFkjZSAegyqRM6Yp/9v0RI7UhW1q X-Received: by 2002:a63:b907:: with SMTP id z7-v6mr6326578pge.9.1526619254805; Thu, 17 May 2018 21:54:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526619254; cv=none; d=google.com; s=arc-20160816; b=0Sj7IjGmnk8I41rdK6vv8nZqa4hhwpenAkH1mNimLtcjg+teZX6txq8IKpqwmIFPly bPrx+vHuAq17jTnv+Oep7Hcj9kuqp3oRi97x4c71ltAHsvtrcbVCO1R07CQhuHkeXMIe ZDo+VzbcTGSXQj1r4HoxwB1dd5kF7CQ+2MzOsEhlQaGl9ZXlXnlSoW/IeYUBUblTeyTb O0Pm/fSloyLCp+z4ihS9MRyIy6Knhv+IWDN+NP5rvxSH49/9193+S6gXsbM5m17YXS2v OfrZJhVM6gDWl5AbQKRUBfL2Md4adITEHNW+DDxrtmSRXWg+KAQSyIXiW9jVeFz5iV+L zV8w== 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=VzPwEP5DR+NzuSAaYDnoMFqpUnZZA3AgGs4WP4FlsCQ=; b=zusJldY9jBOQ3A0SrqOIS+axUhreqAy/nH3Nplux7fdOEUxo6O8RzVFGbuYyisavlY IZs+A0/AVkmRRtMLNtnckB96DCPEuHr02S4UeT9GfSv2SyOMIr4hWHuV5ipeaD1n3Z2V jwDj6v7hs33CWkrpcxaY+ydRYolbQ4QGpQ388DBqQilSmrTFprodS1PeNi0jaD6n+Rqh MiHIM69CiNS79NO1deGMJq3sCLwgcO0zYoPV371bdALGEMx702Hksmc3gC6ROHu2oF/l pilCJxTONgnu167XZuooNC7e9KwaM21mhZjk1sihiNnSFNr5V9GkQDNUTjUsd0THSV/Z KgBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=FhRUkCwv; 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 h68-v6si5293182pgc.579.2018.05.17.21.54.14; Thu, 17 May 2018 21:54: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=FhRUkCwv; 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 S1751571AbeERExx (ORCPT + 29 others); Fri, 18 May 2018 00:53:53 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:33673 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750977AbeERExu (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 w4I4qbKE013482; Fri, 18 May 2018 13:52:38 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com w4I4qbKE013482 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526619159; bh=VzPwEP5DR+NzuSAaYDnoMFqpUnZZA3AgGs4WP4FlsCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FhRUkCwvVN1i3LaZ2YxbEPvy1DNjxVw+y2uMM6XPe1v8QOSgJJFAwI2mH8TcGiLBA 4zWwwylrpJqLWYjiLlcDKC0RZCgZTP4ccOAxBcZiFzsnlA+yUjWuT2XMbcTS+eDoCd bXlLh76KKv6XArrXasGftM490YH/rFumLb0ERhxSan2twDS9vOQrl2L6TTAjoEN3Oz d99pXfNrqMTEU3WyNlfpZonw7yj3ieqjQqL/6z3todWC28J2gj5b0qkQOZHewp+QD/ WCWX6xGUP63+XA7TTeMB/tAW93UAm1A2a86mn8B0lC/VzOMrfhk1tuGJp8HIU6eJgi L39AvEKlRaPQA== 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 , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 1/5] kbuild: do not display CHK for filechk Date: Fri, 18 May 2018 13:52:22 +0900 Message-Id: <1526619146-1895-2-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 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 --- 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 Fri May 18 04:52:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 136229 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp768825lji; Thu, 17 May 2018 21:54:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpKC39NxjKUAO6KkgzRZKXgnVVCvgSni2Zo/PLPERmeXex7Vfn0w4v3Ks82Z5T4rMVWVJaf X-Received: by 2002:a17:902:a582:: with SMTP id az2-v6mr7825584plb.98.1526619243096; Thu, 17 May 2018 21:54:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526619243; cv=none; d=google.com; s=arc-20160816; b=eBX4dSLgycjpNKgCh7pdxHYvTb2QTSzOnGVgTZeVNIQhCkMm1ZpWvEKVJUemBFo+Yp CiZXWmHyyBhQNQXKLli+Me8bn2Hb5RtYq5Eg3MzOyukHSFtX3Pd3FvhTiOcZlK2yLU4b HfOYPowYVpjRBS07iQt7WxPNCtpdBIdWrppSGwaEzffJUInNCmMWQsvUbfX+S0OntsRC PAquvpcs9YKnmbyX4YCg3QfQpRtAk2hb7TMFTTm9DmzfKLYlMAH5pv5LR6yvNKGrV9T3 CX+jHKNLrMq3oSmMVL4fkHJilv3tmiketo/Wr+w1zChReLIu8GrhWAisPdMNDjJRUEvi tkSw== 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=qXy3l+NlilK/kMb7AAilHuM0kHRD/o8Qh7qkJFkxv0w=; b=PhnVuvANzgDXYkvBEu7HLSz6J5ZFurNoQn8kpAIrQsUpYUQ8eEWN+lekNOiioBwX/o WfQHmnBr0vU9dbl12CiyfX3Lt+br0rX6gfhtc7WP8/uwvDC/mMb705oM786ixpjcU9kT Q9DZsOuIaEYBp+yCjH22tyFeXfhyp1EdQ7WDWBbnH1NfPmIXw89RK957wJGPlV3DrpTv zONtjCBbyn0A/RvYBPi2FCPyyC5ukYLt5ycN3hpy3vO/iQLXdPd4WUjYJt1B8gVTWCAu +wA8qKpLM3Wken2IUDr0hUnKYBY2rGlXR9vppbbF9KE6cHMS3wCRsBmc4UIdjJJCWp6D /Byg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=t7z8j7CE; 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 w12-v6si6519759pld.367.2018.05.17.21.54.02; Thu, 17 May 2018 21:54:03 -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=t7z8j7CE; 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 S1751722AbeERExy (ORCPT + 29 others); Fri, 18 May 2018 00:53:54 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:33678 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751023AbeERExu (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 w4I4qbKF013482; Fri, 18 May 2018 13:52:39 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com w4I4qbKF013482 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526619159; bh=qXy3l+NlilK/kMb7AAilHuM0kHRD/o8Qh7qkJFkxv0w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t7z8j7CEKp0R4oKxT/7L3b8XYQHncpqmVEzVeTAnImyni9r4XLkIAefvE4F9rgdJT BuR8tVFUEFfP6q3gbi6rxohBgio2tfPZsmAmA3rmfKYg5xKLaLxX4gOFeQYf7E9eqc e3J4fYd+7nBTgYTKoTnAvIGUKIQYgIsdjQqtTyg9e0rYxaB5DkD6SkVrWNognNzKF4 JSKTPsEUUnuWPPHxzfH4t3gkvmg4ab4DPfHBz6V+AQrPYhS9sXhvYoEw6WJRaD/lP5 BQeWCHJkwTULJSMwIalMY/l3jrpWguAqe5Y3ZA2Prhasth3Q0j0X4RHhl+MZM1BYWr cuFy0H+0zlQ3A== 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 2/5] kconfig: refactor Qt package checks for building qconf Date: Fri, 18 May 2018 13:52:23 +0900 Message-Id: <1526619146-1895-3-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 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 --- 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 Tested-by: Randy Dunlap Acked-by: Randy Dunlap 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 Fri May 18 04:52:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 136233 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp769377lji; Thu, 17 May 2018 21:54:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr7b96Lf2rzBmBYfzeISX+fUFwRO5NtMyp0aU9z4Cdu+MAZHbXfbwKIecBcuB6S2xnTJnOB X-Received: by 2002:a17:902:7402:: with SMTP id g2-v6mr8150549pll.246.1526619288206; Thu, 17 May 2018 21:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526619288; cv=none; d=google.com; s=arc-20160816; b=ByfSoGM/xRnfG03poZh+iTwmYY0ccFbYMrVm1gjNdsej7Ve79nwGtW//BMUQsJ8rcD j47hTYHbMloC8gIa1z/8EGzc0+1KbQJc46FslblBSDGbm5FwTUa1nvY5SBRnfvVJ3slh 8o3CwwvIGXhhAy4TEuZgIcDjdQe97+tuAbmcq7wd0Mq1UjnGXG1ObeAryzitm7jGuSZb Qx9C6KqkWYdyZsfbWRA+EPZEQY8fAoQtBbE5YOrr9qf3qg+qiAPbgKjgsRQ69uWDCoAl 9r1q19/z1MhowoYbucCP2tYlp88VAdgejMQYSE286CXxtjKLTeSdxnqlWE1E29DSnxDU ea7A== 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=rZt4UP6ZUiLJxShvjJFl3+K62O9507lX9+kf8QKnsNY=; b=apynC10Bkwg3AFtwl9wS6wqn6dvPNYGZjTA6LcMIAdG9vGjP4Fmj5jm3B9oQ6KZs4g Me5JvuWpqI2Iz4XwFujKbrzqOwmU+twMJHCgSN3ubIXCeKAKw2GmB57a53FEXDxBsaFL aN6vF28qBiPkX3VPB3P9HHgBN9PUMkohl5h+by5sLv9N0Mj2Af8C/vUEgVjUc5IjGLCv pBdDR5d9p52PGUNbcwk/ZgKWGitv/XVlDV5+FVfI7YCMWgcH1bv92ijOTzkEGx/jCgVt wtbCUQ/gqjPv4U+xyklAQu6bF3bnG0IjmD3xSD1EXqqlOWDWNwmahGkUTcN6WzDHASSd A6ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=aA1jYOAQ; 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 z16-v6si6481168pfn.149.2018.05.17.21.54.47; Thu, 17 May 2018 21:54: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=aA1jYOAQ; 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 S1752075AbeEREyp (ORCPT + 29 others); Fri, 18 May 2018 00:54:45 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:33737 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751363AbeERExw (ORCPT ); Fri, 18 May 2018 00:53:52 -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 w4I4qbKG013482; Fri, 18 May 2018 13:52:40 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com w4I4qbKG013482 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526619160; bh=rZt4UP6ZUiLJxShvjJFl3+K62O9507lX9+kf8QKnsNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aA1jYOAQJ2QWKIBIIt9V0RsvrP7gFt4fQvb2eB+/04rJTZ+03roNC+IvGGz7GHv3k sWyHBeomJAnyHdgypE/V9k/j0sfVPi3F7jWaUhKi/G6jOSZiZuePwkpAlKzWQD4V88 0oDE5aK21/UDs9+vgMSi5FX8cJ9EdoMu56krN5dDmVh2HNUVPSxRb4RMVhZaEAk05x VVqr2T/tTokfO/DgmzXhZh/NHxuKvfFmJx00Q1qy66rseNIFjJsA+ozhNWn6H2o6UJ LdROPVSHZzP59p6bC1KITKAh5qUppcXhw11dpmC9Wk/HfZXIGdOBs74Pi8qkpSfO79 PJWCmy+0/W09w== 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 3/5] kconfig: refactor GTK+ package checks for building gconf Date: Fri, 18 May 2018 13:52:24 +0900 Message-Id: <1526619146-1895-4-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 Refactor the necessary package checks for building gconf in the same way as for qconf. Signed-off-by: Masahiro Yamada --- 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 Tested-by: Randy Dunlap Acked-by: Randy Dunlap 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 Fri May 18 04:52:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 136231 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp769035lji; Thu, 17 May 2018 21:54:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpDKgQVwjoz621MqBa7O96hIkxY4JmvFSw03In3gbcMyHvBRKlvAw1TswliVmRGhbSg+bgZ X-Received: by 2002:a62:78c:: with SMTP id 12-v6mr7874620pfh.178.1526619259540; Thu, 17 May 2018 21:54:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526619259; cv=none; d=google.com; s=arc-20160816; b=Q1j7I5+8Kdiefzn/cSyMNSJxEEexjnmw7x0uSI7/oZOn/Rb97R89xh2GO765wYFIoU fYeqKX0jU/6DN539JN8uSj5nax2l9nV4zIE+NGYTx/deL4NFgx2J/ItnNQAvHQmFByZK xZ913Yvnh2mUquE54jVOwj24W6eJlZdwqVc1bDC4CabKDhE8qd0BcMmPCmU121yZNZTv dizMsWuWFtD1Kezx9gXkpkbBIi48qU8uFOhXBLLglp7dM4nT61CbGXk6hVeSSLTH1yCE wch4RbAXpoIRG2HVcRrYSjJ965RcZQTfoGnZExJX0NlAVNoz93CxTmE6bxCfHqcjR+3H d9Gw== 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=2sGr2fqfNPJUmiBhzE6pSuGCearjfItYeHO3XBDRUAc=; b=A6R3ieO6cuRxaF5qDjQQwrSSxj4WOHYHHRdn54hT2LnkbzbTFQ94N3wSUsmtOUsonR aiTGAh31TrJ9h63jnUwNJRHNMS+MnNN543F6pvY3yR59Ne8Az+WxNpxpMP/AvRJmSvkc DzjhDKGgCg96KFBFxpOyaZWexBkJMKR6L1Oz0QkXNBZ7CA9QxskZ22oBQhcFSVLQD0oO cBBpkUkUb5XYmY3tjvhguk6eOWKGRpmrooRgBfZzG2BjZ6s6b/nMoZJz6jS8SmbWZv0U 7O24/Jg+rda2nbJs51txRRpvWaWzhuDNY+UCbPyNZGvbwIXyAP8hY4oTwcwqmLgOlha/ sC2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=N7CSX9VV; 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 n3-v6si5393579pga.543.2018.05.17.21.54.19; Thu, 17 May 2018 21:54:19 -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=N7CSX9VV; 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 S1751979AbeEREyP (ORCPT + 29 others); Fri, 18 May 2018 00:54:15 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:34238 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751880AbeEREyJ (ORCPT ); Fri, 18 May 2018 00:54:09 -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 w4I4qbKH013482; Fri, 18 May 2018 13:52:40 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com w4I4qbKH013482 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526619161; bh=2sGr2fqfNPJUmiBhzE6pSuGCearjfItYeHO3XBDRUAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N7CSX9VVfjVsiGl4/zBymmAXY3SECXXqK6tmcPjFz09nXPXgtVWY3UKAD2LUb/9Gx WotgjHjW5wzWm0tEzkMXLnb+2KjLJ42wrN6ZlSTS67JJXuYOO9E3qcXvLZwflTTX6+ QSvdpKvKzSxgcBwi419PS/K00lr/krNpyBGGF3Sbcw1WrPpqjCOEm8zqRxFyTzscy2 3BlDWmZX6YOXtgPpcLuaF+AmXp67FVQSOR+njbmtnMMdgH4o9545C7aNGZnJtNnZg+ y5xmYhj9xBmY6WWLt9Op0HYeP3xbKgOVOP/H3enJbOLbU/ZcRTV0ajtqDsyJX8Q9BC W/d8WUFP3BKwg== 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, Philippe Ombredanne , Kate Stewart , Greg Kroah-Hartman , Arvind Prasanna Subject: [PATCH 4/5] kconfig: refactor ncurses package checks for building mconf Date: Fri, 18 May 2018 13:52:25 +0900 Message-Id: <1526619146-1895-5-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 The mconf (or its infrastructure, lxdiaglog) depends on ncurses. check-lxdialog.sh has additional checks in case pkg-config is not available. However, qconf and gconf already rely on pkg-config to check necessary packages. For simplification, drop the fallback code from check-lxdialog.sh and move/rename to mconf-cfg.sh to make it work in the same way as the other GUI frontends. Signed-off-by: Masahiro Yamada --- scripts/kconfig/Makefile | 44 +++++--------- scripts/kconfig/lxdialog/check-lxdialog.sh | 93 ------------------------------ scripts/kconfig/lxdialog/dialog.h | 2 +- scripts/kconfig/mconf-cfg.sh | 24 ++++++++ 4 files changed, 41 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..7d5a4b2 --- /dev/null +++ b/scripts/kconfig/mconf-cfg.sh @@ -0,0 +1,24 @@ +#!/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 + +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 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