Convert external/flac to Android.bp

See build/soong/README.md for more information.

Test: m -j checkbuild
Merged-In: Iba8bbf124fc54df04c14d2a28487738cdcaf1391
Change-Id: Iba8bbf124fc54df04c14d2a28487738cdcaf1391
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..428a599
--- /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..cfb83f8
--- /dev/null
+++ b/libFLAC/Android.bp
@@ -0,0 +1,51 @@
+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",
+        },
+    },
+
+}
diff --git a/libFLAC/Android.mk b/libFLAC/Android.mk
deleted file mode 100644
index 8c9d706..0000000
--- a/libFLAC/Android.mk
+++ /dev/null
@@ -1,37 +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
-
-include $(BUILD_STATIC_LIBRARY)