diff mbox series

libselinux: Add build option to disable X11 backend

Message ID 5825612.FvA7u9GNv5@odin
State Accepted
Headers show
Series libselinux: Add build option to disable X11 backend | expand

Commit Message

Björn Bidar Oct. 20, 2020, 12:27 p.m. UTC
Add build option to libselinux to disable the X11 backend without using 
ANDROID_HOST.

Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
---
 libselinux/Makefile     | 5 ++++-
 libselinux/src/Makefile | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

Comments

William Roberts Oct. 23, 2020, 2:48 p.m. UTC | #1
On Tue, Oct 20, 2020 at 7:28 AM Björn Bidar <bjorn.bidar@jolla.com> wrote:
>
> Add build option to libselinux to disable the X11 backend without using
> ANDROID_HOST.
>
> Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
> ---
>  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
>

Acked-by: William Roberts <william.c.roberts@intel.com>
William Roberts Oct. 23, 2020, 2:50 p.m. UTC | #2
On Fri, Oct 23, 2020 at 9:48 AM William Roberts
<bill.c.roberts@gmail.com> wrote:
>
> On Tue, Oct 20, 2020 at 7:28 AM Björn Bidar <bjorn.bidar@jolla.com> wrote:
> >
> > Add build option to libselinux to disable the X11 backend without using
> > ANDROID_HOST.
> >
> > Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
> > ---
> >  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
> >
>
> Acked-by: William Roberts <william.c.roberts@intel.com>

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

Patch

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)