Add build option to libselinux to disable the X11 backend without using ANDROID_HOST. Signed-off-by: Björn Bidar <bjorn.bidar@xxxxxxxxx> --- libselinux/Makefile | 5 ++++- libselinux/src/Makefile | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libselinux/Makefile b/libselinux/Makefile index 6a43b243..cb5872b7 100644 --- a/libselinux/Makefile +++ b/libselinux/Makefile @@ -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) diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile index 190016e2..be0b6eec 100644 --- a/libselinux/src/Makefile +++ b/libselinux/src/Makefile @@ -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) -- 2.28.0