Skip to contentSkip to conversation

libselinux: Add build option to disable X11 backend

PATCH In review Björn Bidar 2 participants 3 messages Oct 20, 2020 – Oct 23, 2020 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libselinux: Add build option to disable X11 backend

Add build option to libselinux to disable the X11 backend without using ANDROID_HOST.

---
 libselinux/Makefile     | 5 ++++-
 libselinux/src/Makefile | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)
libselinux/Makefile +4 -1
index 6a43b243..cb5872b7 100644
@@ -17,7 +17,10 @@ endif
 ifeq ($(DISABLE_BOOL),y)
 	DISABLE_FLAGS+= -DDISABLE_BOOL
 endif
-export DISABLE_SETRANS DISABLE_RPM DISABLE_FLAGS ANDROID_HOST
+ifeq ($(DISABLE_X11),y)
+	DISABLE_FLAGS+= -DNO_X_BACKEND
+endif
+export DISABLE_SETRANS DISABLE_RPM DISABLE_FLAGS ANDROID_HOST DISABLE_X11
 
 USE_PCRE2 ?= n
 ifeq ($(USE_PCRE2),y)
libselinux/src/Makefile +4 -0
index 190016e2..be0b6eec 100644
@@ -126,6 +126,10 @@ DISABLE_FLAGS+= -DNO_ANDROID_BACKEND
 SRCS:= $(filter-out label_backends_android.c, $(SRCS))
 endif
 
+ifeq ($(DISABLE_X11),y)
+SRCS:= $(filter-out label_x.c, $(SRCS))
+endif
+
 SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./ $(DISABLE_FLAGS)
 
 all: $(LIBA) $(LIBSO) $(LIBPC)
Signature · 1 line
2.28.0
Acked-by on v1 1/1
#1 lore raw
Quoted 42 lines · Björn Bidar

Add build option to libselinux to disable the X11 backend without using ANDROID_HOST.

---
 libselinux/Makefile     | 5 ++++-
 libselinux/src/Makefile | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)
libselinux/Makefile +4 -1
index 6a43b243..cb5872b7 100644
@@ -17,7 +17,10 @@ endif
 ifeq ($(DISABLE_BOOL),y)
        DISABLE_FLAGS+= -DDISABLE_BOOL
 endif
-export DISABLE_SETRANS DISABLE_RPM DISABLE_FLAGS ANDROID_HOST
+ifeq ($(DISABLE_X11),y)
+       DISABLE_FLAGS+= -DNO_X_BACKEND
+endif
+export DISABLE_SETRANS DISABLE_RPM DISABLE_FLAGS ANDROID_HOST DISABLE_X11
 
 USE_PCRE2 ?= n
 ifeq ($(USE_PCRE2),y)
libselinux/src/Makefile +4 -1
index 190016e2..be0b6eec 100644
@@ -126,6 +126,10 @@ DISABLE_FLAGS+= -DNO_ANDROID_BACKEND
 SRCS:= $(filter-out label_backends_android.c, $(SRCS))
 endif
 
+ifeq ($(DISABLE_X11),y)
+SRCS:= $(filter-out label_x.c, $(SRCS))
+endif
+
 SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./ $(DISABLE_FLAGS)
 
 all: $(LIBA) $(LIBSO) $(LIBPC)
--
Quoted 2 lines

2.28.0

#2 lore raw
Quoted 42 lines · William Roberts
Quoted 40 lines · Björn Bidar

Add build option to libselinux to disable the X11 backend without using ANDROID_HOST.

---
 libselinux/Makefile     | 5 ++++-
 libselinux/src/Makefile | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)
libselinux/Makefile +4 -1
index 6a43b243..cb5872b7 100644
@@ -17,7 +17,10 @@ endif
 ifeq ($(DISABLE_BOOL),y)
        DISABLE_FLAGS+= -DDISABLE_BOOL
 endif
-export DISABLE_SETRANS DISABLE_RPM DISABLE_FLAGS ANDROID_HOST
+ifeq ($(DISABLE_X11),y)
+       DISABLE_FLAGS+= -DNO_X_BACKEND
+endif
+export DISABLE_SETRANS DISABLE_RPM DISABLE_FLAGS ANDROID_HOST DISABLE_X11
 
 USE_PCRE2 ?= n
 ifeq ($(USE_PCRE2),y)
libselinux/src/Makefile +4 -0
index 190016e2..be0b6eec 100644
@@ -126,6 +126,10 @@ DISABLE_FLAGS+= -DNO_ANDROID_BACKEND
 SRCS:= $(filter-out label_backends_android.c, $(SRCS))
 endif
 
+ifeq ($(DISABLE_X11),y)
+SRCS:= $(filter-out label_x.c, $(SRCS))
+endif
+
 SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./ $(DISABLE_FLAGS)
 
Quoted 6 lines
Quoted 4 lines
libselinux/src/Makefile +0 -1
 all: $(LIBA) $(LIBSO) $(LIBPC)
--

2.28.0

I see the PR was already staged, merged:
https://github.com/SELinuxProject/selinux/pull/264