From patchwork Tue May 22 07:22:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 136518 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1270559lji; Tue, 22 May 2018 00:24:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoGXbn/jXWO65UtDF1EU8lNB7yo96JK1kCzDJYXtDvWxWCPhSG/my6aVmINW+rzCWfbfjGZ X-Received: by 2002:a65:5d0f:: with SMTP id e15-v6mr18558747pgr.119.1526973895652; Tue, 22 May 2018 00:24:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526973895; cv=none; d=google.com; s=arc-20160816; b=q1+XhzeqFyNqYQQCVotuWfdanO1fmJqu5q3IUeo0mS3fWbJzOCJaP4LgH8e8vMxI5a E7LkJnMbIdzbX7CxkmC8JgEv38fkgzsA07fHrDeuH/Il2vu9G/4TUnPdzEa5ksnIfz1a 4phgFPvNwayWwcs8rNZib95q79phJ8Mq4EOdGVFgig9zdXDGaIlRqmyf0kd9qvGmodpU tb3AGS0pyZWDB/7C1KrQIdOyyvq7UFC1ByO2hLP2tw3z9hGyBJQ/Ky0VdW6GXNmnqc8e w3PTfFQ3cVqcP/b2d8jlwCY2yO6UZiuJ8T2JJdtKCy1UJCy8CvvG48KoqBswfEl6KAnV yBTQ== 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=YZz05hZESdh9e1BrVk9U9DopTsUk+6gnLFFEgdj+d5M=; b=TTAYvIwnxZO4RKLzED3IHhxK99b9grm04FfLEVVZilxujo3MsLtmO5WgaK5SA9n508 jDOzRJO3dD1tP2R7UG4Z5Mn1A/D4DugFVJ9cQv2QL76pcz6qvcXXz5y1k5KyuoxJwU37 EDmwM2ESs1QoP6T39ezHIQXGJ2FLG8knAXrzxWX0xlbo/0QYkLxtUeOAUYHgwTnM9L9Q usj3Yfiild0Bk3w3aRxDh6Pw6SaCHaU+wr3VnS3j0z3tLtGjlA3I6BlFhRhPpz+1ZJKa v79Q4OVZvBzhS1j+eU+Ff8HMg4zIIVhXrCU394qYIelAgVg9h0wp7frkCSEPvvsDLldH qGLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=UEHi9TeM; 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 v12-v6si16055929plz.33.2018.05.22.00.24.55; Tue, 22 May 2018 00:24:55 -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=UEHi9TeM; 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 S1751566AbeEVHYw (ORCPT + 30 others); Tue, 22 May 2018 03:24:52 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:45460 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751374AbeEVHXv (ORCPT ); Tue, 22 May 2018 03:23:51 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id w4M7MRAe030337; Tue, 22 May 2018 16:22:28 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com w4M7MRAe030337 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526973749; bh=YZz05hZESdh9e1BrVk9U9DopTsUk+6gnLFFEgdj+d5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UEHi9TeMoRcFBbNbKxSXttqPt27oVLZ/XVCQO1pyhrUPcIBwpX5fh+8RMHYvSR7Vs w5yWxzgcBv29TcOasWeOxwPcMW0c2dWsasJlkemw0ZOSyhhc5SLoUXoAgdXYdrnhvp qgpWFgei3D7Zrp9nmZPPTvmb9x3L1zcJVKk5NgIq7Qe+Cc2z7kawL/ALzSxW14jtgB kpwrY0furGjBCqhni0RJN9yfMxZdKKrx2Ar9LVj9OkUgU/Mwt6KmNEv2cRdh2p4cb6 Kz+/Bc5hsU4sIJEdpylsOWNseBmVLnYV5gJDTYn+NiPyFZjOIlL+7nFFZI4XBDtbdr CEB7PKrBwvfLQ== 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 v3 1/4] kbuild: do not display CHK for filechk Date: Tue, 22 May 2018 16:22:18 +0900 Message-Id: <1526973741-664-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526973741-664-1-git-send-email-yamada.masahiro@socionext.com> References: <1526973741-664-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 v3: None 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 Tue May 22 07:22:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 136514 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1269743lji; Tue, 22 May 2018 00:23:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZppT4TVpziSqJ9YOwAkZUwySwnsI4WC1pLuF9oYg+2+hrbgBwPnCR0DFuwlNJSiKhN8O94N X-Received: by 2002:a63:7b03:: with SMTP id w3-v6mr214028pgc.52.1526973836339; Tue, 22 May 2018 00:23:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526973836; cv=none; d=google.com; s=arc-20160816; b=i7kDAsoCQuzgmGnn0RAP4K4hM7/hf6BW25Smo7uHKf3Ntcop9tqKLtGta6KxvX62cV daVYLSH6bjgmNIWBN8YAesrQp1rhWYTC1XGgQ8JgjKeX+9e9g1GUu1KAtQX8YVoT38G6 6OG/5M5WRh2D+EKVeCXvPpEH2X66rwkXbz2xsHD4MGtEEWaZC+zLCybgB8YT+Hfr5Ur9 Qz1jaMoyH13KluJYlsJG1RpJTsjkKmJ+GNXlQxsIEi1XR7NiK69r6rWU5W8RTGV2viuX TCV+ssCvKSBZPKt7czHDD6GDl7LNgj9Wd4+QAKTgkUcD7p3qOIFsyT+vgQofPq/vnZ+3 5RPQ== 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=OTtcVJf3tTX+qHvgXLfiXV7/+lfkzpqtmR+zYzSnwMs=; b=xcWy+aE0dMvoBy+S+TGBkU6gI6+CiMY9ZtT7KVIdRFC4dLDY0SjY2UxzZh/we94izH QHtWU0/BRvlCetw2Ff6dxPqCTQnIp+eXeO7dEb4x/JQCoFtVcg+579lgkFYEA2vwKelj +6kDHOAKYi+F9hsvkore5pZb8pep4QQ61GKG8u1n7pDN8EU+bffQc8GfZBHMdSF3YyXz vCuF7N6No5L0KFtmi0osjSg/lViqUeN2u2LmsvOBPmSROJv4RSsaNyxtaEuOlcQEmLb/ Zn/R9fe2fBC2nEoBhlW2on4M1vVlhbRRnJEDYmiuK06uLiiC4ajo8TvQXpgKOwnFD03a w0oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=eApkcPKw; 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 p3-v6si15879992pld.408.2018.05.22.00.23.55; Tue, 22 May 2018 00:23:56 -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=eApkcPKw; 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 S1751439AbeEVHXy (ORCPT + 30 others); Tue, 22 May 2018 03:23:54 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:45464 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751377AbeEVHXv (ORCPT ); Tue, 22 May 2018 03:23:51 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id w4M7MRAf030337; Tue, 22 May 2018 16:22:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com w4M7MRAf030337 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526973750; bh=OTtcVJf3tTX+qHvgXLfiXV7/+lfkzpqtmR+zYzSnwMs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eApkcPKwmxqpWaGDcPcD7J5TJRrkRWJURXZjyVE9Pzr7etNDYx7qvxjsr8OiFuuaM c8BmPRQXmC8QsjjMYlOeaqyu4cRr37kINUTX4w6KdSPYuasadn31ifIUwDpMEgEBwB dBOqfwSXbQF0L0Q1sNy3VpXJ+l6V7AK+lGGyHnX+qWVcNJmAde9FtG0j1Jb2eQh0wK tbS3+F3N60HCdquxLsGZazULnlY74gtxMax7YUXfdx6zT1pehkCgJ/BdmBaI2bAS6n Xe180jj+qic3EmSIP/CGDFIa7bkp8bq2KJ85oKQy7J/Z38EFOunMZ1+9FPyoq9BrUo KbdTfxkCdq84A== 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 v3 2/4] kconfig: refactor Qt package checks for building qconf Date: Tue, 22 May 2018 16:22:19 +0900 Message-Id: <1526973741-664-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526973741-664-1-git-send-email-yamada.masahiro@socionext.com> References: <1526973741-664-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. In the old code, 'pkg-config --exists' only checked Qt5Core / QtCore, but the set of necessary packages should be checked. Signed-off-by: Masahiro Yamada Tested-by: Randy Dunlap Acked-by: Randy Dunlap --- Changes in v3: None 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 Tue May 22 07:22:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 136515 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1269902lji; Tue, 22 May 2018 00:24:07 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrlfERshKSgScrMU6yY2kS5G4WXekFlEhF+yqhla6O4M6GCCbWoLxnzm9e5Wu0O7PFKAXxp X-Received: by 2002:a17:902:8303:: with SMTP id bd3-v6mr23268351plb.290.1526973846961; Tue, 22 May 2018 00:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526973846; cv=none; d=google.com; s=arc-20160816; b=tjnmcd9cfJPCWXahIcgegx/5YAfJKoNbSHiWn/Jy9OCtbZdtKPCB5u5l+BOb+wsGYw wvwUco2/k6vlkczn0rXT4THAYVzzq7nhM+8yW09Ouq+ER7VwLU2TXh7S0pZv8bZ9gwoY I1UNZaKd0Yr11+VygcaSpIJKMBqrjgpVNekQuV4WeDuKyyKjH7sILyRh5Pf7w2r37Ycr T7gh+GEIp6cr6guO9LNr+kFq1kCaZxOm5zPnIxkN/uCO2wMWTVCS7azbMqv1TimFAE52 xvgXiD+nnubZPi8qOCJM53n3FmlMWvPVQ4VIl99nYwjspGS3dH45OXvGH80vVKnWBlEg kCpg== 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=Dfx8vKEotre5kU8AEJWg2PLVB8q3ac/Ul+ns3N1fji8=; b=yWAqrCkyQ0oMrbk5yPPnpZ6glN+8haEEnDFcvJMHrSWzYLrwqt3Wa+IieqEkXncpMP DP+jJwnFp/IPET1dHZvqz3DdjfW9ctpbrRw6U1tb4xWWqwr/qoDDeQHrBSim1uGWiyBQ kPQsK0qg98DtApSjZWX0V9sM56GGikg8aNihIvThM3ZgpXh07wlPi6R988Va7JzZ+Vcv 2HrRXK9j7eqCZg+lpiizcdjja6hjMkhI1yN65dI8v3VCf2UExzj90/kb+GCsxPvYY2y3 ynSM16q+nAe5hW1uk3OoeTw+Gl6dx5OjmUCk6JIem8/WtAttnvxBVP1BtXuyxEj80FSz thoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=CifUTg4R; 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-v6si12376319pgq.249.2018.05.22.00.24.06; Tue, 22 May 2018 00:24:06 -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=CifUTg4R; 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 S1751411AbeEVHXw (ORCPT + 30 others); Tue, 22 May 2018 03:23:52 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:45387 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750707AbeEVHXs (ORCPT ); Tue, 22 May 2018 03:23:48 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id w4M7MRAg030337; Tue, 22 May 2018 16:22:30 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com w4M7MRAg030337 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526973750; bh=Dfx8vKEotre5kU8AEJWg2PLVB8q3ac/Ul+ns3N1fji8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CifUTg4R4kanFaDAD9fED/fZWeaS3wviEWv/ws2w2bED017OSfVemkxX+sm6zRdyJ rB6Za6eE1vYtOIJo56dARQYBiBcOa9+z+H25tH9nBXFESxcPZoK8ookerCL9nEMI1m P1iYOWZ9f6OHmtwLMSKORwdDLF6tCALX4s3gxwTABtaQBCnZ3s8dfRqCDyPYrGXC+5 BeUekszhiyhBZA+58gNbsfz5lnVm0ElFir3Gn0P+sC5QWcJr+F1htc4ljHk7krFVEp xKeA41CFPxST65FbATjeQ8XEuxQuCXE8O/ZxrSccSZksleIM6Kpwghb2GkQwdya4la tjwhPbWKIHkew== 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 v3 3/4] kconfig: refactor GTK+ package checks for building gconf Date: Tue, 22 May 2018 16:22:20 +0900 Message-Id: <1526973741-664-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526973741-664-1-git-send-email-yamada.masahiro@socionext.com> References: <1526973741-664-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. Also, convert the build rule of gconf.glade.h to Kbuild style. Signed-off-by: Masahiro Yamada Tested-by: Randy Dunlap Acked-by: Randy Dunlap --- Changes in v3: - Use kbuild short log for building gconf.glade.h too Changes in v2: None scripts/kconfig/Makefile | 49 ++++++++++++-------------------------------- scripts/kconfig/gconf-cfg.sh | 23 +++++++++++++++++++++ 2 files changed, 36 insertions(+), 36 deletions(-) create mode 100755 scripts/kconfig/gconf-cfg.sh -- 2.7.4 diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index e9a87bf..8cee14b 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,38 +243,23 @@ 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 # Extract gconf menu items for i18n support +quiet_cmd_intl = INTL $@ + cmd_intl = intltool-extract --type=gettext/glade --srcdir=$(srctree) $< + $(obj)/gconf.glade.h: $(obj)/gconf.glade - $(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \ - $(obj)/gconf.glade + $(call cmd,intl) # check if necessary packages are available, and configure build flags define filechk_conf_cfg 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 Tue May 22 07:22:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 136517 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1270152lji; Tue, 22 May 2018 00:24:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqvenOtoMCXFvCSXntBxDMBuxdqbuugE+ZNanlqq1Se6dM0T4LzCm8FGaNurmDI0ucA9inj X-Received: by 2002:a62:5b02:: with SMTP id p2-v6mr22930503pfb.96.1526973864940; Tue, 22 May 2018 00:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526973864; cv=none; d=google.com; s=arc-20160816; b=wYtW+D8xxDLWh8FihEOLUCvRB1Z5g/hjp3Z9NzEJA0PHQXcbVbXsMJbzA3dnIPwzRK 3MRzifMMDEDzM6ULfVK02o4nNT6f8VqytU+u7sfqiolGZOF0ngs5eH2PAXAIT0rqjHt6 JKBiCFI8MGDRI9aUwbZJfOGUFSoYpe1CEeY7Kxqz0TacmI5JY+U1O9XluiYf2iER1Tsr XX1bUdLwAw8/ksVCRbWtJ5vwC3TGe5G6M3g3Nc4yXmawQ14unhkOjCBt7w+v32yXfh0g 61r2nQP4SkpyNr/PiX3dm5qqNUKVfV2A2SNaf17IopP1UTtJbTs3dmXhs/wSVf9dNxGj VV1g== 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=1j6K72fPGCLbBfe8TiP8xiHZKHAfTPWJIupW8bOspc8=; b=Ktr4yahto4KZWxHMoBvhPF0kbcgOasg6Y0Ma0869aoVfI+Du5CBMIlTJ1MZplCs+tG +zohOvt7apuL9fGR7HxDelBtqUtd5PMwRMnEIGgYk3PxJpsb41eKAS4D1yKPDTD1rmVz nLiVzbj4aIpzcmHgcq6oPVb9JofVYQM9sh4Nz7vUpINTxMUaylrcHDCL5Cx5tifoKU54 vbYIdc24SfKtVUzPaETU9FPBDbjlvSvP0U9Bnr/Sjl7J1lR6oZj596Pp9B6U1fDSnk2+ Y7ObQYDCJFj4jGp4cerisvCzAeVksFMqiocx2XXffj4VC2+rf9zu09ZntaImKtoQLg5r YYPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=vpvXMErm; 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 c1-v6si14693081pld.103.2018.05.22.00.24.24; Tue, 22 May 2018 00:24: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=vpvXMErm; 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 S1751527AbeEVHYW (ORCPT + 30 others); Tue, 22 May 2018 03:24:22 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:46282 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751492AbeEVHYR (ORCPT ); Tue, 22 May 2018 03:24:17 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id w4M7MRAh030337; Tue, 22 May 2018 16:22:30 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com w4M7MRAh030337 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526973751; bh=1j6K72fPGCLbBfe8TiP8xiHZKHAfTPWJIupW8bOspc8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vpvXMErmzP2v3O1TzZO8ymMYe6WdXof+xIYR7i8F/VdDnW0G2u8EN8WNhPKN9+jDT W4uNdxJ/1W4+grd1WybjQUYXp4IJ5BupWBYR0TjlkfeVsrYdmFws/+z3mDttevpQMR xrkCS3CxV2K44b+PQjDc6af9pDhgK2bpN/teY760s5VZh7XISbA74P6gKxl6dZIAa+ gSAWgnpY5bPVclkEvWzhbzrtBmVtLQPCKCEnuhTCdA8idJwX0vIIXzGjYw4FA2uORL Hjj1ovpZui5jITsewjPYw29MBPFibgP7Z33dvksBdkCA5SNx5zv+fq4MqNXfqzlnP9 WxBEPt8vXKlcw== 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 , Greg Kroah-Hartman , Arvind Prasanna Subject: [PATCH v3 4/4] kconfig: refactor ncurses package checks for building mconf and nconf Date: Tue, 22 May 2018 16:22:21 +0900 Message-Id: <1526973741-664-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526973741-664-1-git-send-email-yamada.masahiro@socionext.com> References: <1526973741-664-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 the ncurses. Move and rename check-lxdialog.sh to mconf-cfg.sh to make it work in the same way as for qconf and gconf. This commit fixes some more weirdnesses. The nconf also needs ncurses packages. HOSTLOADLIBES_nconf is set to the libraries needed for nconf, but the cflags is not explicitly set. Actually, nconf relies on the check-lxdialog.sh for the proper cflags: HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \ -DLOCALE The code above passes the ncurses flags to all objects, even for conf, qconf, gconf. Let's pass the ncurses flags only to mconf and nconf. Currently, the presence of ncurses is not checked for nconf. Let's show a prompt like the mconf case. According to Randy's report, the shell scripts still need to carry the fallback code in case the pkg-config fails to find the ncurses packages. Signed-off-by: Masahiro Yamada --- Changes in v3: - Squash two patches into one to not lose bisectability Changes in v2: - Restore fallback detection for openSUSE etc. scripts/kconfig/Makefile | 58 ++++++++----------- scripts/kconfig/lxdialog/check-lxdialog.sh | 93 ------------------------------ scripts/kconfig/lxdialog/dialog.h | 2 +- scripts/kconfig/mconf-cfg.sh | 44 ++++++++++++++ scripts/kconfig/nconf-cfg.sh | 43 ++++++++++++++ 5 files changed, 112 insertions(+), 128 deletions(-) delete mode 100755 scripts/kconfig/lxdialog/check-lxdialog.sh create mode 100755 scripts/kconfig/mconf-cfg.sh create mode 100644 scripts/kconfig/nconf-cfg.sh -- 2.7.4 Tested-by: Randy Dunlap Acked-by: Randy Dunlap diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 8cee14b..e4ac102 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -173,59 +173,49 @@ 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 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)) +# 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) +HOSTCFLAGS_nconf.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags) +HOSTCFLAGS_nconf.gui.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags) + +$(obj)/nconf.o: $(obj)/.nconf-cfg + +# 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))) -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" ) +$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/.mconf-cfg # qconf: Used for the xconfig target based on Qt hostprogs-y += qconf 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..1c2fe90 --- /dev/null +++ b/scripts/kconfig/mconf-cfg.sh @@ -0,0 +1,44 @@ +#!/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/ncurses.h ]; then + echo cflags=\"-I/usr/include/ncurses\" + echo libs=\"-lncurses\" + 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 package." +echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev" +echo >&2 "* depending on your distribution)." +echo >&2 "*" +exit 1 diff --git a/scripts/kconfig/nconf-cfg.sh b/scripts/kconfig/nconf-cfg.sh new file mode 100644 index 0000000..4c95b4e --- /dev/null +++ b/scripts/kconfig/nconf-cfg.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 + +PKG="ncursesw menuw panelw" +PKG2="ncurses menu panel" + +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 -lmenuw -lpanelw\" + exit 0 +fi + +if [ -f /usr/include/ncurses/ncurses.h ]; then + echo cflags=\"-I/usr/include/ncurses\" + echo libs=\"-lncurses -lmenu -lpanel\" + 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 package." +echo >&2 "* Install ncurses (ncurses-devel or libncurses-dev" +echo >&2 "* depending on your distribution)." +echo >&2 "*" +exit 1