Add script to generate the build configuration.

On a standard linux install, the configure script will generate header
files enabling/disabling features based on the system's configuration.

On android, we don't want to use the host configuration and need to wrap
that call with the right build parameters (CFLAGS, LDFLAGS, etc) in
order to generate the right configuration.
Note: this script should be run everytime we update curl.

BUG: 22347561

Change-Id: Icd44dbd35daa811e16f327fc4ec23f0cbe1d8780
diff --git a/androidconfigure b/androidconfigure
new file mode 100755
index 0000000..895465c
--- /dev/null
+++ b/androidconfigure
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+export CC="$(ls "${ANDROID_TOOLCHAIN}" | grep "\-gcc$")"
+export LD="$(ls "${ANDROID_TOOLCHAIN}" | grep "\-ld$")"
+
+T="${ANDROID_BUILD_TOP}"
+CFLAGS=(
+  "-isystem ${T}/external/libcxx/include"
+  "-isystem ${T}/bionic/libc/include/"
+  "-isystem ${T}/bionic/libc/arch-arm/include"
+  "-isystem ${T}/bionic/libc/kernel/uapi/"
+  "-isystem ${T}/bionic/libc/kernel/uapi/asm-arm/"
+  "-isystem ${T}/bionic/libm/include"
+  "-isystem ${T}/build/core/combo/include/arch/linux-arm/"
+  "-include ${T}/build/core/combo/include/arch/linux-arm/AndroidConfig.h"
+  "-fno-exceptions"
+  "-ffunction-sections"
+  "-fdata-sections"
+  "-fstack-protector"
+  "-fno-short-enums"
+  "-no-canonical-prefixes"
+  "-fmessage-length=0"
+  "-fomit-frame-pointer"
+  "-fPIC"
+  "-fno-strict-aliasing"
+  "-nostdlib"
+)
+
+
+./buildconf
+CFLAGS="${CFLAGS[@]}"
+./configure --host=arm-linux-androideabi --with-ssl="${T}/external/boringssl" \
+  CFLAGS="${CFLAGS}"  LIBS="-lc" CPPFLAGS="${CFLAGS} -I${T}/external/zlib/src" \
+  LDFLAGS="-L${ANDROID_PRODUCT_OUT}/obj/lib/" --disable-ntlm-wb --enable-ipv6 \
+  --with-zlib
+