From 16e4a8dab34217517355385c4d11a329a1eaab87 Mon Sep 17 00:00:00 2001 From: Jeff Vander Stoep Date: Tue, 9 May 2017 07:13:49 -0700 Subject: [PATCH] sefcontext_compile: migrate to soong Bug: 37512442 Test: build and boot Marlin. Test: "bpfmt -w Android.bp" Change-Id: Ib5a0aa8eb29457e3191bad12229a0a4171daa6b6 Merged-in: I25cd36c1233712fdffcef4aef9b53155fb724dbe --- Android.mk | 1 - libselinux/Android.bp | 34 +++++++++++++--------------------- libselinux/Android.mk | 18 ------------------ 3 files changed, 13 insertions(+), 40 deletions(-) delete mode 100644 Android.mk delete mode 100644 libselinux/Android.mk diff --git a/Android.mk b/Android.mk deleted file mode 100644 index 3a4b6a4f..00000000 --- a/Android.mk +++ /dev/null @@ -1 +0,0 @@ -include $(call all-named-subdir-makefiles, libselinux) diff --git a/libselinux/Android.bp b/libselinux/Android.bp index 94395cbd..38b26944 100644 --- a/libselinux/Android.bp +++ b/libselinux/Android.bp @@ -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"], +} diff --git a/libselinux/Android.mk b/libselinux/Android.mk deleted file mode 100644 index 92697f4c..00000000 --- a/libselinux/Android.mk +++ /dev/null @@ -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)