build: add default host build recipes for gnulib
authorMichael Pratt <mcpratt@pm.me>
Thu, 20 Jun 2024 04:55:58 +0000 (00:55 -0400)
committerRobert Marko <robimarko@gmail.com>
Mon, 8 Jul 2024 06:49:43 +0000 (08:49 +0200)
Add generic recipes for incorporating gnulib into a build
for simplification and readability of the individual build Makefile.

Recipes for configuring and installing are purposefully missing
since "configuring" gnulib is done with standard autoreconf
and gnulib is not a final build target meant for installing.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15853
Signed-off-by: Robert Marko <robimarko@gmail.com>
include/host-build.mk

index 7e64fc16fe30bfda567cb9ee8bc3041c9ed80f4a..8313dbfbb39e73088b24402629d5156ed1f11fe1 100644 (file)
@@ -45,6 +45,15 @@ define Host/Prepare
   $(call Host/Prepare/Default)
 endef
 
+define Host/Gnulib/Prepare
+  $(STAGING_DIR_HOST)/bin/gnulib-tool \
+       --local-dir=$(STAGING_DIR_HOST)/share/gnulib \
+       --source-base=$(PKG_GNULIB_BASE) \
+       $(PKG_GNULIB_ARGS) \
+       $(PKG_GNULIB_MODS) \
+  ;
+endef
+
 HOST_CONFIGURE_VARS = \
        CC="$(HOSTCC)" \
        CFLAGS="$(HOST_CFLAGS)" \
@@ -113,6 +122,10 @@ define Host/Compile
   $(call Host/Compile/Default,$(if $(PKG_SUBDIRS),SUBDIRS='$$$$(wildcard $(PKG_SUBDIRS))'))
 endef
 
+define Host/Gnulib/Compile
+  $(call Host/Compile/Default,SUBDIRS='$$$$(wildcard $(PKG_GNULIB_BASE))')
+endef
+
 define Host/Install/Default
   $(call Host/Compile/Default,$(if $(PKG_SUBDIRS),SUBDIRS='$$$$(wildcard $(PKG_SUBDIRS))') install)
 endef