Merge \\"Convert pcre from Android.mk to Android.bp\\" am: a6a950ff7d
am: 7493756f8b
Change-Id: I0190b33ceb7ec9dca4d4da3232122fb1b7746d33
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..088b1c5
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,56 @@
+
+cc_defaults {
+ name: "pcre_defaults",
+ cflags: [
+ "-DHAVE_CONFIG_H",
+ "-Wno-self-assign",
+ "-Wno-unused-parameter",
+ ],
+ local_include_dirs: ["dist"],
+ export_include_dirs: ["."],
+}
+
+// === libpcre targets ===
+
+cc_library {
+ name: "libpcre",
+ defaults: ["pcre_defaults"],
+ host_supported: true,
+ srcs: [
+ "pcre_chartables.c",
+ "dist/pcre_byte_order.c",
+ "dist/pcre_compile.c",
+ "dist/pcre_config.c",
+ "dist/pcre_dfa_exec.c",
+ "dist/pcre_exec.c",
+ "dist/pcre_fullinfo.c",
+ "dist/pcre_get.c",
+ "dist/pcre_globals.c",
+ "dist/pcre_jit_compile.c",
+ "dist/pcre_maketables.c",
+ "dist/pcre_newline.c",
+ "dist/pcre_ord2utf8.c",
+ "dist/pcre_refcount.c",
+ "dist/pcre_string_utils.c",
+ "dist/pcre_study.c",
+ "dist/pcre_tables.c",
+ "dist/pcre_ucd.c",
+ "dist/pcre_valid_utf8.c",
+ "dist/pcre_version.c",
+ "dist/pcre_xclass.c",
+ ],
+}
+
+// === libpcrecpp targets ===
+
+cc_library_shared {
+ name: "libpcrecpp",
+ defaults: ["pcre_defaults"],
+
+ srcs: [
+ "dist/pcrecpp.cc",
+ "dist/pcre_scanner.cc",
+ "dist/pcre_stringpiece.cc",
+ ],
+ shared_libs: ["libpcre"],
+}
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 931f6d8..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,72 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-libpcre_src_files := \
- pcre_chartables.c \
- dist/pcre_byte_order.c \
- dist/pcre_compile.c \
- dist/pcre_config.c \
- dist/pcre_dfa_exec.c \
- dist/pcre_exec.c \
- dist/pcre_fullinfo.c \
- dist/pcre_get.c \
- dist/pcre_globals.c \
- dist/pcre_jit_compile.c \
- dist/pcre_maketables.c \
- dist/pcre_newline.c \
- dist/pcre_ord2utf8.c \
- dist/pcre_refcount.c \
- dist/pcre_string_utils.c \
- dist/pcre_study.c \
- dist/pcre_tables.c \
- dist/pcre_ucd.c \
- dist/pcre_valid_utf8.c \
- dist/pcre_version.c \
- dist/pcre_xclass.c
-
-libpcrecpp_src_files := \
- dist/pcrecpp.cc \
- dist/pcre_scanner.cc \
- dist/pcre_stringpiece.cc
-
-libpcre_cflags := \
- -DHAVE_CONFIG_H \
- -Wno-self-assign \
- -Wno-unused-parameter \
-
-# === libpcre targets ===
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libpcre
-LOCAL_CFLAGS += $(libpcre_cflags)
-LOCAL_C_INCLUDES += $(LOCAL_PATH)/dist
-LOCAL_SRC_FILES := $(libpcre_src_files)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-include $(BUILD_HOST_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libpcre
-LOCAL_CFLAGS += $(libpcre_cflags)
-LOCAL_C_INCLUDES += $(LOCAL_PATH)/dist
-LOCAL_SRC_FILES := $(libpcre_src_files)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libpcre
-LOCAL_CFLAGS += $(libpcre_cflags)
-LOCAL_C_INCLUDES += $(LOCAL_PATH)/dist
-LOCAL_SRC_FILES := $(libpcre_src_files)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-include $(BUILD_SHARED_LIBRARY)
-
-# === libpcrecpp targets ===
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libpcrecpp
-LOCAL_CFLAGS += $(libpcre_cflags)
-LOCAL_C_INCLUDES += $(LOCAL_PATH)/dist
-LOCAL_CPP_EXTENSION := .cc
-LOCAL_SRC_FILES := $(libpcrecpp_src_files)
-LOCAL_SHARED_LIBRARIES := libpcre
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-include $(BUILD_SHARED_LIBRARY)