Merge "Convert external/flac to Android.bp" am: 9654326e6a am: 8ce701e7b7 am: bd3c8fd8fc  -s ours
am: 9287191a22  -s ours

Change-Id: Iafcda1c0828895c9c650a282749fe0ea06c9bca7
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..69065b2
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,11 @@
+cc_library_headers {
+    name: "libFLAC-config",
+    export_include_dirs: ["."],
+}
+
+cc_library_headers {
+    name: "libFLAC-headers",
+    export_include_dirs: ["include"],
+}
+
+subdirs = ["libFLAC"]
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 7cbcaaa..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,4 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-include $(LOCAL_PATH)/libFLAC/Android.mk
diff --git a/libFLAC/Android.bp b/libFLAC/Android.bp
new file mode 100644
index 0000000..a35627a
--- /dev/null
+++ b/libFLAC/Android.bp
@@ -0,0 +1,57 @@
+cc_library_static {
+    name: "libFLAC",
+
+    srcs: [
+        "bitmath.c",
+        "bitreader.c",
+        "bitwriter.c",
+        "cpu.c",
+        "crc.c",
+        "fixed.c",
+        "float.c",
+        "format.c",
+        "lpc.c",
+        "memory.c",
+        "md5.c",
+        "stream_decoder.c",
+        "stream_encoder.c",
+        "stream_encoder_framing.c",
+        "window.c",
+    ],
+
+    local_include_dirs: ["include"],
+    header_libs: [
+        "libFLAC-config",
+        "libFLAC-headers",
+    ],
+    export_header_lib_headers: ["libFLAC-headers"],
+
+    cflags: [
+        "-DHAVE_CONFIG_H",
+        "-DFLAC__NO_MD5",
+        "-DFLAC__INTEGER_ONLY_LIBRARY",
+
+        "-D_REENTRANT",
+        "-DPIC",
+        "-DU_COMMON_IMPLEMENTATION",
+        "-fPIC",
+
+        "-O3",
+        "-funroll-loops",
+        "-finline-functions",
+        "-Werror",
+    ],
+
+    arch: {
+        arm: {
+            instruction_set: "arm",
+        },
+    },
+
+    sanitize: {
+        cfi: true,
+        diag: {
+            cfi: true,
+        },
+    },
+}
diff --git a/libFLAC/Android.mk b/libFLAC/Android.mk
deleted file mode 100644
index e6d1b0e..0000000
--- a/libFLAC/Android.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
-	bitmath.c \
-	bitreader.c \
-	bitwriter.c \
-	cpu.c \
-	crc.c \
-	fixed.c \
-	float.c \
-	format.c \
-	lpc.c \
-	memory.c \
-	md5.c \
-	stream_decoder.c \
-	stream_encoder.c \
-	stream_encoder_framing.c \
-	window.c
-
-LOCAL_C_INCLUDES += \
-	$(LOCAL_PATH)/include \
-	$(LOCAL_PATH)/.. \
-	$(LOCAL_PATH)/../include
-
-LOCAL_CFLAGS += -DHAVE_CONFIG_H -DFLAC__NO_MD5 -DFLAC__INTEGER_ONLY_LIBRARY
-LOCAL_CFLAGS += -D_REENTRANT -DPIC -DU_COMMON_IMPLEMENTATION -fPIC
-LOCAL_CFLAGS += -O3 -funroll-loops -finline-functions
-LOCAL_CFLAGS += -Werror
-
-LOCAL_ARM_MODE := arm
-
-LOCAL_MODULE := libFLAC
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SANITIZE := cfi
-LOCAL_SANITIZE_DIAG := cfi
-
-include $(BUILD_STATIC_LIBRARY)