+choice
+ prompt "Target Architecture Variant"
+ depends on BR2_xtensa
+ default BR2_xtensa_fsf
+config BR2_xtensa_custom
+ bool "Custom Xtensa processor configuration"
+config BR2_xtensa_fsf
+ bool "fsf - Default configuration"
+endchoice
+
+config BR2_xtensa_custom_name
+ string "Custom Xtensa processor configuration anme"
+ depends on BR2_xtensa_custom
+ default ""
+ help
+ Name given to a custom Xtensa processor configuration.
+
+config BR2_xtensa_core_name
+ string
+ default BR2_xtensa_custom_name if BR2_xtensa_custom
+ default "" if BR2_xtensa_fsf
+
+config BR2_xtensa_overlay_dir
+ string "Overlay directory for custom configuration"
+ depends on BR2_xtensa_custom
+ default ""
+ help
+ Provide a directory path that contains the overlay files
+ for the custom configuration. The path is based on the
+ buildroot top directory.
+
config BR2_ARCH
default "xtensa" if BR2_xtensa
endef
endif
+XTENSA_CORE_NAME = $(call qstrip, $(BR2_xtensa_core_name))
+ifneq ($(XTENSA_CORE_NAME),)
+define BINUTILS_XTENSA_PRE_PATCH
+ tar xf $(BR2_xtensa_overlay_dir)/xtensa_$(XTENSA_CORE_NAME).tar \
+ -C $(@D) bfd include ld
+endef
+HOST_BINUTILS_PRE_PATCH_HOOKS += BINUTILS_XTENSA_PRE_PATCH
+endif
+
$(eval $(autotools-package))
$(eval $(host-autotools-package))
rm -rf $(GCC_DIR)
$(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOLCHAIN_DIR) $(TAR_OPTIONS) -
$(call CONFIG_UPDATE,$(@D))
+ifneq ($(call qstrip, $(BR2_xtensa_core_name)),)
+ tar xf $(BR2_xtensa_overlay_dir)/xtensa_$(call qstrip,\
+ $(BR2_xtensa_core_name)).tar -C $(@D) include
+endif
touch $@
gcc-patched: $(GCC_DIR)/.patched
$(GDB_DIR)/.unpacked: $(DL_DIR)/$(GDB_SOURCE)
mkdir -p $(GDB_DIR)
$(GDB_CAT) $(DL_DIR)/$(GDB_SOURCE) | tar -C $(GDB_DIR) $(TAR_STRIP_COMPONENTS)=1 $(TAR_OPTIONS) -
+ifneq ($(call qstrip, $(BR2_xtensa_core_name)),)
+ tar xf $(BR2_xtensa_overlay_dir)/xtensa_$(call qstrip, \
+ $(BR2_xtensa_core_name)).tar -C $(@D) bfd include gdb
+endif
ifneq ($(wildcard $(GDB_PATCH_DIR)),)
support/scripts/apply-patches.sh $(GDB_DIR) $(GDB_PATCH_DIR) \*.patch
endif