Build system fixes so as to temporarily disable the GDBserver on
Android.  Making that work will require a bit of extra effort due to
minor glibc-vs-bionic differences.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11885 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/configure.in b/configure.in
index 1bcff1e..eaaf21b 100644
--- a/configure.in
+++ b/configure.in
@@ -604,6 +604,7 @@
    tmpdir="/tmp")
 AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory])
 
+
 #----------------------------------------------------------------------------
 # Libc and suppressions
 #----------------------------------------------------------------------------
@@ -818,7 +819,12 @@
 #
 # VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID
 #
-# Oh well, something to figure out properly later on.
+# Hmm.  Can't think of a nice clean solution to this.
+
+AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_VANILLA,
+               test x$VGCONF_PLATVARIANT = xvanilla)
+AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_ANDROID,
+               test x$VGCONF_PLATVARIANT = xandroid)
 
 
 #----------------------------------------------------------------------------
diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am
index c056401..6d57695 100644
--- a/coregrind/Makefile.am
+++ b/coregrind/Makefile.am
@@ -56,7 +56,10 @@
 vgdb_CPPFLAGS  = $(AM_CPPFLAGS_PRI)
 vgdb_CFLAGS    = $(AM_CFLAGS_PRI)
 vgdb_CCASFLAGS = $(AM_CCASFLAGS_PRI)
-vgdb_LDFLAGS   = $(AM_CFLAGS_PRI) -lpthread
+vgdb_LDFLAGS   = $(AM_CFLAGS_PRI)
+if !VGCONF_PLATVARIANT_IS_ANDROID
+vgdb_LDFLAGS   += -lpthread
+endif
 if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
 vgdb_LDFLAGS   += -Wl,-read_only_relocs -Wl,suppress
 endif
diff --git a/coregrind/m_options.c b/coregrind/m_options.c
index 59ec1fe..abc5b2d 100644
--- a/coregrind/m_options.c
+++ b/coregrind/m_options.c
@@ -46,11 +46,17 @@
 VexControl VG_(clo_vex_control);
 Bool   VG_(clo_error_limit)    = True;
 Int    VG_(clo_error_exitcode) = 0;
-VgVgdb VG_(clo_vgdb)           = Vg_VgdbYes; 
+
+#if defined(VGPV_arm_linux_android)
+VgVgdb VG_(clo_vgdb)           = Vg_VgdbNo; // currently disabled on Android
+#else
+VgVgdb VG_(clo_vgdb)           = Vg_VgdbYes;
+#endif
 Int    VG_(clo_vgdb_poll)      = 5000; 
 Int    VG_(clo_vgdb_error)     = 999999999;
 Char*  VG_(clo_vgdb_prefix)    = VG_CLO_VGDB_PREFIX_DEFAULT;
 Bool   VG_(clo_vgdb_shadow_registers) = False;
+
 Bool   VG_(clo_db_attach)      = False;
 Char*  VG_(clo_db_command)     = GDB_PATH " -nw %f %p";
 Int    VG_(clo_gen_suppressions) = 0;
diff --git a/coregrind/vgdb.c b/coregrind/vgdb.c
index a0f900e..065821b 100644
--- a/coregrind/vgdb.c
+++ b/coregrind/vgdb.c
@@ -25,11 +25,21 @@
 
    The GNU General Public License is contained in the file COPYING.
 */
-#include "pub_core_basics.h"
-#include "pub_core_vki.h"
-#include "pub_core_libcsetjmp.h"
-#include "pub_core_threadstate.h"
-#include "pub_core_gdbserver.h"
+
+/* Too difficult to make this work on Android right now.  Let's
+   skip for the time being at least. */
+#if defined(VGPV_arm_linux_android)
+
+#include <stdio.h>
+int main (int argc, char** argv)
+{
+   fprintf(stderr,
+           "%s: is not currently available on Android, sorry.\n",
+           argv[0]);
+   return 0;
+}
+
+#else /* all other (Linux?) platforms */
 
 #include <limits.h>
 #include <unistd.h>
@@ -50,10 +60,16 @@
 #include "assert.h"
 #include <sys/user.h>
 
-#  if defined(VGO_linux)
-#include <sys/prctl.h>
-#include <linux/ptrace.h>
-#  endif
+#if defined(VGO_linux)
+#  include <sys/prctl.h>
+#  include <linux/ptrace.h>
+#endif
+
+#include "pub_core_basics.h"
+#include "pub_core_vki.h"
+#include "pub_core_libcsetjmp.h"
+#include "pub_core_threadstate.h"
+#include "pub_core_gdbserver.h"
 
 /* vgdb has two usages:
    1. relay application between gdb and the gdbserver embedded in valgrind.
@@ -2348,3 +2364,5 @@
       free (commands[i]);
    return 0;
 }
+
+#endif /* !defined(VGPV_arm_linux_android) */