Add --static option to android-configure.sh in order to build static emulator executable.

This is needed to run the emulator in restricted environment where libX11.so and even
libstdc++.so are not available. Only tested on Linux. The resulting binary will not
start unless you use -no-window. Also don't expect any audio output working.

Change-Id: Ia736898cd3ae6eb928614a00a1a3e18cc8086a5c
diff --git a/Makefile.android b/Makefile.android
index a5385d4..1929cb3 100644
--- a/Makefile.android
+++ b/Makefile.android
@@ -625,7 +625,6 @@
 ifeq ($(HOST_OS),linux)
     VL_SOURCES += usb-linux.c \
                   qemu-thread.c
-    LOCAL_LDLIBS += -lX11
 else
     VL_SOURCES += usb-dummy-android.c
 endif
@@ -769,6 +768,14 @@
 
 LOCAL_LDLIBS += $(QEMU_AUDIO_LIB)
 
+# Generate a completely static executable if needed.
+# Note that this means no sound and graphics on Linux.
+#
+ifeq ($(CONFIG_STATIC_EXECUTABLE),true)
+    LOCAL_SRC_FILES += dynlink-static.c
+    LOCAL_LDLIBS    += -static
+endif
+
 LOCAL_MODULE := emulator
 
 include $(BUILD_HOST_EXECUTABLE)