libselinux: add ANDROID_HOST=y build option
To build the selinux host configuration, specify ANDROID_HOST=y on the Make command line. eg) make ANDROID_HOST=y
This commit is contained in:
parent
c9fb010a41
commit
b5dd7959d8
3 changed files with 17 additions and 1 deletions
|
@ -2,13 +2,17 @@ SUBDIRS = src include utils man
|
|||
|
||||
DISABLE_SETRANS ?= n
|
||||
DISABLE_RPM ?= y
|
||||
ANDROID_HOST ?= n
|
||||
ifeq ($(ANDROID_HOST),y)
|
||||
override DISABLE_SETRANS=y
|
||||
endif
|
||||
ifeq ($(DISABLE_RPM),y)
|
||||
DISABLE_FLAGS+= -DDISABLE_RPM
|
||||
endif
|
||||
ifeq ($(DISABLE_SETRANS),y)
|
||||
DISABLE_FLAGS+= -DDISABLE_SETRANS
|
||||
endif
|
||||
export DISABLE_SETRANS DISABLE_RPM DISABLE_FLAGS
|
||||
export DISABLE_SETRANS DISABLE_RPM DISABLE_FLAGS ANDROID_HOST
|
||||
|
||||
USE_PCRE2 ?= n
|
||||
ifeq ($(USE_PCRE2),y)
|
||||
|
|
|
@ -81,6 +81,14 @@ ifneq (,$(filter i386,$(ARCH)))
|
|||
TLSFLAGS += -mno-tls-direct-seg-refs
|
||||
endif
|
||||
|
||||
ifeq ($(ANDROID_HOST),y)
|
||||
DISABLE_FLAGS+= -DNO_MEDIA_BACKEND -DNO_DB_BACKEND -DNO_X_BACKEND \
|
||||
-DBUILD_HOST
|
||||
SRCS= callbacks.c freecon.c label.c label_file.c \
|
||||
label_android_property.c regex.c label_support.c \
|
||||
matchpathcon.c setrans_client.c sha1.c
|
||||
endif
|
||||
|
||||
SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./ $(DISABLE_FLAGS)
|
||||
|
||||
SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./ $(DISABLE_FLAGS)
|
||||
|
|
|
@ -28,7 +28,11 @@ override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE $(DISABLE_FLAGS) $
|
|||
LDLIBS += -L../src -lselinux -L$(LIBDIR)
|
||||
PCRE_LDFLAGS ?= -lpcre
|
||||
|
||||
ifeq ($(ANDROID_HOST),y)
|
||||
TARGETS=sefcontext_compile
|
||||
else
|
||||
TARGETS=$(patsubst %.c,%,$(wildcard *.c))
|
||||
endif
|
||||
|
||||
sefcontext_compile: LDLIBS += $(PCRE_LDFLAGS) ../src/libselinux.a -lsepol
|
||||
|
||||
|
|
Loading…
Reference in a new issue