--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -32,6 +32,10 @@
 # endif
 #endif
 
+#ifdef __ANDROID__
+#include <getopt.h>
+#endif
+
 #ifdef _MSC_VER
 #include <Psapi.h>      /* for GetModuleFileName */
 #include <crtdbg.h>	/* for _CRT_ERROR, _CRT_ASSERT */
