Revert "Revert "refactor: move common parts of libselinux builds into defaults""

This reverts commit 72103a4c62.

Bug: 37343404
Bug: 37919668
Test: Build and boot

Change-Id: I375a4a2926326a5f733f4a49348e1ffae086ffd6
Signed-off-by: Sandeep Patil <sspatil@google.com>
This commit is contained in:
Sandeep Patil 2017-05-03 07:04:18 -07:00
parent 72103a4c62
commit 51428ba055
2 changed files with 34 additions and 96 deletions

View file

@ -1,4 +1,3 @@
common_LIBRARIES = ["libpcre2"]
common_CFLAGS = [
"-DUSE_PCRE2",
@ -15,24 +14,10 @@ common_CFLAGS = [
]
cc_defaults {
name: "libselinux_flags",
name: "libselinux_defaults",
cflags: common_CFLAGS,
target: {
host: {
cflags: [
"-DBUILD_HOST",
],
},
},
}
cc_library {
name: "libselinux_vendor",
defaults: ["libselinux_flags"],
vendor: true,
srcs: [
"src/booleans.c",
"src/callbacks.c",
@ -48,6 +33,12 @@ cc_library {
],
target: {
host: {
cflags: [
"-DBUILD_HOST",
],
},
android: {
srcs: [
"src/android/android.c",
@ -90,45 +81,44 @@ cc_library {
local_include_dirs: [ "src" ],
version_script: "exported_vendor.map",
// 1003 corresponds to auditd, from system/core/logd/event.logtags
cflags: [
"-DAUDITD_LOG_TAG=1003",
],
},
},
static: {
whole_static_libs: common_LIBRARIES,
},
shared: {
shared_libs: common_LIBRARIES,
// mapping.c has redundant check of array p_in->perms.
clang_cflags: ["-Wno-pointer-bool-conversion"],
}
},
local_include_dirs: ["include"],
export_include_dirs: ["include"],
static: {
whole_static_libs: ["libpcre2"],
},
shared: {
shared_libs: ["libpcre2"],
},
}
cc_library {
name: "libselinux_vendor",
defaults: ["libselinux_defaults"],
vendor: true,
target: {
android: {
version_script: "exported_vendor.map",
},
},
}
cc_library {
name: "libselinux",
defaults: ["libselinux_flags"],
defaults: ["libselinux_defaults"],
host_supported: true,
srcs: [
"src/booleans.c",
"src/callbacks.c",
"src/freecon.c",
"src/label_backends_android.c",
"src/label.c",
"src/label_file.c",
"src/label_support.c",
"src/matchpathcon.c",
"src/regex.c",
"src/setrans_client.c",
"src/sha1.c",
],
target: {
linux: {
srcs: [
@ -155,75 +145,23 @@ cc_library {
linux_bionic: {
enabled: true,
},
android: {
srcs: [
"src/android/android.c",
"src/android/android_seapp.c",
"src/avc.c",
"src/avc_internal.c",
"src/avc_sidtab.c",
"src/canonicalize_context.c",
"src/checkAccess.c",
"src/check_context.c",
"src/compute_av.c",
"src/compute_create.c",
"src/compute_member.c",
"src/context.c",
"src/deny_unknown.c",
"src/disable.c",
"src/enabled.c",
"src/fgetfilecon.c",
"src/fsetfilecon.c",
"src/getenforce.c",
"src/getfilecon.c",
"src/get_initial_context.c",
"src/getpeercon.c",
"src/init.c",
"src/lgetfilecon.c",
"src/load_policy.c",
"src/lsetfilecon.c",
"src/mapping.c",
"src/policyvers.c",
"src/procattr.c",
"src/sestatus.c",
"src/setenforce.c",
"src/setfilecon.c",
"src/stringrep.c",
"src/android/android_platform.c",
],
shared_libs: [
"libcrypto",
"liblog",
],
static: {
whole_static_libs: ["libpackagelistparser"],
},
shared: {
shared_libs: ["libpackagelistparser"],
},
local_include_dirs: [ "src" ],
version_script: "exported.map",
// 1003 corresponds to auditd, from system/core/logd/event.logtags
cflags: [
"-DAUDITD_LOG_TAG=1003",
],
// mapping.c has redundant check of array p_in->perms.
clang_cflags: ["-Wno-pointer-bool-conversion"],
},
},
static: {
whole_static_libs: common_LIBRARIES,
},
shared: {
shared_libs: common_LIBRARIES,
},
local_include_dirs: ["include"],
export_include_dirs: ["include"],
}
// If one attempts to comment out the sefcontext_compile target in the
@ -239,7 +177,7 @@ cc_library {
//################################
//cc_binary_host {
// name: "sefcontext_compile",
// defaults: ["libselinux_flags"],
// cflags: common_CFLAGS,
// srcs: ["utils/sefcontext_compile.c"],
//
// static_libs: ["libselinux"],