Commit b464ef58 authored by Masahiro Yamada's avatar Masahiro Yamada

kconfig: refactor GTK+ package checks for building gconf

Refactor the package checks for gconf in the same way as for qconf.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 0b669a50
...@@ -188,8 +188,6 @@ HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \ ...@@ -188,8 +188,6 @@ HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \
# Utilizes ncurses # Utilizes ncurses
# mconf: Used for the menuconfig target # mconf: Used for the menuconfig target
# Utilizes the lxdialog package # 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 # object files used by all kconfig flavours
lxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o lxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o
...@@ -199,12 +197,10 @@ conf-objs := conf.o zconf.tab.o ...@@ -199,12 +197,10 @@ conf-objs := conf.o zconf.tab.o
mconf-objs := mconf.o zconf.tab.o $(lxdialog) mconf-objs := mconf.o zconf.tab.o $(lxdialog)
nconf-objs := nconf.o zconf.tab.o nconf.gui.o nconf-objs := nconf.o zconf.tab.o nconf.gui.o
kxgettext-objs := kxgettext.o zconf.tab.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 targets += zconf.lex.c
clean-files := .tmp_gtkcheck
clean-files += gconf.glade.h clean-files += gconf.glade.h
clean-files += config.pot linux.pot clean-files += config.pot linux.pot
...@@ -224,10 +220,6 @@ HOST_EXTRACXXFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTC ...@@ -224,10 +220,6 @@ HOST_EXTRACXXFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTC
HOSTCFLAGS_zconf.lex.o := -I$(src) HOSTCFLAGS_zconf.lex.o := -I$(src)
HOSTCFLAGS_zconf.tab.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_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
HOSTLOADLIBES_nconf = $(shell \ HOSTLOADLIBES_nconf = $(shell \
...@@ -251,31 +243,14 @@ quiet_cmd_moc = MOC $@ ...@@ -251,31 +243,14 @@ quiet_cmd_moc = MOC $@
$(obj)/%.moc: $(src)/%.h $(obj)/.qconf-cfg $(obj)/%.moc: $(src)/%.h $(obj)/.qconf-cfg
$(call cmd,moc) $(call cmd,moc)
$(obj)/gconf.o: $(obj)/.tmp_gtkcheck # gconf: Used for the gconfig target based on GTK+
hostprogs-y += gconf
gconf-objs := gconf.o zconf.tab.o
ifeq ($(MAKECMDGOALS),gconfig) HOSTLOADLIBES_gconf = $(shell . $(obj)/.gconf-cfg && echo $$libs)
-include $(obj)/.tmp_gtkcheck HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags)
# GTK+ needs some extra effort, too... $(obj)/gconf.o: $(obj)/.gconf-cfg
$(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
$(obj)/zconf.tab.o: $(obj)/zconf.lex.c $(obj)/zconf.tab.o: $(obj)/zconf.lex.c
......
#!/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)\"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment