Fix the windows build.

It looks like the mingw32 linker has some issues with WinMain() being in a static library.

Change-Id: I06e61ba3ede40c2f72c97949d13dee8aafdcc7d9
diff --git a/Makefile.android b/Makefile.android
index 2ef7c17..6743e8d 100644
--- a/Makefile.android
+++ b/Makefile.android
@@ -527,7 +527,14 @@
 
 # include the SDL sources
 #
-LOCAL_SRC_FILES += $(SDL_SOURCES) $(SDLMAIN_SOURCES)
+
+# IMPORTANT: Normally, we should add SDLMAIN_SOURCES here, however this breaks
+#            the Linux mingw32 build. Apparently, the i586-mingw32-ld wants the
+#            implementation of _WinMain@16 to be in an object file on the final
+#            link command used to generate the executable, and will not search
+#            in the static libraries that are used to build it.
+#
+LOCAL_SRC_FILES += $(SDL_SOURCES) #$(SDLMAIN_SOURCES)
 EMULATOR_UI_CFLAGS += $(SDL_CFLAGS) -I$(LOCAL_PATH)/$(SDL_DIR)/include
 
 # the skin support sources
@@ -750,6 +757,9 @@
 LOCAL_LDLIBS += $(SDL_LDLIBS)
 LOCAL_STATIC_LIBRARIES += $(SDL_STATIC_LIBRARIES)
 
+$(info LOCAL_LDLIBS=$(LOCAL_LDLIBS))
+$(info LOCAL_STATIC_LIBRARIES=$(LOCAL_STATIC_LIBRARIES))
+
 # add ELFF-specific flags
 #
 LOCAL_LDLIBS += $(ELFF_LDLIBS)
@@ -876,6 +886,9 @@
 
 LOCAL_MODULE := emulator
 
+# See comment about SDLMAIN_SOURCES in the 'emulator-ui' module declarations.
+LOCAL_SRC_FILES += $(SDLMAIN_SOURCES)
+
 include $(BUILD_HOST_EXECUTABLE)
 
 endif  # TARGET_ARCH == arm