1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

Merge pull request #7964 from kevinburke/no-selinux-mac

GNUMakefile: fix compilation on Macs
This commit is contained in:
Sylvestre Ledru 2025-06-06 11:58:26 +02:00 committed by GitHub
commit 858db601aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View file

@ -58,6 +58,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
@ -181,6 +188,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