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)\"