GNUMakefile: fix compilation on Macs

Previously, attempting to compile on Macs would bring in the SELinux
dependencies (runcon) which led to compilation errors on Macs.

Fixes #7695.
This commit is contained in:
Kevin Burke
2025-05-27 15:05:16 -07:00
parent d6de30eef1
commit 2408bd6b36
+14
View File
@@ -57,6 +57,13 @@ TOYBOX_ROOT := $(BASEDIR)/tmp
TOYBOX_VER := 0.8.12
TOYBOX_SRC := $(TOYBOX_ROOT)/toybox-$(TOYBOX_VER)
#------------------------------------------------------------------------
# Detect the host system.
# On Windows the environment already sets OS = Windows_NT.
# Otherwise let it default to the kernel name returned by uname -s
# (Linux, Darwin, FreeBSD, …).
#------------------------------------------------------------------------
OS ?= $(shell uname -s)
ifdef SELINUX_ENABLED
override SELINUX_ENABLED := 0
@@ -180,6 +187,13 @@ SELINUX_PROGS := \
chcon \
runcon
$(info Detected OS = $(OS))
# Don't build the SELinux programs on macOS (Darwin)
ifeq ($(OS),Darwin)
SELINUX_PROGS :=
endif
ifneq ($(OS),Windows_NT)
PROGS := $(PROGS) $(UNIX_PROGS)
# Build the selinux command even if not on the system