Rename deprecated Kconfig options in a backward compatible way

This commit is contained in:
Roland Dobai
2019-03-14 09:54:04 +01:00
parent cf9f2aa466
commit 23ee93ea76
14 changed files with 314 additions and 48 deletions

View File

@@ -2,7 +2,7 @@
# and component makefiles (component_wrapper.mk)
#
PYTHON=$(call dequote,$(CONFIG_PYTHON))
PYTHON=$(call dequote,$(CONFIG_SDK_PYTHON))
# Include project config makefile, if it exists.
#
@@ -34,7 +34,7 @@ details := @true
MAKEFLAGS += --silent
endif # $(V)==1
ifdef CONFIG_MAKE_WARN_UNDEFINED_VARIABLES
ifdef CONFIG_SDK_MAKE_WARN_UNDEFINED_VARIABLES
MAKEFLAGS += --warn-undefined-variables
endif

View File

@@ -471,13 +471,13 @@ export CFLAGS CPPFLAGS CXXFLAGS ARFLAGS
# Set target compiler. Defaults to whatever the user has
# configured as prefix + ye olde gcc commands
CC := $(call dequote,$(CONFIG_TOOLPREFIX))gcc
CXX := $(call dequote,$(CONFIG_TOOLPREFIX))c++
LD := $(call dequote,$(CONFIG_TOOLPREFIX))ld
AR := $(call dequote,$(CONFIG_TOOLPREFIX))ar
OBJCOPY := $(call dequote,$(CONFIG_TOOLPREFIX))objcopy
OBJDUMP := $(call dequote,$(CONFIG_TOOLPREFIX))objdump
SIZE := $(call dequote,$(CONFIG_TOOLPREFIX))size
CC := $(call dequote,$(CONFIG_SDK_TOOLPREFIX))gcc
CXX := $(call dequote,$(CONFIG_SDK_TOOLPREFIX))c++
LD := $(call dequote,$(CONFIG_SDK_TOOLPREFIX))ld
AR := $(call dequote,$(CONFIG_SDK_TOOLPREFIX))ar
OBJCOPY := $(call dequote,$(CONFIG_SDK_TOOLPREFIX))objcopy
OBJDUMP := $(call dequote,$(CONFIG_SDK_TOOLPREFIX))objdump
SIZE := $(call dequote,$(CONFIG_SDK_TOOLPREFIX))size
export CC CXX LD AR OBJCOPY OBJDUMP SIZE
COMPILER_VERSION_STR := $(shell $(CC) -dumpversion)
@@ -665,7 +665,7 @@ print_flash_cmd: partition_table_get_info blank_ota_data
# The output normally looks as follows
# xtensa-esp32-elf-gcc (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a) 5.2.0
# The part in brackets is extracted into TOOLCHAIN_COMMIT_DESC variable
ifdef CONFIG_TOOLPREFIX
ifdef CONFIG_SDK_TOOLPREFIX
ifndef MAKE_RESTARTS
TOOLCHAIN_HEADER := $(shell $(CC) --version | head -1)
@@ -704,7 +704,7 @@ $(info WARNING: Failed to find Xtensa toolchain, may need to alter PATH or set o
endif # TOOLCHAIN_COMMIT_DESC
endif #MAKE_RESTARTS
endif #CONFIG_TOOLPREFIX
endif #CONFIG_SDK_TOOLPREFIX
#####################################################################
endif #CONFIG_IDF_TARGET

View File

@@ -42,8 +42,24 @@ $(SDKCONFIG): defconfig
endif
endif
# macro for running confgen.py
define RunConfGen
mkdir -p $(BUILD_DIR_BASE)/include/config
$(PYTHON) $(IDF_PATH)/tools/kconfig_new/confgen.py \
--kconfig $(IDF_PATH)/Kconfig \
--config $(SDKCONFIG) \
--env "COMPONENT_KCONFIGS=$(strip $(COMPONENT_KCONFIGS))" \
--env "COMPONENT_KCONFIGS_PROJBUILD=$(strip $(COMPONENT_KCONFIGS_PROJBUILD))" \
--env "IDF_CMAKE=n" \
--output config ${SDKCONFIG} \
--output makefile $(SDKCONFIG_MAKEFILE) \
--output header $(BUILD_DIR_BASE)/include/sdkconfig.h
endef
# macro for the commands to run kconfig tools conf-idf or mconf-idf.
# $1 is the name (& args) of the conf tool to run
# Note: Currently only mconf-idf is used for compatibility with the CMake build system. The header file used is also
# the same.
define RunConf
mkdir -p $(BUILD_DIR_BASE)/include/config
cd $(BUILD_DIR_BASE); KCONFIG_AUTOHEADER=$(abspath $(BUILD_DIR_BASE)/include/sdkconfig.h) \
@@ -65,7 +81,7 @@ ifndef MAKE_RESTARTS
# depend on any prerequisite that may cause a make restart as part of
# the prerequisite's own recipe.
menuconfig: $(KCONFIG_TOOL_DIR)/mconf-idf
menuconfig: $(KCONFIG_TOOL_DIR)/mconf-idf | check_python_dependencies
$(summary) MENUCONFIG
ifdef BATCH_BUILD
@echo "Can't run interactive configuration inside non-interactive build process."
@@ -74,25 +90,26 @@ ifdef BATCH_BUILD
@echo "See esp-idf documentation for more details."
@exit 1
else
$(call RunConfGen)
# RunConfGen before mconf-idf ensures that deprecated options won't be ignored (they've got renamed)
$(call RunConf,mconf-idf)
# RunConfGen after mconf-idf ensures that deprecated options are appended to $(SDKCONFIG) for backward compatibility
$(call RunConfGen)
endif
# defconfig creates a default config, based on SDKCONFIG_DEFAULTS if present
defconfig: $(KCONFIG_TOOL_DIR)/conf-idf
defconfig: | check_python_dependencies
$(summary) DEFCONFIG
ifneq ("$(wildcard $(SDKCONFIG_DEFAULTS))","")
cat $(SDKCONFIG_DEFAULTS) >> $(SDKCONFIG) # append defaults to sdkconfig, will override existing values
endif
$(call RunConf,conf-idf --olddefconfig)
$(call RunConfGen)
# if neither defconfig or menuconfig are requested, use the GENCONFIG rule to
# ensure generated config files are up to date
$(SDKCONFIG_MAKEFILE) $(BUILD_DIR_BASE)/include/sdkconfig.h: $(KCONFIG_TOOL_DIR)/conf-idf $(SDKCONFIG) $(COMPONENT_KCONFIGS) $(COMPONENT_KCONFIGS_PROJBUILD) | $(call prereq_if_explicit,defconfig) $(call prereq_if_explicit,menuconfig)
$(SDKCONFIG_MAKEFILE) $(BUILD_DIR_BASE)/include/sdkconfig.h: $(SDKCONFIG) $(COMPONENT_KCONFIGS) $(COMPONENT_KCONFIGS_PROJBUILD) | check_python_dependencies $(call prereq_if_explicit,defconfig) $(call prereq_if_explicit,menuconfig)
$(summary) GENCONFIG
ifdef BATCH_BUILD # can't prompt for new config values like on terminal
$(call RunConf,conf-idf --olddefconfig)
endif
$(call RunConf,conf-idf --silentoldconfig)
$(call RunConfGen)
touch $(SDKCONFIG_MAKEFILE) $(BUILD_DIR_BASE)/include/sdkconfig.h # ensure newer than sdkconfig
else # "$(MAKE_RESTARTS)" != ""