File tree Expand file tree Collapse file tree 1 file changed +5
-17
lines changed
Expand file tree Collapse file tree 1 file changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -76,17 +76,9 @@ ifeq ($(OS),Windows_NT)
7676endif
7777LN ?= ln -sf
7878
79- ifdef SELINUX_ENABLED
80- override SELINUX_ENABLED := 0
81- # Now check if we should enable it (only on non-Windows)
82- ifneq ($(OS),Windows_NT)
83- ifeq ($(shell if [ -x /sbin/selinuxenabled ] && /sbin/selinuxenabled 2>/dev/null; then echo 0; else echo 1; fi),0)
84- override SELINUX_ENABLED := 1
85- $(info /sbin/selinuxenabled successful)
86- else
87- $(info SELINUX_ENABLED=1 but /sbin/selinuxenabled failed)
88- endif
89- endif
79+ ifeq ($(SELINUX_ENABLED ) ,1)
80+ # Allow to enable SELinux if libselinux is installed even /sbin/selinuxenabled fails
81+ SELINUX_ENABLED := $(shell pkg-config --exists libselinux && echo 1)
9082endif
9183
9284# Possible programs
@@ -217,14 +209,10 @@ HASHSUM_PROGS := \
217209
218210$(info Detected OS = $(OS))
219211
220- # Don't build the SELinux programs on macOS (Darwin) and FreeBSD
221- ifeq ($(filter $(OS ) ,Darwin FreeBSD) ,$(OS ) )
222- SELINUX_PROGS :=
223- endif
224-
225212ifneq ($(OS ) ,Windows_NT)
226213 PROGS := $(PROGS) $(UNIX_PROGS)
227- # Build the selinux command even if not on the system
214+ endif
215+ ifeq ($(SELINUX_ENABLED ) ,1)
228216 PROGS := $(PROGS) $(SELINUX_PROGS)
229217endif
230218
You can’t perform that action at this time.
0 commit comments