File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed
Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -69,17 +69,15 @@ TOYBOX_SRC := $(TOYBOX_ROOT)/toybox-$(TOYBOX_VER)
6969# ------------------------------------------------------------------------
7070OS ?= $(shell uname -s)
7171
72- ifdef SELINUX_ENABLED
73- override SELINUX_ENABLED := 0
74- # Now check if we should enable it (only on non-Windows)
75- ifneq ($(OS),Windows_NT)
76- ifeq ($(shell if [ -x /sbin/selinuxenabled ] && /sbin/selinuxenabled 2>/dev/null; then echo 0; else echo 1; fi),0)
77- override SELINUX_ENABLED := 1
78- $(info /sbin/selinuxenabled successful)
79- else
80- $(info SELINUX_ENABLED=1 but /sbin/selinuxenabled failed)
81- endif
82- endif
72+ # Allow to build SELinux even /sbun/selinuxenabled fails.
73+ ifundef SELINUX_ENABLED
74+ # Non Linux does not have libselinux. So SELINUX_ENABLED=0
75+ SELINUX_ENABLED := $(shell pkgconf --libs libselinux > /dev/null 2>&1; echo $$((!$$?)))
76+ ifeq ($(SELINUX_ENABLED), 1)
77+ $(info libselinux found. Enabling SELinux.)
78+ else
79+ $(info libselinux was not found.)
80+ endif
8381endif
8482
8583# Possible programs
You can’t perform that action at this time.
0 commit comments