tools: gnulib: fix broken install of .m4 files
Some checks failed
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled

Makefile foreach works only on parsing the Makefile and in this specific
case only works if the package is already extracted and file actually
exist.

On scenario where the package still has to be built, foreach doesn't
find any file causing Host/Install to not install any .m4 file.

To handle this, use a shell for loop that scan files in the
Host/install.

Fixes: c820f097e0 ("tools: gnulib: install .m4 file with gl_ prefix")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
Christian Marangi 2025-12-04 16:32:03 +01:00
parent 9c6dbb0e3d
commit 78a8cfb577
No known key found for this signature in database
GPG key ID: AC001D09ADBFEAD7

View file

@ -20,8 +20,10 @@ endef
define Host/Install define Host/Install
$(call Host/Uninstall) $(call Host/Uninstall)
$(INSTALL_DIR) $(1)/share/aclocal $(INSTALL_DIR) $(1)/share/aclocal
$(foreach m4,$(notdir $(wildcard $(HOST_BUILD_DIR)/m4/*.m4)), for m4 in $(HOST_BUILD_DIR)/m4/*.m4; do \
$(INSTALL_DATA) $(HOST_BUILD_DIR)/m4/$(m4) $(1)/share/aclocal/gl_$(m4)) $(INSTALL_DATA) $(HOST_BUILD_DIR)/m4/$$$$(basename $$$$m4) \
$(1)/share/aclocal/gl_$$$$(basename $$$$m4); \
done
$(CP) $(HOST_BUILD_DIR)/ $(1)/share/gnulib/ $(CP) $(HOST_BUILD_DIR)/ $(1)/share/gnulib/
ln -sf ../share/gnulib/gnulib-tool $(STAGING_DIR_HOST)/bin/gnulib-tool ln -sf ../share/gnulib/gnulib-tool $(STAGING_DIR_HOST)/bin/gnulib-tool
endef endef