package/uboot-tools: fix host build without FIT support

Commit [1] "package/uboot-tools: fix host FIT signature support"
slightly changed the logic in which the file
$(@D)/include/generated/autoconf.h is created.

When there is no Kconfig sub-option selected, the file is no longer
created and the build fails with error:

    include/linux/kconfig.h:4:10: fatal error: generated/autoconf.h: No such file or directory

The issue can be reproduced with the with the simple commands:

    cat >.config <<EOF
    BR2_aarch64=y
    BR2_TOOLCHAIN_EXTERNAL=y
    BR2_PACKAGE_HOST_UBOOT_TOOLS=y
    EOF
    make olddefconfig
    make host-uboot-tools

This commit fixes the issue by simply adding a touch of the file
at the beginning to make sure it will always exist.

[1] 928cc5dc5c

Cc: James Hilliard <james.hilliard1@gmail.com>
Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Tested-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Julien Olivain
2026-07-29 22:25:20 +02:00
parent 051eff247f
commit 9f17ac02b8

View File

@@ -124,6 +124,7 @@ define HOST_UBOOT_TOOLS_CONFIGURE_CMDS
echo "#include <linux/kconfig.h>" > $(@D)/include/config.h echo "#include <linux/kconfig.h>" > $(@D)/include/config.h
touch $(@D)/include/config/auto.conf touch $(@D)/include/config/auto.conf
mkdir -p $(@D)/include/generated mkdir -p $(@D)/include/generated
touch $(@D)/include/generated/autoconf.h
$(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),$(UBOOT_TOOLS_ENABLE_HASH_ALGOS)) $(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),$(UBOOT_TOOLS_ENABLE_HASH_ALGOS))
$(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),echo '#define CONFIG_TOOLS_FIT_PRINT 1' >> $(@D)/include/generated/autoconf.h) $(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),echo '#define CONFIG_TOOLS_FIT_PRINT 1' >> $(@D)/include/generated/autoconf.h)
$(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),echo '#define CONFIG_TOOLS_IMAGE_PRE_LOAD 1' >> $(@D)/include/generated/autoconf.h) $(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),echo '#define CONFIG_TOOLS_IMAGE_PRE_LOAD 1' >> $(@D)/include/generated/autoconf.h)