diff options
author | Alexey Neyman <stilor@att.net> | 2019-01-20 16:42:12 -0800 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2019-01-26 13:13:32 -0800 |
commit | 57e5be632d4e40314cd8d1a67973ee1e58d3dfb8 (patch) | |
tree | 21fd3ff534587fc94aef3c622e3e2a00e8eee102 /ct-ng.in | |
parent | 127c6cc64dcb5b1e47e7e5eecb0aac6f6ae0b48e (diff) | |
download | crosstool-ng-57e5be632d4e40314cd8d1a67973ee1e58d3dfb8.tar.gz crosstool-ng-57e5be632d4e40314cd8d1a67973ee1e58d3dfb8.tar.bz2 crosstool-ng-57e5be632d4e40314cd8d1a67973ee1e58d3dfb8.zip |
Basic framework for checking config file version
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'ct-ng.in')
-rw-r--r-- | ct-ng.in | 30 |
1 files changed, 17 insertions, 13 deletions
@@ -1,4 +1,5 @@ #!@MAKE@ -rf +# vim: set filetype=make : # Makefile for crosstool-NG. # Copyright 2006 Yann E. MORIN <yann.morin.1998@free.fr> @@ -32,6 +33,10 @@ endif # This is crosstool-NG version string export CT_VERSION:=@PACKAGE_VERSION@ +# Export with an empty value: this masks the version detection variable in +# user-visible configurators, and suppresses a warning from kconfig. +export CT_VCHECK= + # Download agents used by scripts.mk CT_WGET := @wget@ CT_CURL := @curl@ @@ -93,10 +98,9 @@ FORCE: # Top file of crosstool-NG configuration export KCONFIG_TOP = $(CT_LIB_DIR)/config/config.in -# We need CONF for savedefconfig in scripts/saveSample.sh -export CONF := $(CT_LIBEXEC_DIR)/conf -MCONF := $(CT_LIBEXEC_DIR)/mconf -NCONF := $(CT_LIBEXEC_DIR)/nconf +CONF := $(CT_LIBEXEC_DIR)/conf +CONF-menuconfig := $(CT_LIBEXEC_DIR)/mconf +CONF-nconfig := $(CT_LIBEXEC_DIR)/nconf # Used by conf/mconf/nconf to find the .in files # TBD needed? We do supply the defconfig name explicitly below @@ -107,26 +111,26 @@ export srctree=$(CT_LIB_DIR) check-config: @[ ! -e .config -o -f .config ] || { echo ".config is not a regular file:"; ls -dl .config; exit 1; } >&2 -menuconfig: check-config - @$(CT_ECHO) " CONF $@" - $(SILENT)$(MCONF) $(KCONFIG_TOP) - -nconfig: check-config +menuconfig nconfig: check-config @$(CT_ECHO) " CONF $@" - $(SILENT)$(NCONF) $(KCONFIG_TOP) + $(SILENT)if [ ! -f .config ] || CT_VCHECK=strict $(bash) $(CT_LIB_DIR)/scripts/version-check.sh .config; then \ + $(CONF-$@) $(KCONFIG_TOP); \ + else \ + CT_VCHECK=warning $(CONF-$@) $(KCONFIG_TOP); \ + fi oldconfig: .config check-config @$(CT_ECHO) " CONF $@" - $(SILENT)$(sed) -i -r -f $(CT_LIB_DIR)/scripts/upgrade.sed $< + @$(bash) $(CT_LIB_DIR)/scripts/version-check.sh .config $(SILENT)$(CONF) --silent$@ $(KCONFIG_TOP) savedefconfig: .config check-config @$(CT_ECHO) ' GEN $@' - $(SILENT)$(CONF) --savedefconfig=$${DEFCONFIG-defconfig} $(KCONFIG_TOP) + $(SILENT)CT_VCHECK=save $(CONF) --savedefconfig=$${DEFCONFIG-defconfig} $(KCONFIG_TOP) defconfig: check-config @$(CT_ECHO) ' CONF $@' - $(SILENT)$(CONF) --defconfig=$${DEFCONFIG-defconfig} $(KCONFIG_TOP) + $(SILENT)CT_VCHECK=save $(CONF) --defconfig=$${DEFCONFIG-defconfig} $(KCONFIG_TOP) # Always be silent, the stdout an be >.config extractconfig: |