Added Android build support for libedit prebuilts maintainer

This Android.mk support puts a thin layer around the libedit
./configure-based build. These build steps only need to be run by
somebody updating the prebuilts version of libedit located in
prebuilts/libs/libedit.

Currently this only supports building the libedit prebuilts for
linux-x86 (32-bit) on a linux host.

Tested on Ubuntu 12.04 x86_64:

cd external/libedit
mm ANDROID_BUILD_LIBEDIT=true prebuilts/libs/libedit/linux-x86/lib/libedit.a
cd ../../prebuilts/libs/libedit
find .
objdump -a linux-x86/lib/libedit.a | grep 'file format'

Note the file format for the libedit.a archive components are all
elf32-i386.

Change-Id: I04f8e2ba179749f197ade8b56bb6ae1e5196891a
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..5792aa5
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,39 @@
+ifeq ($(ANDROID_BUILD_LIBEDIT),true) # only maintainer needs this
+ifeq ($(HOST_OS),linux) # only build on linux hosts
+ifeq ($(HOST_ARCH),x86) # only build on x86 hosts
+
+LOCAL_PATH := $(call my-dir)
+PREBUILT_ROOT := prebuilts/libs/libedit
+PREBUILT_ARCH_ROOT := $(PREBUILT_ROOT)/$(HOST_OS)-$(HOST_ARCH)
+
+PREBUILT_CFLAGS="CFLAGS=-m32"
+PREBUILT_CXXFLAGS="CXXFLAGS=-m32"
+PREBUILT_LDFLAGS="LDFLAGS=-m32"
+
+HOST_STATIC_LIB_EXT := .a
+
+# Light wrapper rules around ./configure-based build.
+# Output goes to the prebuilts/libs/libedit directory.
+
+$(LOCAL_PATH)/lib/libedit.la: $(wildcard $(LOCAL_PATH)/src/*) $(LOCAL_PATH)/config.h
+	@echo making libedit for $(HOST_OS)-$(HOST_ARCH)
+	make -C $(LOCAL_PATH)
+
+$(PREBUILT_ARCH_ROOT)/lib/libedit.la: $(LOCAL_PATH)/lib/libedit.la
+	make -C $(LOCAL_PATH) all install
+
+$(LOCAL_PATH)/config.h: $(LOCAL_PATH)/config.h.in
+	$(hide) cd $(LOCAL_PATH) \
+  && ./configure \
+    --prefix=$(abspath $(PREBUILT_ROOT)) \
+    --exec-prefix=$(abspath $(PREBUILT_ARCH_ROOT)) \
+    --disable-shared \
+    $(PREBUILT_CFLAGS) $(PREBUILT_CXXFLAGS) $(PREBUILT_LDFLAGS) \
+  && make clean
+
+$(PREBUILT_ARCH_ROOT)/lib/libedit$(HOST_STATIC_LIB_EXT): \
+  $(PREBUILT_ARCH_ROOT)/lib/libedit.la
+
+endif # only build on x86 hosts
+endif # only build on linux hosts
+endif # only maintainer needs this
diff --git a/MODULE_LICENSE_BSD b/MODULE_LICENSE_BSD
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/MODULE_LICENSE_BSD
diff --git a/README.android b/README.android
new file mode 100644
index 0000000..323bb3a
--- /dev/null
+++ b/README.android
@@ -0,0 +1,12 @@
+/*
+ * README.android describes in high-level the libedit changes that we
+ * cannot push upstream to the llvm.org repository: 
+ * - Changes due to Android's build system. 
+ * - Changes due to Android's toolchain.
+ */
+
+* Initial downstream on 2013/10/30: Synched to libedit-20130712-3.1.tar.gz
+  from http://thrysoee.dk/editline/.
+
+* We add Android's *.mk files that are specific to Android's build system.
+  Currently for linux x86 (32-bit) host only.