tools/elfutils: organize gnulib import build stage
authorMichael Pratt <mcpratt@pm.me>
Fri, 5 Apr 2024 08:42:14 +0000 (04:42 -0400)
committerRobert Marko <robimarko@gmail.com>
Thu, 25 Apr 2024 19:33:51 +0000 (21:33 +0200)
Organize the Makefile lines involved in gnulib importing and its
workarounds. It improves readability and keeps git history organized.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
tools/elfutils/Makefile

index f13bd8c944b84e11c9d1a1a7a826f92db4046924..c7d94d2a4762e15f2d99d4d5fa13e3ea71ab5756 100644 (file)
@@ -29,6 +29,24 @@ PKG_SUBDIRS := \
        libdwfl \
        libdw
 
+PKG_GNULIB_BASE:=libgnu
+
+PKG_GNULIB_ARGS = \
+       --dir=$(HOST_BUILD_DIR) \
+       --local-dir=$(STAGING_DIR_HOST)/share/gnulib \
+       --source-base=$(PKG_GNULIB_BASE) \
+       --libtool \
+       --import
+
+PKG_GNULIB_MODS = \
+       argp \
+       dirname \
+       fts \
+       obstack \
+       progname \
+       strchrnul \
+       tsearch
+
 include $(INCLUDE_DIR)/host-build.mk
 
 ifeq ($(HOST_OS),Darwin)
@@ -55,7 +73,7 @@ endif
 
 Hooks/HostConfigure/Pre := Host/Gnulib $(Hooks/HostConfigure/Pre)
 define Host/Gnulib
-       cd $(HOST_BUILD_DIR); $(STAGING_DIR_HOST)/bin/gnulib-tool --libtool --source-base=libgnu --import argp dirname fts obstack progname strchrnul tsearch;
+       $(STAGING_DIR_HOST)/bin/gnulib-tool $(PKG_GNULIB_ARGS) $(PKG_GNULIB_MODS);
        ln -sf ../lib/eu-config.h $(HOST_BUILD_DIR)/libgnu/;
 endef