Kconfig library check merge
RFC 1/1 Kconfig library check merge
Hi Michal, Sam,
This is a bit a more deep patch. I was fed up of seeing the various library check done for kconfig in at least 3 places in the scripts/kconfig/ tree. In particular, the QT and GTK checks are far too messy to be in a Makefile, while the gettext is pretty trivial and has its own shell script... Moreover, `nconf' is missing explicit check for ncurses.
Anyway, here it is. It is a single huge patch _on_purpose_, merely meant to be a proof of concept. It is based on the previous serie of trivial fixes.
Most of the changes are made to rationalize the architecture. I thought in the beginning of using autoconf/automake, but that'd be overkill. A single shell script is far enough to do the job. All the checks only do a bunch of verification, and export CFLAGS/LDFLAGS for building the frontend. The script itself output a Makefile ready to be included for the top-level Makefile, with the necessary check to trigger a re-check if the requested front-end is changed.
Comments welcome!
Regards,
- Arnaud
--- scripts/kconfig/Makefile | 160 +++++++------------------ scripts/kconfig/check.sh | 184 ++++++++++++++++++++++++++-- scripts/kconfig/lxdialog/check-lxdialog.sh | 84 ------------- 3 files changed, 216 insertions(+), 212 deletions(-)
scripts/kconfig/Makefile +42 -118
@@ -141,14 +141,6 @@ help: @echo ' listnewconfig - List new options' @echo ' oldnoconfig - Same as silentoldconfig but set new symbols to n (unset)' -# 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
@@ -173,14 +165,19 @@ qconf-cxxobjs := qconf.o qconf-objs := zconf.tab.o gconf-objs := gconf.o zconf.tab.o -hostprogs-y := conf +frontends-objs := $(conf-objs) $(mconf-objs) $(nconf-objs) +frontends-objs := $(qconf-cxxobjs) $(gconf-objs) + +hostprogs-y := ifeq ($(MAKECMDGOALS),nconfig) hostprogs-y += nconf + ncurses-check := 1 endif ifeq ($(MAKECMDGOALS),menuconfig) hostprogs-y += mconf + ncurses-check := 1 endif ifeq ($(MAKECMDGOALS),update-po-config)
@@ -188,140 +185,67 @@ ifeq ($(MAKECMDGOALS),update-po-config) endif ifeq ($(MAKECMDGOALS),xconfig) - qconf-target := 1 -endif -ifeq ($(MAKECMDGOALS),gconfig) - gconf-target := 1 -endif - - -ifeq ($(qconf-target),1) hostprogs-y += qconf + qt-check := 1 endif - -ifeq ($(gconf-target),1) +ifeq ($(MAKECMDGOALS),gconfig) hostprogs-y += gconf + gtk-check := 1 endif -clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck +hostprogs-y += conf + +clean-files := qconf.moc .tmp_check clean-files += zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h clean-files += mconf qconf gconf nconf clean-files += config.pot linux.pot -# Check that we have the required ncurses stuff installed for lxdialog (menuconfig) -PHONY += $(obj)/dochecklxdialog -$(addprefix $(obj)/,$(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)) - # generated files seem to need this to find local include files HOSTCFLAGS_lex.zconf.o := -I$(src) HOSTCFLAGS_zconf.tab.o := -I$(src) -HOSTLOADLIBES_qconf = $(KC_QT_LIBS) -HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) +HOSTCFLAGS_gconf.o = -Wno-missing-prototypes + +HOSTLOADLIBES_nconf = -lmenu -lpanel -lncurses -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 +need-check += $(addprefix $(obj)/,$(frontends-objs)) +need-check += $(addprefix $(obj)/,$(lxdialog)) -HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) +$(need-check): $(obj)/.tmp_check -HOSTLOADLIBES_nconf = -lmenu -lpanel -lncurses -$(obj)/qconf.o: $(obj)/.tmp_qtcheck - -ifeq ($(qconf-target),1) -$(obj)/.tmp_qtcheck: $(src)/Makefile --include $(obj)/.tmp_qtcheck - -# QT needs some extra effort... -$(obj)/.tmp_qtcheck: - @set -e; echo " CHECK qt"; dir=""; pkg=""; \ - if ! pkg-config --exists QtCore 2> /dev/null; then \ - echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \ - pkg-config --exists qt 2> /dev/null && pkg=qt; \ - pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \ - if [ -n "$$pkg" ]; then \ - cflags="\$$(shell pkg-config $$pkg --cflags)"; \ - libs="\$$(shell pkg-config $$pkg --libs)"; \ - moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \ - dir="$$(pkg-config $$pkg --variable=prefix)"; \ - else \ - for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ - if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ - done; \ - if [ -z "$$dir" ]; then \ - echo "*"; \ - echo "* Unable to find any QT installation. Please make sure that"; \ - echo "* the QT4 or QT3 development package is correctly installed and"; \ - echo "* either qmake can be found or install pkg-config or set"; \ - echo "* the QTDIR environment variable to the correct location."; \ - echo "*"; \ - false; \ - fi; \ - libpath=$$dir/lib; lib=qt; osdir=""; \ - $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ - osdir=x$$($(HOSTCXX) -print-multi-os-directory); \ - test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \ - test -f $$libpath/libqt-mt.so && lib=qt-mt; \ - cflags="-I$$dir/include"; \ - libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \ - moc="$$dir/bin/moc"; \ - fi; \ - if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \ - echo "*"; \ - echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \ - echo "*"; \ - moc="/usr/bin/moc"; \ - fi; \ - else \ - cflags="\$$(shell pkg-config QtCore QtGui Qt3Support --cflags)"; \ - libs="\$$(shell pkg-config QtCore QtGui Qt3Support --libs)"; \ - binpath="\$$(shell pkg-config QtCore --variable=prefix)"; \ - moc="$$binpath/bin/moc"; \ - fi; \ - echo "KC_QT_CFLAGS=$$cflags" > $@; \ - echo "KC_QT_LIBS=$$libs" >> $@; \ - echo "KC_QT_MOC=$$moc" >> $@ +KC_CHECK := gettext + +ifeq ($(ncurses-check),1) +KC_CHECK += ncurses endif -$(obj)/gconf.o: $(obj)/.tmp_gtkcheck - -ifeq ($(gconf-target),1) --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 "*"; \ - echo "* GTK+ is present but version >= 2.0.0 is required."; \ - echo "*"; \ - false; \ - fi \ - else \ - echo "*"; \ - echo "* Unable to find the GTK+ installation. Please make sure that"; \ - echo "* the GTK+ 2.0 development package is correctly installed..."; \ - echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \ - echo "*"; \ - false; \ - fi +ifeq ($(qt-check),1) +KC_CHECK += qt endif +ifeq ($(gtk-check),1) +KC_CHECK += gtk +endif + +-include $(obj)/.tmp_check + +KC_CHECKED := $(foreach check,$(KC_CHECK),$(if $(KCONFIG_CHECKED_$(check)),$(check),)) +ifneq ($(KC_CHECK),$(KC_CHECKED)) +$(obj)/.tmp_check: FORCE +endif + +$(obj)/.tmp_check: $(src)/Makefile + $(Q)$(srctree)/$(src)/check.sh $(KC_CHECK) + $(obj)/zconf.tab.o: $(obj)/lex.zconf.c $(obj)/zconf.hash.c $(obj)/qconf.o: $(obj)/qconf.moc +quiet_cmd_moc = MOC $@ +cmd_moc = $(HOSTMOC) -i $< -o $@ + $(obj)/%.moc: $(src)/%.h - $(KC_QT_MOC) -i $< -o $@ + $(call cmd,moc) # Extract gconf menu items for I18N support $(obj)/gconf.glade.h: $(obj)/gconf.glade
scripts/kconfig/check.sh +174 -10
188 lines not on this page · raw message
scripts/kconfig/lxdialog/check-lxdialog.sh +0 -84
84 lines not on this page · raw message
Signature · 1 line
1.7.3.4.574.g608b.dirty
Quoted 51 lines · Arnaud Lacombe
Hi Michal, Sam,
This is a bit a more deep patch. I was fed up of seeing the various library check done for kconfig in at least 3 places in the
scripts/kconfig/tree. In particular, the QT and GTK checks are far too messy to be in aMakefile, while the gettext is pretty trivial and has its own shell script... Moreover, `nconf' is missing explicit check for ncurses.Anyway, here it is. It is a single huge patch _on_purpose_, merely meant to be a proof of concept. It is based on the previous serie of trivial fixes.
Most of the changes are made to rationalize the architecture. I thought in the beginning of using autoconf/automake, but that'd be overkill. A single shell script is far enough to do the job. All the checks only do a bunch of verification, and export CFLAGS/LDFLAGS for building the frontend. The script itself output a
Makefileready to be included for the top-levelMakefile, with the necessary check to trigger a re-check if the requested front-end is changed.Comments welcome!
Regards,
- ArnaudCc Sam Ravnborg<[email protected]>--- scripts/kconfig/Makefile | 160 +++++++------------------ scripts/kconfig/check.sh | 184 ++++++++++++++++++++++++++-- scripts/kconfig/lxdialog/check-lxdialog.sh | 84 ------------- 3 files changed, 216 insertions(+), 212 deletions(-)scripts/kconfig/Makefile +0
-8@@ -141,14 +141,6 @@ help: @echo ' listnewconfig - List new options' @echo ' oldnoconfig - Same as silentoldconfig but set new symbols to n (unset)' -# 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
scripts/kconfig/Makefile qconf-cxxobjs := qconf.o · line 169
Quoted 6 lines
scripts/kconfig/Makefile +2
-1@@ -173,14 +165,19 @@ qconf-cxxobjs := qconf.o qconf-objs := zconf.tab.o gconf-objs := gconf.o zconf.tab.o -hostprogs-y := conf +frontends-objs := $(conf-objs) $(mconf-objs) $(nconf-objs) +frontends-objs := $(qconf-cxxobjs) $(gconf-objs)
^^
Should be +=.
Quoted 35 lines
scripts/kconfig/Makefile +7
-10+ +hostprogs-y := ifeq ($(MAKECMDGOALS),nconfig) hostprogs-y += nconf + ncurses-check := 1 endif ifeq ($(MAKECMDGOALS),menuconfig) hostprogs-y += mconf + ncurses-check := 1 endif ifeq ($(MAKECMDGOALS),update-po-config)@@ -188,140 +185,67 @@ ifeq ($(MAKECMDGOALS),update-po-config) endif ifeq ($(MAKECMDGOALS),xconfig) - qconf-target := 1 -endif -ifeq ($(MAKECMDGOALS),gconfig) - gconf-target := 1 -endif - - -ifeq ($(qconf-target),1) hostprogs-y += qconf + qt-check := 1 endif - -ifeq ($(gconf-target),1) +ifeq ($(MAKECMDGOALS),gconfig) hostprogs-y += gconf + gtk-check := 1 endif
...
scripts/kconfig/Makefile ifeq ($(MAKECMDGOALS),update-po-config) · line 220
Quoted 5 lines
scripts/kconfig/Makefile +4
-0+KC_CHECK := gettext + +ifeq ($(ncurses-check),1) +KC_CHECK += ncurses endif
You could also build the KC_CHECK right when doing the $(MAKECMDGOALS) tests and drop the *-check variables. Otherwise it is a very nice cleanup, thanks a lot!
Michal
Hi,
2011/7/1 Michal Marek <[email protected]>:
Quoted 70 lines · Arnaud Lacombe
Quoted 69 lines
Hi Michal, Sam,
This is a bit a more deep patch. I was fed up of seeing the various library
check done for kconfig in at least 3 places in thescripts/kconfig/tree. In
particular, the QT and GTK checks are far too messy to be in aMakefile, while
the gettext is pretty trivial and has its own shell script... Moreover, `nconf'
is missing explicit check for ncurses.Anyway, here it is. It is a single huge patch _on_purpose_, merely meant to be a
proof of concept. It is based on the previous serie of trivial fixes.Most of the changes are made to rationalize the architecture. I thought in the
beginning of using autoconf/automake, but that'd be overkill. A single shell
script is far enough to do the job. All the checks only do a bunch of verification, and export CFLAGS/LDFLAGS for building the frontend. The script
itself output aMakefileready to be included for the top-levelMakefile, with
the necessary check to trigger a re-check if the requested front-end is changed.Comments welcome!
Regards,
- ArnaudCc Sam Ravnborg<[email protected]>---
scripts/kconfig/Makefile | 160
+++++++------------------
scripts/kconfig/check.sh | 184
++++++++++++++++++++++++++--
scripts/kconfig/lxdialog/check-lxdialog.sh | 84 -------------3 files changed, 216 insertions(+), 212 deletions(-)scripts/kconfig/Makefile +0
-0@@ -141,14 +141,6 @@ help:@echo ' listnewconfig - List new options'
@echo ' oldnoconfig - Same as silentoldconfig but set new symbols to n (unset)'scripts/kconfig/Makefile +0
-8-# 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 -#
===========================================================================
# SharedMakefilefor the various kconfig executables:
# conf: Used for defconfig, oldconfig and related targetsscripts/kconfig/Makefile +0
-0@@ -173,14 +165,19 @@ qconf-cxxobjs := qconf.oqconf-objs := zconf.tab.o
gconf-objs := gconf.o zconf.tab.o
Quoted 7 lines
scripts/kconfig/Makefile qconf-cxxobjs := qconf.o · line 169
Quoted 3 lines
scripts/kconfig/Makefile +2
-1-hostprogs-y := conf +frontends-objs := $(conf-objs) $(mconf-objs) $(nconf-objs) +frontends-objs := $(qconf-cxxobjs) $(gconf-objs)^^
Should be +=.
will fix.
Quoted 38 lines
Quoted 35 lines
scripts/kconfig/Makefile +2
-0+ +hostprogs-y :=ifeq ($(MAKECMDGOALS),nconfig)
hostprogs-y += nconf
+ ncurses-check := 1
endififeq ($(MAKECMDGOALS),menuconfig)
hostprogs-y += mconf
+ ncurses-check := 1
endififeq ($(MAKECMDGOALS),update-po-config)
scripts/kconfig/Makefile +0
-0@@ -188,140 +185,67 @@ ifeq ($(MAKECMDGOALS),update-po-config)endif
ifeq ($(MAKECMDGOALS),xconfig)
- qconf-target := 1scripts/kconfig/Makefile +0
-7-endif -ifeq ($(MAKECMDGOALS),gconfig) - gconf-target := 1 -endif - - -ifeq ($(qconf-target),1)hostprogs-y += qconf
+ qt-check := 1
endifscripts/kconfig/Makefile +1
-2- -ifeq ($(gconf-target),1) +ifeq ($(MAKECMDGOALS),gconfig)hostprogs-y += gconf
+ gtk-check := 1
endif...
Quoted 1 line
Quoted 10 lines
Quoted 5 lines
scripts/kconfig/Makefile +4
-0+KC_CHECK := gettext + +ifeq ($(ncurses-check),1) +KC_CHECK += ncursesendif
You could also build the
KC_CHECKright when doing the $(MAKECMDGOALS) tests and drop the *-check variables. Otherwise it is a very nice cleanup, thanks a lot!
yes, good point.
Btw, I intend to split the patch into more logical part. Will update soon.
- Arnaud
cover Kconfig library check merge
In reply to Arnaud LacombeHi Michal,
You'll find hereafter a splitted-down version of my previous preliminary patch. I will eventually need to complete the second commit message, it is missing the purpose of the change, which AFAIR was a failure of something.
Comments welcome!
- Arnaud
Arnaud Lacombe (7):
kconfig/Makefile: add pretty printer for moc(1) kconfig/Makefile: ensure conf' appears last in hostprogs-y' kconfig/check.sh: prepare for generic check
kconfig: move QT checks to `scripts/kconfig/check.sh'
kconfig: move GTK checks to `scripts/kconfig/check.sh'
kconfig: move ncurses checks to `scripts/kconfig/check.sh'
kconfig: add stub for nconf checks
scripts/kconfig/Makefile | 155 +++++----------------- scripts/kconfig/check.sh | 199 ++++++++++++++++++++++++++-- scripts/kconfig/lxdialog/check-lxdialog.sh | 84 ------------ 3 files changed, 223 insertions(+), 215 deletions(-)
Signature · 1 line
1.7.3.4.574.g608b.dirty
RFC 1/7 kconfig/Makefile: add pretty printer for moc(1)
--- scripts/kconfig/Makefile | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
scripts/kconfig/Makefile +4 -1
@@ -320,8 +320,11 @@ $(obj)/zconf.tab.o: $(obj)/lex.zconf.c $(obj)/zconf.hash.c $(obj)/qconf.o: $(obj)/qconf.moc +quiet_cmd_moc = MOC $@ +cmd_moc = $(KC_QT_MOC) -i $< -o $@ + $(obj)/%.moc: $(src)/%.h - $(KC_QT_MOC) -i $< -o $@ + $(call cmd,moc) # Extract gconf menu items for I18N support $(obj)/gconf.glade.h: $(obj)/gconf.glade
Signature · 1 line
1.7.3.4.574.g608b.dirty
RFC 2/7 kconfig/Makefile: ensure `conf' appears last in `hostprogs-y'
In reply to Arnaud Lacombe--- scripts/kconfig/Makefile | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
scripts/kconfig/Makefile +3 -1
@@ -173,7 +173,7 @@ qconf-cxxobjs := qconf.o qconf-objs := zconf.tab.o gconf-objs := gconf.o zconf.tab.o -hostprogs-y := conf +hostprogs-y := ifeq ($(MAKECMDGOALS),nconfig) hostprogs-y += nconf
@@ -203,6 +203,8 @@ ifeq ($(gconf-target),1) hostprogs-y += gconf endif +hostprogs-y += conf + clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck clean-files += zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h clean-files += mconf qconf gconf nconf
Signature · 1 line
1.7.3.4.574.g608b.dirty
RFC 3/7 kconfig/check.sh: prepare for generic check
In reply to Arnaud Lacombe`scripts/kconfig/check.sh' currently checks for libintl availability, make this explicit. Result gets stored in a ${obj}/.tmp_check Makefile sourced by the main Makefile dynamically.
--- scripts/kconfig/Makefile | 22 ++++++++++++++++++---- scripts/kconfig/check.sh | 44 ++++++++++++++++++++++++++++++++++---------- 2 files changed, 52 insertions(+), 14 deletions(-)
scripts/kconfig/Makefile +18 -4
@@ -173,8 +173,12 @@ qconf-cxxobjs := qconf.o qconf-objs := zconf.tab.o gconf-objs := gconf.o zconf.tab.o +frontends-objs := $(conf-objs) $(mconf-objs) $(nconf-objs) + hostprogs-y := +KC_CHECK := gettext + ifeq ($(MAKECMDGOALS),nconfig) hostprogs-y += nconf endif
@@ -205,7 +209,7 @@ endif hostprogs-y += conf -clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck +clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck .tmp_check clean-files += zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h clean-files += mconf qconf gconf nconf clean-files += config.pot linux.pot
@@ -218,9 +222,6 @@ $(obj)/dochecklxdialog: always := dochecklxdialog -# Add environment specific flags -HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS)) - # generated files seem to need this to find local include files HOSTCFLAGS_lex.zconf.o := -I$(src) HOSTCFLAGS_zconf.tab.o := -I$(src)
@@ -316,8 +317,21 @@ $(obj)/.tmp_gtkcheck: echo "*"; \ false; \ fi + +need-check := $(addprefix $(obj)/,$(frontends-objs)) + +$(need-check): $(obj)/.tmp_check + +-include $(obj)/.tmp_check + +KC_CHECKED := $(foreach check,$(KC_CHECK),$(if $(KCONFIG_CHECKED_$(check)),$(check),)) +ifneq ($(KC_CHECK),$(KC_CHECKED)) +$(obj)/.tmp_check: FORCE endif +$(obj)/.tmp_check: $(src)/Makefile + $(Q)$(srctree)/$(src)/check.sh $(KC_CHECK) + $(obj)/zconf.tab.o: $(obj)/lex.zconf.c $(obj)/zconf.hash.c $(obj)/qconf.o: $(obj)/qconf.moc
scripts/kconfig/check.sh +34 -10
48 lines not on this page · raw message
Signature · 1 line
1.7.3.4.574.g608b.dirty
RFC 4/7 kconfig: move QT checks to `scripts/kconfig/check.sh'
In reply to Arnaud Lacombe+50 lines of shell script in the main Makefile is just insane. In the same time attempts to make the script more readable.
--- scripts/kconfig/Makefile | 73 ++++----------------------------------------- scripts/kconfig/check.sh | 62 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 66 deletions(-)
scripts/kconfig/Makefile +7 -66
@@ -174,6 +174,9 @@ qconf-objs := zconf.tab.o gconf-objs := gconf.o zconf.tab.o frontends-objs := $(conf-objs) $(mconf-objs) $(nconf-objs) +frontends-objs += $(qconf-cxxobjs) + +hostprogs-y := hostprogs-y :=
@@ -192,24 +195,21 @@ ifeq ($(MAKECMDGOALS),update-po-config) endif ifeq ($(MAKECMDGOALS),xconfig) - qconf-target := 1 + hostprogs-y += qconf + KC_CHECK += qt endif ifeq ($(MAKECMDGOALS),gconfig) gconf-target := 1 endif -ifeq ($(qconf-target),1) - hostprogs-y += qconf -endif - ifeq ($(gconf-target),1) hostprogs-y += gconf endif hostprogs-y += conf -clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck .tmp_check +clean-files := qconf.moc .tmp_gtkcheck .tmp_check clean-files += zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h clean-files += mconf qconf gconf nconf clean-files += config.pot linux.pot
@@ -226,9 +226,6 @@ always := dochecklxdialog HOSTCFLAGS_lex.zconf.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
@@ -236,62 +233,6 @@ HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \ HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) HOSTLOADLIBES_nconf = -lmenu -lpanel -lncurses -$(obj)/qconf.o: $(obj)/.tmp_qtcheck - -ifeq ($(qconf-target),1) -$(obj)/.tmp_qtcheck: $(src)/Makefile --include $(obj)/.tmp_qtcheck - -# QT needs some extra effort... -$(obj)/.tmp_qtcheck: - @set -e; echo " CHECK qt"; dir=""; pkg=""; \ - if ! pkg-config --exists QtCore 2> /dev/null; then \ - echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \ - pkg-config --exists qt 2> /dev/null && pkg=qt; \ - pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \ - if [ -n "$$pkg" ]; then \ - cflags="\$$(shell pkg-config $$pkg --cflags)"; \ - libs="\$$(shell pkg-config $$pkg --libs)"; \ - moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \ - dir="$$(pkg-config $$pkg --variable=prefix)"; \ - else \ - for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ - if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ - done; \ - if [ -z "$$dir" ]; then \ - echo "*"; \ - echo "* Unable to find any QT installation. Please make sure that"; \ - echo "* the QT4 or QT3 development package is correctly installed and"; \ - echo "* either qmake can be found or install pkg-config or set"; \ - echo "* the QTDIR environment variable to the correct location."; \ - echo "*"; \ - false; \ - fi; \ - libpath=$$dir/lib; lib=qt; osdir=""; \ - $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ - osdir=x$$($(HOSTCXX) -print-multi-os-directory); \ - test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \ - test -f $$libpath/libqt-mt.so && lib=qt-mt; \ - cflags="-I$$dir/include"; \ - libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \ - moc="$$dir/bin/moc"; \ - fi; \ - if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \ - echo "*"; \ - echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \ - echo "*"; \ - moc="/usr/bin/moc"; \ - fi; \ - else \ - cflags="\$$(shell pkg-config QtCore QtGui Qt3Support --cflags)"; \ - libs="\$$(shell pkg-config QtCore QtGui Qt3Support --libs)"; \ - binpath="\$$(shell pkg-config QtCore --variable=prefix)"; \ - moc="$$binpath/bin/moc"; \ - fi; \ - echo "KC_QT_CFLAGS=$$cflags" > $@; \ - echo "KC_QT_LIBS=$$libs" >> $@; \ - echo "KC_QT_MOC=$$moc" >> $@ -endif $(obj)/gconf.o: $(obj)/.tmp_gtkcheck
@@ -337,7 +278,7 @@ $(obj)/zconf.tab.o: $(obj)/lex.zconf.c $(obj)/zconf.hash.c $(obj)/qconf.o: $(obj)/qconf.moc quiet_cmd_moc = MOC $@ -cmd_moc = $(KC_QT_MOC) -i $< -o $@ +cmd_moc = $(HOSTMOC) -i $< -o $@ $(obj)/%.moc: $(src)/%.h $(call cmd,moc)
scripts/kconfig/check.sh +62 -0
73 lines not on this page · raw message
Signature · 1 line
1.7.3.4.574.g608b.dirty
RFC 5/7 kconfig: move GTK checks to `scripts/kconfig/check.sh'
In reply to Arnaud Lacombe--- scripts/kconfig/Makefile | 39 +++++---------------------------------- scripts/kconfig/check.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 34 deletions(-)
scripts/kconfig/Makefile +5 -34
@@ -174,7 +174,7 @@ qconf-objs := zconf.tab.o gconf-objs := gconf.o zconf.tab.o frontends-objs := $(conf-objs) $(mconf-objs) $(nconf-objs) -frontends-objs += $(qconf-cxxobjs) +frontends-objs += $(qconf-cxxobjs) $(gconf-objs) hostprogs-y :=
@@ -198,18 +198,15 @@ ifeq ($(MAKECMDGOALS),xconfig) hostprogs-y += qconf KC_CHECK += qt endif -ifeq ($(MAKECMDGOALS),gconfig) - gconf-target := 1 -endif - -ifeq ($(gconf-target),1) +ifeq ($(MAKECMDGOALS),gconfig) hostprogs-y += gconf + KC_CHECK += gtk endif hostprogs-y += conf -clean-files := qconf.moc .tmp_gtkcheck .tmp_check +clean-files := qconf.moc .tmp_check clean-files += zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h clean-files += mconf qconf gconf nconf clean-files += config.pot linux.pot
@@ -226,38 +223,12 @@ always := dochecklxdialog HOSTCFLAGS_lex.zconf.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 +HOSTCFLAGS_gconf.o = -Wno-missing-prototypes HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) HOSTLOADLIBES_nconf = -lmenu -lpanel -lncurses -$(obj)/gconf.o: $(obj)/.tmp_gtkcheck - -ifeq ($(gconf-target),1) --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 "*"; \ - echo "* GTK+ is present but version >= 2.0.0 is required."; \ - echo "*"; \ - false; \ - fi \ - else \ - echo "*"; \ - echo "* Unable to find the GTK+ installation. Please make sure that"; \ - echo "* the GTK+ 2.0 development package is correctly installed..."; \ - echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \ - echo "*"; \ - false; \ - fi need-check := $(addprefix $(obj)/,$(frontends-objs))
scripts/kconfig/check.sh +29 -0
@@ -19,6 +19,34 @@ check_gettext() } } +check_gtk() +{ + local cflags="" + local libs="" + + 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 + echo "*" + echo "* GTK+ is present but version >= 2.0.0 is required." + echo "*" + false + fi + else + echo "*" + echo "* Unable to find the GTK+ installation. Please make sure that" + echo "* the GTK+ 2.0 development package is correctly installed..." + echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0." + echo "*" + false + fi + + cflags="$(pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0)" + libs="$(pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0)" + + echo "HOSTCFLAGS_gconf.o += $cflags" >> ${obj}/.tmp_check + echo "HOSTLOADLIBES_gconf += $libs" >> ${obj}/.tmp_check +} + check_qt() { local cflags=""
@@ -85,6 +113,7 @@ rm -f ${obj}/.tmp_check for arg in $*; do case $arg in gettext) ;; + gtk) ;; qt) ;; *) echo " *"
Signature · 1 line
1.7.3.4.574.g608b.dirty
RFC 6/7 kconfig: move ncurses checks to `scripts/kconfig/check.sh'
In reply to Arnaud Lacombe--- scripts/kconfig/Makefile | 24 +------- scripts/kconfig/check.sh | 50 ++++++++++++++++ scripts/kconfig/lxdialog/check-lxdialog.sh | 84 ---------------------------- 3 files changed, 54 insertions(+), 104 deletions(-)
scripts/kconfig/Makefile +4 -20
@@ -141,14 +141,6 @@ help: @echo ' listnewconfig - List new options' @echo ' oldnoconfig - Same as silentoldconfig but set new symbols to n (unset)' -# 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
@@ -184,10 +176,12 @@ KC_CHECK := gettext ifeq ($(MAKECMDGOALS),nconfig) hostprogs-y += nconf + KC_CHECK += ncurses endif ifeq ($(MAKECMDGOALS),menuconfig) hostprogs-y += mconf + KC_CHECK += ncurses endif ifeq ($(MAKECMDGOALS),update-po-config)
@@ -211,26 +205,16 @@ clean-files += zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h clean-files += mconf qconf gconf nconf clean-files += config.pot linux.pot -# Check that we have the required ncurses stuff installed for lxdialog (menuconfig) -PHONY += $(obj)/dochecklxdialog -$(addprefix $(obj)/,$(lxdialog)): $(obj)/dochecklxdialog -$(obj)/dochecklxdialog: - $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf) - -always := dochecklxdialog - # generated files seem to need this to find local include files HOSTCFLAGS_lex.zconf.o := -I$(src) HOSTCFLAGS_zconf.tab.o := -I$(src) HOSTCFLAGS_gconf.o = -Wno-missing-prototypes -HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) - -HOSTLOADLIBES_nconf = -lmenu -lpanel -lncurses - +HOSTLOADLIBES_nconf = -lmenu -lpanel need-check := $(addprefix $(obj)/,$(frontends-objs)) +need-check += $(addprefix $(obj)/,$(lxdialog)) $(need-check): $(obj)/.tmp_check
scripts/kconfig/check.sh +50 -0
62 lines not on this page · raw message
scripts/kconfig/lxdialog/check-lxdialog.sh +0 -84
84 lines not on this page · raw message
Signature · 1 line
1.7.3.4.574.g608b.dirty
RFC 7/7 kconfig: add stub for nconf checks
In reply to Arnaud Lacombe--- scripts/kconfig/Makefile | 4 +--- scripts/kconfig/check.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-)
scripts/kconfig/Makefile +1 -3
@@ -176,7 +176,7 @@ KC_CHECK := gettext ifeq ($(MAKECMDGOALS),nconfig) hostprogs-y += nconf - KC_CHECK += ncurses + KC_CHECK += menu panel ncurses endif ifeq ($(MAKECMDGOALS),menuconfig)
@@ -211,8 +211,6 @@ HOSTCFLAGS_zconf.tab.o := -I$(src) HOSTCFLAGS_gconf.o = -Wno-missing-prototypes -HOSTLOADLIBES_nconf = -lmenu -lpanel - need-check := $(addprefix $(obj)/,$(frontends-objs)) need-check += $(addprefix $(obj)/,$(lxdialog))
scripts/kconfig/check.sh +14 -0
@@ -47,6 +47,12 @@ check_gtk() echo "HOSTLOADLIBES_gconf += $libs" >> ${obj}/.tmp_check } +check_menu() +{ + + echo "HOSTLOADLIBES_nconf += -lmenu" >> ${obj}/.tmp_check +} + check_ncurses() { local cflags=""
@@ -96,6 +102,12 @@ check_ncurses() echo "HOSTLOADLIBES_nconf += $libs" >> ${obj}/.tmp_check } +check_panel() +{ + + echo "HOSTLOADLIBES_nconf += -lpanel" >> ${obj}/.tmp_check +} + check_qt() { local cflags=""
@@ -163,7 +175,9 @@ for arg in $*; do case $arg in gettext) ;; gtk) ;; + menu) ;; ncurses) ;; + panel) ;; qt) ;; *) echo " *"
Signature · 1 line
1.7.3.4.574.g608b.dirty
Re: [RFC 3/7] kconfig/check.sh: prepare for generic check
In reply to Arnaud Lacombescripts/kconfig/check.sh
Quoted 1 line · Arnaud Lacombe
scripts/kconfig/check.sh +0
-0
Can this be check_libs.sh or similar, to better indicate the function?
Re: [RFC 3/7] kconfig/check.sh: prepare for generic check
Hi,
Quoted 6 lines · On Tue, Jul 5, 2011 at 6:37 PM, <[email protected]> wrote:
scripts/kconfig/check.sh
Quoted 1 line · Arnaud Lacombe
scripts/kconfig/check.sh +0
-0Can this be
check_libs.shor similar, to better indicate the function?
Definitively. I was tempted at some point to call it configure.sh and to rename the .tmp_check to .config.mk as it generates host-specific config for the main Makefile. I finally went the path of least modification.
- Arnaud
Hi,
Quoted 19 lines · Arnaud Lacombe
Hi Michal,
You'll find hereafter a splitted-down version of my previous preliminary patch. I will eventually need to complete the second commit message, it is missing the purpose of the change, which AFAIR was a failure of something.
Comments welcome!
- Arnaud
Arnaud Lacombe (7):
kconfig/Makefile: add pretty printer for moc(1) kconfig/Makefile: ensureconf' appears last inhostprogs-y'kconfig/check.sh: prepare for generic check
kconfig: move QT checks to `scripts/kconfig/check.sh'
kconfig: move GTK checks to `scripts/kconfig/check.sh'
kconfig: move ncurses checks to `scripts/kconfig/check.sh'
kconfig: add stub for nconf checks
Quoted 5 lines
scripts/kconfig/Makefile | 155 +++++-----------------
scripts/kconfig/check.sh| 199 ++++++++++++++++++++++++++--scripts/kconfig/lxdialog/check-lxdialog.sh| 84 ------------3 files changed, 223 insertions(+), 215 deletions(-)
ping ?
- Arnaud
Quoted 22 lines · Arnaud Lacombe
Hi,
Quoted 19 lines · Arnaud Lacombe
Hi Michal,
You'll find hereafter a splitted-down version of my previous preliminary patch. I will eventually need to complete the second commit message, it is missing the purpose of the change, which AFAIR was a failure of something.
Comments welcome!
- Arnaud
Arnaud Lacombe (7):
kconfig/Makefile: add pretty printer for moc(1) kconfig/Makefile: ensureconf' appears last inhostprogs-y'kconfig/check.sh: prepare for generic check
kconfig: move QT checks to `scripts/kconfig/check.sh'
kconfig: move GTK checks to `scripts/kconfig/check.sh'
kconfig: move ncurses checks to `scripts/kconfig/check.sh'
kconfig: add stub for nconf checks
Quoted 6 lines
Quoted 5 lines
scripts/kconfig/Makefile | 155 +++++----------------- scripts/kconfig/check.sh | 199 ++++++++++++++++++++++++++-- scripts/kconfig/lxdialog/check-lxdialog.sh | 84 ------------ 3 files changed, 223 insertions(+), 215 deletions(-)ping ?
Pong. The series looks fine to me. I have no strong opinion about the name of the check script, pick whatever you like and send a series with your signoff.
Michal
Hi Michal,
Quoted 33 lines · Michal Marek
Quoted 32 lines · Arnaud Lacombe
Hi,
Quoted 28 lines · Arnaud Lacombe
Hi Michal,
You'll find hereafter a splitted-down version of my previous preliminary patch. I will eventually need to complete the second commit message, it is
missing the purpose of the change, which AFAIR was a failure of something.Comments welcome!
- Arnaud
Arnaud Lacombe (7):
kconfig/Makefile: add pretty printer for moc(1) kconfig/Makefile: ensureconf' appears last inhostprogs-y'kconfig/check.sh: prepare for generic check
kconfig: move QT checks to `scripts/kconfig/check.sh'
kconfig: move GTK checks to `scripts/kconfig/check.sh'
kconfig: move ncurses checks to `scripts/kconfig/check.sh'
kconfig: add stub for nconf checksscripts/kconfig/Makefile | 155 +++++-----------------
scripts/kconfig/check.sh| 199
++++++++++++++++++++++++++--
scripts/kconfig/lxdialog/check-lxdialog.sh | 84 ------------3 files changed, 223 insertions(+), 215 deletions(-)
Quoted 6 lines
Quoted 1 line
ping ?
Pong. The series looks fine to me. I have no strong opinion about the name of the check script, pick whatever you like and send a series with your signoff.
The following changes since commit 322a8b034003c0d46d39af85bf24fee27b902f48:
Linux 3.1-rc1 (2011-08-07 18:23:30 -0700)
are available in the git repository at:
[email protected]:lacombar/linux-2.6.git master/kconfig-generic-checks
Arnaud Lacombe (6):
kconfig/Makefile: add pretty printer for moc(1) kconfig/check.sh: prepare for generic check
kconfig: move QT checks to `scripts/kconfig/check.sh'
kconfig: move GTK checks to `scripts/kconfig/check.sh'
kconfig: move ncurses checks to `scripts/kconfig/check.sh'
kconfig: add stub for nconf checks
scripts/kconfig/Makefile | 149 ++++----------------- scripts/kconfig/check.sh | 199 ++++++++++++++++++++++++++-- scripts/kconfig/lxdialog/check-lxdialog.sh | 84 ------------ 3 files changed, 218 insertions(+), 214 deletions(-)
I dropped the `conf' ordering patch, I could not reproduce the issue I once had. Beside that, the main diff is a rebase on top of -rc1.
Thanks,
- Arnaud
Quoted 48 lines · Arnaud Lacombe
Hi Michal,
Quoted 33 lines · Michal Marek
Quoted 32 lines · Arnaud Lacombe
Hi,
Quoted 28 lines · Arnaud Lacombe
Hi Michal,
You'll find hereafter a splitted-down version of my previous preliminary patch. I will eventually need to complete the second commit message, it is
missing the purpose of the change, which AFAIR was a failure of something.Comments welcome!
- Arnaud
Arnaud Lacombe (7):
kconfig/Makefile: add pretty printer for moc(1) kconfig/Makefile: ensureconf' appears last inhostprogs-y'kconfig/check.sh: prepare for generic check
kconfig: move QT checks to `scripts/kconfig/check.sh'
kconfig: move GTK checks to `scripts/kconfig/check.sh'
kconfig: move ncurses checks to `scripts/kconfig/check.sh'
kconfig: add stub for nconf checksscripts/kconfig/Makefile | 155 +++++----------------- scripts/kconfig/check.sh | 199 ++++++++++++++++++++++++++-- scripts/kconfig/lxdialog/check-lxdialog.sh | 84 ------------ 3 files changed, 223 insertions(+), 215 deletions(-)Quoted 6 lines
Quoted 1 line
ping ?
Pong. The series looks fine to me. I have no strong opinion about the name of the check script, pick whatever you like and send a series with your signoff.
The following changes since commit
322a8b034003c0d46d39af85bf24fee27b902f48:Linux 3.1-rc1 (2011-08-07 18:23:30 -0700)
are available in the git repository at:
[email protected]:lacombar/linux-2.6.git master/kconfig-generic-checks
[...]
Quoted 1 line
kconfig: move ncurses checks to `scripts/kconfig/check.sh'
Hi,
this broke make nconfig for me, because it does no longer passes -I/usr/include/ncurses to the compiler and so menu.h is not found. Also, scripts/kconfig/lxdialog/check-lxdialog.sh was left empty by this commit.
Michal