]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
tools: build coreutils for development targets
authorMichael Pratt <mcpratt@pm.me>
Thu, 3 Oct 2024 05:06:04 +0000 (01:06 -0400)
committerRobert Marko <robimarko@gmail.com>
Sat, 26 Jul 2025 12:38:08 +0000 (14:38 +0200)
Include the coreutils utilities required for macOS
and other non-GNU friendly OSs to products like the SDK.

This also allows manually building coreutils on Linux
without having to manually edit this Makefile.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
tools/Makefile

index c2b36361a42d0217812f75c8f3b12e6539da697d..81d034f993e02fa841bf46b0c9e99c714e736438 100644 (file)
@@ -97,6 +97,7 @@ $(curdir)/bison/compile := $(curdir)/flex/compile
 $(curdir)/bzip2/compile := $(curdir)/cmake/compile
 $(curdir)/cbootimage/compile += $(curdir)/automake/compile
 $(curdir)/cmake/compile += $(curdir)/libressl/compile $(curdir)/ninja/compile $(curdir)/expat/compile $(curdir)/xz/compile $(curdir)/zlib/compile $(curdir)/zstd/compile
+$(curdir)/coreutils/compile := $(curdir)/automake/compile $(curdir)/bison/compile $(curdir)/gnulib/compile
 $(curdir)/dosfstools/compile := $(curdir)/automake/compile
 $(curdir)/e2fsprogs/compile := $(curdir)/libtool/compile $(curdir)/util-linux/compile
 $(curdir)/elfutils/compile := $(curdir)/m4/compile $(curdir)/zlib/compile $(curdir)/gnulib/compile $(curdir)/libtool/compile
@@ -136,10 +137,14 @@ $(curdir)/util-linux/compile := $(curdir)/bison/compile $(curdir)/automake/compi
 $(curdir)/yafut/compile := $(curdir)/cmake/compile
 
 ifneq ($(HOST_OS),Linux)
-  $(curdir)/coreutils/compile += $(curdir)/automake/compile $(curdir)/bison/compile $(curdir)/gnulib/compile
-  $(curdir)/squashfs4/compile += $(curdir)/coreutils/compile
   tools-y += coreutils
+else
+  tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_SDK),y) += coreutils
 endif
+ifneq ($(filter coreutils,$(tools-y)),)
+  $(curdir)/squashfs4/compile += $(curdir)/coreutils/compile
+endif
+
 ifeq ($(HOST_OS),Darwin)
   tools-y += bash
 else