diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2013-11-03 23:27:46 +0100 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2013-11-06 22:21:59 +0100 |
commit | e286a674419d31cb0757dd2f8307d8b4756cf1f9 (patch) | |
tree | 6f79c58793acb4df16ac974b64ae6307cd28a0e2 | |
parent | acfc107a50344b100b9ea492678928acc047c6ae (diff) |
pull kconfig from linux-3.11
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
49 files changed, 7120 insertions, 2213 deletions
diff --git a/Makefile.in b/Makefile.in index 706c0a204..1c93b447d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -46,6 +46,7 @@ include $(top_srcdir)libc/Makefile.in conf := $(top_builddir)extra/config/conf mconf := $(top_builddir)extra/config/mconf +nconf := $(top_builddir)extra/config/nconf ifeq ($(HAVE_DOT_CONFIG),y) # If the .config changes then we have to make sure that our includes are @@ -53,9 +54,9 @@ ifeq ($(HAVE_DOT_CONFIG),y) # have uClibc_config.h as prerequisite but since we _symlink_ the headers # and do not (?) want to rely on 'make -L' we better update them right here, # on spot to save us from alot of hazzle. -$(top_builddir)include/bits/uClibc_config.h: $(conf) $(KCONFIG_CONFIG) $(top_srcdir)extra/scripts/conf-header.sh | $(top_builddir)include/bits $(top_builddir)include/config +$(top_builddir)include/bits/uClibc_config.h: $(conf) $(KCONFIG_CONFIG) $(top_srcdir)extra/scripts/conf-header.sh | $(top_builddir)include/bits @$(disp_gen) - $(Q)$< -s $(top_srcdir)extra/Configs/Config.in + $(Q)$< -s $(Kconfig) $(Q)$(top_srcdir)extra/scripts/conf-header.sh $(KCONFIG_CONFIG) > $@ $(Q)$(MAKE) headers-y @@ -217,6 +218,8 @@ $(top_builddir)extra/scripts/unifdef: $(top_srcdir)extra/scripts/unifdef.c # a "y" here means the feature is enabled and so we should *not* rm it. # if the option expands to nothing though, we can punt the headers. HEADERS_RM- := \ + config \ + generated \ internal \ cancel.h \ dl-osinfo.h \ @@ -440,48 +443,56 @@ hostutils: | pregen install_hostutils: hostutils $(Q)$(MAKE) CROSS_COMPILE="$(CROSS_COMPILE)" CC="$(CC)" HOSTCC="$(HOSTCC)" DOTHOST=.host -C utils utils_install -$(addprefix $(top_builddir),include include/bits include/sys include/config lib extra/config/lxdialog extra/locale extra/scripts $(subdirs)): +$(addprefix $(top_builddir),include include/bits include/sys include/config include/generated lib extra/config/lxdialog extra/locale extra/scripts $(subdirs)): $(do_mkdir) # configuration # --------------------------------------------------------------------------- -$(conf) $(mconf): | $(top_builddir)include/config $(top_builddir)extra/config/lxdialog +$(conf) $(mconf) $(nconf): | $(top_builddir)include/config $(top_builddir)include/generated $(top_builddir)extra/config/lxdialog $(Q)$(MAKE) -C extra/config $(@F) arch-defconfigs := $(notdir $(wildcard $(top_srcdir)extra/Configs/defconfigs/$(ARCH)/*_defconfig)) menuconfig: $(mconf) - $(Q)$< extra/Configs/Config.in - + $(Q)$< $(Kconfig) config: $(conf) - $(Q)$< extra/Configs/Config.in - -oldconfig: $(conf) - $(Q)$< -o extra/Configs/Config.in + $(Q)$< $(Kconfig) +nconfig: $(nconf) + $(Q)$< $(Kconfig) +oldaskconfig: $(conf) + $(Q)$< -a $(Kconfig) silentoldconfig: $(conf) - $(Q)$< -s extra/Configs/Config.in - -randconfig: $(conf) - $(Q)$< -r extra/Configs/Config.in - + $(Q)$< -s $(Kconfig) +oldconfig: $(conf) + $(Q)$< -o $(Kconfig) +allnoconfig: $(conf) + $(Q)$< -n $(Kconfig) allyesconfig: $(conf) - $(Q)$< -y extra/Configs/Config.in + $(Q)$< -y $(Kconfig) $(SED) -i -e "s/^DODEBUG=.*/# DODEBUG is not set/" \ -e "s/^DOASSERTS=.*/# DOASSERTS is not set/" \ -e "s/^SUPPORT_LD_DEBUG_EARLY=.*/# SUPPORT_LD_DEBUG_EARLY is not set/" \ -e "s/^SUPPORT_LD_DEBUG=.*/# SUPPORT_LD_DEBUG is not set/" \ -e "s/^UCLIBC_MJN3_ONLY=.*/# UCLIBC_MJN3_ONLY is not set/" \ $(KCONFIG_CONFIG) - $(Q)$< -o extra/Configs/Config.in - -allnoconfig: $(conf) - $(Q)$< -n extra/Configs/Config.in + $(Q)$< -o $(Kconfig) +alldefconfig: $(conf) + $(Q)$< -A $(Kconfig) +randconfig: $(conf) + $(Q)$< -r $(Kconfig) -cmd_defconfig = $(Q)$< -D extra/Configs/defconfigs/$(ARCH)/$@ extra/Configs/Config.in +cmd_defconfig = $(Q)$< -D extra/Configs/defconfigs/$(ARCH)/$@ $(Kconfig) defconfig: $(conf) ; $(cmd_defconfig) %_defconfig: $(conf) ; $(cmd_defconfig) +savedefconfig: $(conf) + $(Q)$< -S $(KCONFIG_CONFIG) $(Kconfig) +listnewconfig: $(conf) + $(Q)$< -l $(Kconfig) +olddefconfig: $(conf) + $(Q)$< -d $(Kconfig) + menuconfig-clean-y: $(Q)$(MAKE) -C extra/config CLEAN_extra/config @@ -516,10 +527,8 @@ dist release: test check: test_compile $(Q)$(MAKE) -C test \ - KCONFIG_CONFIG=$(__ABS_KCONFIG_CONFIG) \ $(if $(O),top_builddir=$(O)/) test_compile: $(LOCAL_INSTALL_PATH) $(Q)$(MAKE) -C test compile \ - KCONFIG_CONFIG=$(__ABS_KCONFIG_CONFIG) \ $(if $(O),top_builddir=$(O)/) @@ -29,9 +29,11 @@ endif clean_targets := clean realclean distclean \ objclean-y headers_clean-y CLEAN_utils -noconfig_targets := menuconfig config oldconfig silentoldconfig randconfig \ - defconfig allyesconfig allnoconfig \ - xconfig gconfig update-po-config mconf qconf gconf conf \ +noconfig_targets := menuconfig config nconfig \ + oldaskconfig silentoldconfig oldconfig allnoconfig allyesconfig \ + alldefconfig randconfig defconfig savedefconfig listnewconfig \ + olddefconfig \ + xconfig gconfig update-po-config mconf qconf gconf nconf conf \ release dist tags help @@ -70,7 +72,7 @@ STRIP_FLAGS ?= -x -R .note -R .comment # Select the compiler needed to build binaries for your development system HOSTCC = gcc -BUILD_CFLAGS = -Os -Wall +BUILD_CFLAGS = -Os #--------------------------------------------------------- # Nothing beyond this point should ever be touched by mere @@ -81,20 +83,23 @@ BUILD_CFLAGS = -Os -Wall qstrip = $(strip $(subst ",,$(1))) #")) +# kconfig stuff KCONFIG_CONFIG ?= $(top_builddir).config +KCONFIG_CONFIG := $(abspath $(KCONFIG_CONFIG)) +export KCONFIG_CONFIG +KCONFIG_AUTOCONFIG := $(dir $(KCONFIG_CONFIG))include/config/auto.conf +export KCONFIG_AUTOCONFIG +KCONFIG_TRISTATE := $(dir $(KCONFIG_CONFIG))include/config/tristate.conf +export KCONFIG_TRISTATE +srctree := $(abspath $(top_srcdir)) +export srctree +KCONFIG_AUTOHEADER := $(dir $(KCONFIG_CONFIG))include/generated/autoconf.h +export KCONFIG_AUTOHEADER +Kconfig := $(abspath $(top_srcdir)extra/Configs/Config.in) # Pull in the user's uClibc configuration ifeq ($(filter $(noconfig_targets) clean CLEAN_%,$(MAKECMDGOALS)),) -# Prevent make from searching -__ABS_KCONFIG_CONFIG ?= $(abspath $(KCONFIG_CONFIG)) --include $(__ABS_KCONFIG_CONFIG) -else -# else we have to tell config where to write .config -export KCONFIG_CONFIG -endif -ifeq ($(HAVE_DOT_CONFIG),y) -# tell config where our .config lives -export KCONFIG_CONFIG +-include $(KCONFIG_CONFIG) endif TARGET_ARCH:=$(call qstrip,$(TARGET_ARCH)) diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index c1ce9bd75..fced1df2d 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -3,12 +3,16 @@ # see extra/config/Kconfig-language.txt # -mainmenu "uClibc C Library Configuration" +mainmenu "uClibc $VERSION C Library Configuration" config DESIRED_TARGET_ARCH string option env="ARCH" +config VERSION + string + option env="VERSION" + choice prompt "Target Architecture" default TARGET_alpha if DESIRED_TARGET_ARCH = "alpha" diff --git a/extra/config/.gitignore b/extra/config/.gitignore index b49584c93..be603c4fe 100644 --- a/extra/config/.gitignore +++ b/extra/config/.gitignore @@ -2,18 +2,21 @@ # Generated files # config* -lex.*.c +*.lex.c *.tab.c *.tab.h zconf.hash.c *.moc -lkc_defs.h +gconf.glade.h +*.pot +*.mo # # configuration programs # conf mconf +nconf qconf gconf kxgettext diff --git a/extra/config/Makefile b/extra/config/Makefile index 3cde22640..c306a7eb1 100644 --- a/extra/config/Makefile +++ b/extra/config/Makefile @@ -12,7 +12,6 @@ include $(top_srcdir)Makerules # ugh top_srcdir:=$(shell cd $(top_srcdir) && pwd)/ -srctree := $(top_srcdir) src := extra/config obj := $(top_builddir)$(src) @@ -20,29 +19,23 @@ generated := $(patsubst %_shipped,%,$(wildcard *_shipped)) generated := $(addprefix $(obj)/,$(generated:.c=.o)) include $(top_srcdir)extra/config/Makefile.kconfig -PHONY += $(always) -chk-lxdialog := $(top_srcdir)$(src)/lxdialog/check-lxdialog.sh -check-lxdialog := cd $(obj) && $(CONFIG_SHELL) $(chk-lxdialog) -HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) -c '$(check-lxdialog) -ccflags') -HOST_LOADLIBES = $(shell $(CONFIG_SHELL) -c '$(check-lxdialog) -ldflags $(HOSTCC)') -HOST_EXTRACFLAGS += -DLOCALE -HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) -c '$(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS)') +HOST_EXTRACFLAGS += -DCONFIG_='""' # do not create temporary object in the readonly srctree -$(obj)/dochecklxdialog: - $(Q)cd $(obj) && $(CONFIG_SHELL) $(chk-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOST_LOADLIBES) -HOSTCFLAGS_lex.zconf.o := -I$(top_srcdir)$(src) +$(obj)/dochecklxdialog: CONFIG_SHELL:=cd $(obj) && $(CONFIG_SHELL) +HOSTCFLAGS_zconf.lex.o := -I$(top_srcdir)$(src) HOSTCFLAGS_zconf.tab.o := -I$(top_srcdir)$(src) conf-objs := $(addprefix $(obj)/,$(conf-objs)) mconf-objs := $(addprefix $(obj)/,$(mconf-objs)) +nconf-objs := $(addprefix $(obj)/,$(nconf-objs)) kxgettext-objs := $(addprefix $(obj)/,$(kxgettext-objs)) ifeq ($(findstring mconf,$(MAKECMDGOALS)),mconf) hostprogs-y += mconf endif - -#BUILD_CFLAGS-config = -W -Wall -pedantic -#BUILD_CFLAGS-lxdialog = -W -Wall -pedantic +ifeq ($(findstring nconf,$(MAKECMDGOALS)),nconf) +hostprogs-y += nconf +endif __hostprogs := $(sort $(hostprogs-y) $(hostprogs-m)) host-csingle:= $(foreach m,$(__hostprogs),$(if $($(m)-objs),,$(m))) @@ -50,16 +43,18 @@ host-cmulti := $(foreach m,$(__hostprogs),\ $(if $($(m)-cxxobjs),,$(if $($(m)-objs),$(m)))) host-cobjs := $(sort $(foreach m,$(__hostprogs),$($(m)-objs))) -conf mconf kxgettext: %: $(obj)/% -$(obj)/conf $(obj)/mconf $(obj)/kxgettext: BUILD_LDFLAGS=$(HOST_LOADLIBES) +conf mconf nconf kxgettext: %: $(obj)/% +$(obj)/conf $(obj)/mconf $(obj)/nconf $(obj)/kxgettext: BUILD_LDFLAGS=$(HOSTLOADLIBES_$(@F)) $(obj)/conf: $(conf-objs) $(hcompile.u) $(obj)/mconf: $(mconf-objs) $(hcompile.u) +$(obj)/nconf: $(nconf-objs) + $(hcompile.u) $(obj)/kxgettext: $(kxgettext-objs) $(hcompile.u) -$(host-csingle) $(host-cmulti) $(host-cobjs): BUILD_CFLAGS=$(HOST_EXTRACFLAGS) \ +$(host-csingle) $(host-cmulti) $(host-cobjs): BUILD_CFLAGS+=$(HOST_EXTRACFLAGS) \ $(HOSTCFLAGS) $(HOSTCFLAGS_$(@F)) host-cobjs.nogen := $(filter-out $(generated),$(host-cobjs)) @@ -70,19 +65,18 @@ $(host-cobjs.nogen): $(obj)/%.o: $(top_srcdir)$(src)/%.c $(host-cobjs.generated): $(obj)/%.o: $(obj)/%.c $(hcompile.o) -ifndef LKC_GENPARSER +# we use the pre-generated always $(obj)/%:: $(top_srcdir)$(src)/%_shipped @$(disp_gen) $(Q)cat $< > $@ -endif + CLEAN_extra/config menuconfig_clean: $(do_rm) $(clean-files) $(lxdialog) conf $(wildcard *.o) distclean: CLEAN_extra/config - $(Q)$(RM) -r $(lxdialog) $(conf-objs) $(mconf-objs) \ + $(Q)$(RM) -r $(lxdialog) $(conf-objs) $(mconf-objs) $(nconf-objs) \ $(kxgettext-objs) \ $(hostprogs-y) $(qconf-cxxobjs) $(qconf-objs) $(gconf-objs) \ .depend \ - $(top_builddir)include/config + $(top_builddir)include/config $(top_builddir)include/generated -FORCE: -.PHONY: FORCE clean distclean $(always) +.PHONY: clean distclean $(PHONY) diff --git a/extra/config/Makefile.kconfig b/extra/config/Makefile.kconfig index 83c20c474..844bc9da0 100644 --- a/extra/config/Makefile.kconfig +++ b/extra/config/Makefile.kconfig @@ -2,14 +2,18 @@ # Kernel configuration targets # These targets are used from top-level makefile -PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config +PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config \ + localmodconfig localyesconfig ifdef KBUILD_KCONFIG Kconfig := $(KBUILD_KCONFIG) else -Kconfig := arch/$(SRCARCH)/Kconfig +Kconfig := Kconfig endif +# We need this, in case the user has it in its environment +unexport CONFIG_ + xconfig: $(obj)/qconf $< $(Kconfig) @@ -20,91 +24,121 @@ menuconfig: $(obj)/mconf $< $(Kconfig) config: $(obj)/conf + $< --oldaskconfig $(Kconfig) + +nconfig: $(obj)/nconf $< $(Kconfig) oldconfig: $(obj)/conf - $< -o $(Kconfig) + $< --$@ $(Kconfig) silentoldconfig: $(obj)/conf - $< -s $(Kconfig) + $(Q)mkdir -p include/generated + $< --$@ $(Kconfig) + +localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf + $(Q)mkdir -p include/generated + $(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config + $(Q)if [ -f .config ]; then \ + cmp -s .tmp.config .config || \ + (mv -f .config .config.old.1; \ + mv -f .tmp.config .config; \ + $(obj)/conf --silentoldconfig $(Kconfig); \ + mv -f .config.old.1 .config.old) \ + else \ + mv -f .tmp.config .config; \ + $(obj)/conf --silentoldconfig $(Kconfig); \ + fi + $(Q)rm -f .tmp.config # Create new linux.pot file # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files -# The symlink is used to repair a deficiency in arch/um update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h - $(Q)echo " GEN config" - $(Q)xgettext --default-domain=linux \ - --add-comments --keyword=_ --keyword=N_ \ - --from-code=UTF-8 \ - --files-from=scripts/kconfig/POTFILES.in \ + $(Q)echo " GEN config.pot" + $(Q)xgettext --default-domain=linux \ + --add-comments --keyword=_ --keyword=N_ \ + --from-code=UTF-8 \ + --files-from=$(srctree)/scripts/kconfig/POTFILES.in \ + --directory=$(srctree) --directory=$(objtree) \ --output $(obj)/config.pot $(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot - $(Q)ln -fs Kconfig.i386 arch/um/Kconfig.arch - $(Q)(for i in `ls arch/*/Kconfig`; \ + $(Q)(for i in `ls $(srctree)/arch/*/Kconfig \ + $(srctree)/arch/*/um/Kconfig`; \ do \ - echo " GEN $$i"; \ + echo " GEN $$i"; \ $(obj)/kxgettext $$i \ >> $(obj)/config.pot; \ done ) + $(Q)echo " GEN linux.pot" $(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \ --output $(obj)/linux.pot - $(Q)rm -f arch/um/Kconfig.arch $(Q)rm -f $(obj)/config.pot -PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig +PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig + +allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf + $< --$@ $(Kconfig) -randconfig: $(obj)/conf - $< -r $(Kconfig) +PHONY += listnewconfig olddefconfig oldnoconfig savedefconfig defconfig -allyesconfig: $(obj)/conf - $< -y $(Kconfig) +listnewconfig olddefconfig: $(obj)/conf + $< --$@ $(Kconfig) -allnoconfig: $(obj)/conf - $< -n $(Kconfig) +# oldnoconfig is an alias of olddefconfig, because people already are dependent +# on its behavior(sets new symbols to their default value but not 'n') with the +# counter-intuitive name. +oldnoconfig: $(obj)/conf + $< --olddefconfig $(Kconfig) -allmodconfig: $(obj)/conf - $< -m $(Kconfig) +savedefconfig: $(obj)/conf + $< --$@=defconfig $(Kconfig) defconfig: $(obj)/conf ifeq ($(KBUILD_DEFCONFIG),) - $< -d $(Kconfig) + $< --defconfig $(Kconfig) else @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" - $(Q)$< -D arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) + $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) endif %_defconfig: $(obj)/conf - $(Q)$< -D arch/$(SRCARCH)/configs/$@ $(Kconfig) + $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) # Help text used by make help help: @echo ' config - Update current config utilising a line-oriented program' + @echo ' nconfig - Update current config utilising a ncurses menu based program' @echo ' menuconfig - Update current config utilising a menu based program' @echo ' xconfig - Update current config utilising a QT based front-end' @echo ' gconfig - Update current config utilising a GTK based front-end' @echo ' oldconfig - Update current config utilising a provided .config as base' - @echo ' silentoldconfig - Same as oldconfig, but quietly' - @echo ' randconfig - New config with random answer to all options' - @echo ' defconfig - New config with default answer to all options' - @echo ' allmodconfig - New config selecting modules when possible' - @echo ' allyesconfig - New config where all options are accepted with yes' + @echo ' localmodconfig - Update current config disabling modules not loaded' + @echo ' localyesconfig - Update current config converting local mods to core' + @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps' + @echo ' defconfig - New config with default from ARCH supplied defconfig' + @echo ' savedefconfig - Save current config as ./defconfig (minimal config)' @echo ' allnoconfig - New config where all options are answered with no' + @echo ' allyesconfig - New config where all options are accepted with yes' + @echo ' allmodconfig - New config selecting modules when possible' + @echo ' alldefconfig - New config with all symbols set to default' + @echo ' randconfig - New config with random answer to all options' + @echo ' listnewconfig - List new options' + @echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value' # 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) -HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) - -HOST_EXTRACFLAGS += -DLOCALE - +HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \ + -DLOCALE # =========================================================================== # Shared Makefile for the various kconfig executables: # conf: Used for defconfig, oldconfig and related targets -# mconf: Used for the mconfig target. +# nconf: Used for the nconfig target. +# 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 @@ -116,15 +150,27 @@ 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) +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 -hostprogs-y := conf qconf gconf kxgettext +ifeq ($(MAKECMDGOALS),nconfig) + hostprogs-y += nconf +endif ifeq ($(MAKECMDGOALS),menuconfig) hostprogs-y += mconf endif +ifeq ($(MAKECMDGOALS),update-po-config) + hostprogs-y += kxgettext +endif + ifeq ($(MAKECMDGOALS),xconfig) qconf-target := 1 endif @@ -134,24 +180,23 @@ endif ifeq ($(qconf-target),1) -qconf-cxxobjs := qconf.o -qconf-objs := kconfig_load.o zconf.tab.o + hostprogs-y += qconf endif ifeq ($(gconf-target),1) -gconf-objs := gconf.o kconfig_load.o zconf.tab.o + hostprogs-y += gconf endif -clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \ - .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h -clean-files += mconf qconf gconf +clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck +clean-files += zconf.tab.c zconf.lex.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) $(HOST_LOADLIBES) +$(obj)/dochecklxdialog: + $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf) always := dochecklxdialog @@ -159,16 +204,24 @@ always := dochecklxdialog 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.lex.o := -I$(src) HOSTCFLAGS_zconf.tab.o := -I$(src) -HOSTLOADLIBES_qconf = $(KC_QT_LIBS) -ldl -HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK +LEX_PREFIX_zconf := zconf +YACC_PREFIX_zconf := zconf + +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` \ - -D LKC_DIRECT_LINK + -Wno-missing-prototypes +HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) + +HOSTLOADLIBES_nconf = $(shell \ + pkg-config --libs menu panel ncurses 2>/dev/null \ + || echo "-lmenu -lpanel -lncurses" ) $(obj)/qconf.o: $(obj)/.tmp_qtcheck ifeq ($(qconf-target),1) @@ -178,40 +231,48 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile # QT needs some extra effort... $(obj)/.tmp_qtcheck: @set -e; echo " CHECK qt"; dir=""; pkg=""; \ - 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)"; \ + 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 >&2 "*"; \ + echo >&2 "* Unable to find any QT installation. Please make sure that"; \ + echo >&2 "* the QT4 or QT3 development package is correctly installed and"; \ + echo >&2 "* either qmake can be found or install pkg-config or set"; \ + echo >&2 "* the QTDIR environment variable to the correct location."; \ + echo >&2 "*"; \ + false; \ + fi; \ + libpath=$$dir/lib; lib=qt; osdir=""; \ + $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ + osdir=x$$($(HOSTCXX) -print |