sefcontext_compile: migrate to soong

Bug: 37512442
Test: build and boot Marlin.
Test: "bpfmt -w Android.bp"
Change-Id: Ib5a0aa8eb29457e3191bad12229a0a4171daa6b6
Merged-in: I25cd36c1233712fdffcef4aef9b53155fb724dbe
This commit is contained in:
Jeff Vander Stoep 2017-05-09 07:13:49 -07:00 committed by Jeffrey Vander Stoep
parent dfb7841f31
commit 16e4a8dab3
3 changed files with 13 additions and 40 deletions

View file

@ -1 +0,0 @@
include $(call all-named-subdir-makefiles, libselinux)

View file

@ -11,7 +11,7 @@ common_CFLAGS = [
"-D_GNU_SOURCE",
"-DNO_MEDIA_BACKEND",
"-DNO_X_BACKEND",
"-DNO_DB_BACKEND"
"-DNO_DB_BACKEND",
]
cc_defaults {
@ -119,7 +119,7 @@ cc_library {
shared_libs: ["libpackagelistparser"],
},
local_include_dirs: [ "src" ],
local_include_dirs: ["src"],
version_script: "exported.map",
@ -143,22 +143,14 @@ cc_library {
export_include_dirs: ["include"],
}
// If one attempts to comment out the sefcontext_compile target in the
// Android.mk that exists in the directory of this Android.bp file, understand
// that I encountered 2 issues. The first issue was that it could not find
// sepol/sepol.h. This is usually an issue if a dependency between the
// export_includes of another component is not coupled to this component
// properly. Looking at the Makefile from upstream, sefcontext_compile seems
// to have a dependency on libsepol. The second issue occurs when you add the
// libsepol dependency. The build system claims that their is no libsepol
// library declared anywhere. Switching sefcontext_compile to an Android.mk for
// now resolved the issue.
//################################
//cc_binary_host {
// name: "sefcontext_compile",
// defaults: ["libselinux_flags"],
// srcs: ["utils/sefcontext_compile.c"],
//
// static_libs: ["libselinux"],
// whole_static_libs: common_LIBRARIES,
//}
cc_binary_host {
name: "sefcontext_compile",
defaults: ["libselinux_flags"],
srcs: ["utils/sefcontext_compile.c"],
static_libs: [
"libselinux",
"libsepol",
],
whole_static_libs: ["libpcre2"],
}

View file

@ -1,18 +0,0 @@
LOCAL_PATH:= $(call my-dir)
# This Android.mk serves only to build sefcontext_compile. This was needed
# to work-around an issue/bug in the blueprint files. See the Android.bp
# file in the same directory for more details.
###################################
include $(CLEAR_VARS)
LOCAL_MODULE := sefcontext_compile
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS := -Wall -Werror -DUSE_PCRE2 -DNO_PERSISTENTLY_STORED_PATTERNS
LOCAL_SRC_FILES := utils/sefcontext_compile.c
LOCAL_STATIC_LIBRARIES := libsepol libselinux
LOCAL_WHOLE_STATIC_LIBRARIES := libpcre2
LOCAL_CXX_STL := none
include $(BUILD_HOST_EXECUTABLE)