Add libprotobuf-cpp-2.3.0-lite

Added android/config.h which will be used to configure
android builds of libraries. Currently I've undef HAVE_HASH_MAP
and HAVE_HASH_SET as the versions in stlport generated compile
errors.

Updated .gitignore to be more selective on what it ignores so
android/config.h wouldn't be ignored.

Change-Id: I53f3636121db2c6017491a37998b816aaf0cab5d
diff --git a/.gitignore b/.gitignore
index d1a56d5..f6d12c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,16 +6,18 @@
 *~
 *.lo
 *.la
-Makefile
-config.h
-src/Makefile
-/stamp.h1
 .deps
-config.log
-config.status
+/stamp-h1
+/Makefile
+/src/Makefile
+/config.log
+/config.status
+/config.h
 gtest/Makefile
 gtest/build-aux/config.h
 gtest/build-aux/stamp-h1
+gtest/config.log
+gtest/config.status
 gtest/libtool
 gtest/scripts/gtest-config
 gtest/lib
@@ -24,7 +26,6 @@
 protobuf-lite.pc
 libtool
 autom4te.cache/
-/stamp-h1
 core
 src/google/protobuf/unittest*pb*
 src/google/protobuf/compiler/cpp/cpp*pb*
@@ -41,4 +42,5 @@
 src/testzip.list
 src/testzip.proto
 src/testzip.zip
+vsprojects/config.h
 java/target/
diff --git a/Android.mk b/Android.mk
index fb2d964..ab31cc8 100644
--- a/Android.mk
+++ b/Android.mk
@@ -15,10 +15,63 @@
 #
 
 LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
 
-LOCAL_SRC_FILES := $(call all-java-files-under, java/src/main/java/com/google/protobuf/micro)
+# Java micro library
+# =======================================================
+include $(CLEAR_VARS)
 
 LOCAL_MODULE := com.google.protobuf.micro
 
+LOCAL_SRC_FILES := $(call all-java-files-under, java/src/main/java/com/google/protobuf/micro)
+
 include $(BUILD_STATIC_JAVA_LIBRARY)
+
+# C++ lite library
+# =======================================================
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libprotobuf-cpp-2.3.0-lite
+
+LOCAL_CPP_EXTENSION := .cc
+
+LOCAL_SRC_FILES := \
+  src/google/protobuf/stubs/common.cc                              \
+  src/google/protobuf/stubs/once.cc                                \
+  src/google/protobuf/stubs/hash.cc                                \
+  src/google/protobuf/stubs/hash.h                                 \
+  src/google/protobuf/stubs/map-util.h                             \
+  src/google/protobuf/stubs/stl_util-inl.h                         \
+  src/google/protobuf/extension_set.cc                             \
+  src/google/protobuf/generated_message_util.cc                    \
+  src/google/protobuf/message_lite.cc                              \
+  src/google/protobuf/repeated_field.cc                            \
+  src/google/protobuf/wire_format_lite.cc                          \
+  src/google/protobuf/io/coded_stream.cc                           \
+  src/google/protobuf/io/coded_stream_inl.h                        \
+  src/google/protobuf/io/zero_copy_stream.cc                       \
+  src/google/protobuf/io/zero_copy_stream_impl_lite.cc
+
+LOCAL_C_INCLUDES := \
+    $(LOCAL_PATH)/android \
+    bionic \
+    external/stlport/stlport \
+    $(LOCAL_PATH)/src
+
+LOCAL_SHARED_LIBRARIES := \
+    libcutils libutils libstlport
+
+# Define the header files to be copied
+#LOCAL_COPY_HEADERS := \
+#    src/google/protobuf/stubs/once.h \
+#    src/google/protobuf/stubs/common.h \
+#    src/google/protobuf/io/coded_stream.h \
+#    src/google/protobuf/generated_message_util.h \
+#    src/google/protobuf/repeated_field.h \
+#    src/google/protobuf/extension_set.h \
+#    src/google/protobuf/wire_format_lite_inl.h
+#
+#LOCAL_COPY_HEADERS_TO := $(LOCAL_MODULE)
+
+LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/android/config.h b/android/config.h
new file mode 100644
index 0000000..2cbd548
--- /dev/null
+++ b/android/config.h
@@ -0,0 +1,163 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* the name of <hash_set> */
+#define HASH_MAP_CLASS unordered_map
+
+/* the location of <hash_map> */
+#define HASH_MAP_H <tr1/unordered_map>
+
+/* the namespace of hash_map/hash_set */
+#define HASH_NAMESPACE std::tr1
+
+/* the name of <hash_set> */
+#define HASH_SET_CLASS unordered_set
+
+/* the location of <hash_set> */
+#define HASH_SET_H <tr1/unordered_set>
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `ftruncate' function. */
+#define HAVE_FTRUNCATE 1
+
+#if defined(ANDROID)
+/*
+ * TODO: Figure out how to use stlport unordered_map and set.
+ * For some reason they don't work when I try to point the
+ * HASH_MAP_H and HASH_SET_H to the stlport files, I get
+ * compile timer errors.
+ */
+
+/* define if the compiler has hash_map */
+#undef HAVE_HASH_MAP
+
+/* define if the compiler has hash_set */
+#undef HAVE_HASH_SET
+#else
+/* define if the compiler has hash_map */
+#define HAVE_HASH_MAP 1
+
+/* define if the compiler has hash_set */
+#define HAVE_HASH_SET 1
+#endif
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if you have the `mkdir' function. */
+#define HAVE_MKDIR 1
+
+/* Define if you have POSIX threads libraries and header files. */
+#define HAVE_PTHREAD 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strchr' function. */
+#define HAVE_STRCHR 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strtol' function. */
+#define HAVE_STRTOL 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Enable classes using zlib compression. */
+#define HAVE_ZLIB 1
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#define LT_OBJDIR ".libs/"
+
+/* Name of package */
+#define PACKAGE "protobuf"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "protobuf@googlegroups.com"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "Protocol Buffers"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "Protocol Buffers 2.3.0"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "protobuf"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "2.3.0"
+
+/* Define to necessary symbol if this constant uses a non-standard name on
+   your system. */
+/* #undef PTHREAD_CREATE_JOINABLE */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "2.3.0"
+
+/* Define to 1 if on AIX 3.
+   System headers sometimes define this.
+   We just want to avoid a redefinition error message.  */
+#ifndef _ALL_SOURCE
+/* # undef _ALL_SOURCE */
+#endif
+
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+/* Define to 1 if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+/* #undef _POSIX_SOURCE */
+
+/* Enable extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+#ifndef _TANDEM_SOURCE
+# define _TANDEM_SOURCE 1
+#endif