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