Add gnustl+rtti version of library

Previously, code linked against gnustl could not
use this library, due to conflicts with stlport used
here. I've added gnustl version, called libregex-re2-gnustl-rtti

Bug: 7484202
Change-Id: I951a8d85bb46eefb6da523806632107064b7f12c
diff --git a/Android.mk b/Android.mk
index f29ae89..0307ce3 100644
--- a/Android.mk
+++ b/Android.mk
@@ -6,7 +6,6 @@
 #
 
 LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
 
 regexp_re2_files := \
 	util/arena.cc \
@@ -36,6 +35,9 @@
 	re2/unicode_casefold.cc \
 	re2/unicode_groups.cc
 
+# Stlport version
+# =======================================================
+include $(CLEAR_VARS)
 LOCAL_MODULE := libregex-re2
 LOCAL_MODULE_TAGS := optional
 LOCAL_CPP_EXTENSION := .cc
@@ -44,3 +46,18 @@
 LOCAL_SRC_FILES := $(regexp_re2_files)
 include external/stlport/libstlport.mk
 include $(BUILD_STATIC_LIBRARY)
+
+# Gnustl+rtti version
+# =======================================================
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libregex-re2-gnustl-rtti
+LOCAL_MODULE_TAGS := optional
+LOCAL_CPP_EXTENSION := .cc
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/re2
+LOCAL_SRC_FILES := $(regexp_re2_files)
+LOCAL_CFLAGS += -frtti
+LOCAL_NDK_STL_VARIANT := gnustl_static
+LOCAL_SDK_VERSION := 14
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/util/util.h b/util/util.h
index 5948ef6..bf897ae 100644
--- a/util/util.h
+++ b/util/util.h
@@ -42,7 +42,12 @@
 
 #if defined(ANDROID)
 
-#include <unordered_set>
+#if defined(_STLPORT_VERSION)
+#include <unordered_set>      // using stlport
+#else
+#include <tr1/unordered_set>  // using gnustl
+#endif
+
 using std::tr1::unordered_set;
 
 #elif defined(__GNUC__) && !defined(USE_CXX0X)