diff -rupN wget.orig/Android.mk wget/Android.mk
--- wget.orig/Android.mk	1969-12-31 16:00:00.000000000 -0800
+++ wget/Android.mk	2009-09-21 20:11:46.000000000 -0700
@@ -0,0 +1 @@
+include $(call all-subdir-makefiles)
diff -rupN wget.orig/src/Android.mk wget/src/Android.mk
--- wget.orig/src/Android.mk	1969-12-31 16:00:00.000000000 -0800
+++ wget/src/Android.mk	2009-09-21 21:29:21.000000000 -0700
@@ -0,0 +1,14 @@
+# Makefile to build wget for Android using the Android NDK:
+# http://developer.android.com/sdk/ndk/1.5_r1/index.html
+# 
+# You need to run configure first with these options:
+# ./configure --without-ssl --disable-nls --build=arm-eabi
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+
+LOCAL_MODULE    := wget
+LOCAL_SRC_FILES := alloca.c cmpt.c connect.c convert.c cookies.c ftp-basic.c ftp-ls.c ftp-opie.c ftp.c gnu-md5.c gen-md5.c getopt.c  hash.c host.c html-parse.c html-url.c http.c init.c log.c main.c netrc.c progress.c ptimer.c recur.c res.c retr.c safe-ctype.c snprintf.c spider.c url.c utils.c version.c xmalloc.c
+
+include $(BUILD_EXECUTABLE)
diff -rupN wget.orig/src/sysdep.h wget/src/sysdep.h
--- wget.orig/src/sysdep.h	2009-09-21 22:00:27.000000000 -0700
+++ wget/src/sysdep.h	2009-09-21 21:59:49.000000000 -0700
@@ -62,7 +62,7 @@ as that of the covered work.  */
 #  ifdef __cplusplus
 typedef bool _Bool;
 #  else
-typedef unsigned char _Bool;
+//typedef unsigned char _Bool;
 #  endif
 # endif
 # define bool _Bool
@@ -127,6 +127,13 @@ int strncasecmp ();
 #ifndef HAVE_STRPTIME
 char *strptime ();
 #endif
+
+/* The Android NDK doesn't have timegm, only timegm64, evidently */
+/* This is not the best place for a workaround, but it's easy. */
+#ifdef ANDROID
+#undef HAVE_TIMEGM
+#endif
+
 #ifndef HAVE_TIMEGM
 # include <time.h>
 time_t timegm (struct tm *);
@@ -138,7 +145,7 @@ void *memrchr (const void *, int, size_t
 /* These are defined in snprintf.c.  It would be nice to have an
    snprintf.h, though.  */
 #ifndef HAVE_SNPRINTF
-int snprintf ();
+//int snprintf ();
 #endif
 #ifndef HAVE_VSNPRINTF
 int vsnprintf ();
@@ -184,36 +191,37 @@ int fnmatch (const char *, const char *,
 typedef int sig_atomic_t;
 #endif
 
-/* Provide uint32_t on the platforms that don't define it.  Although
-   most code should be agnostic about integer sizes, some code really
-   does need a 32-bit integral type.  Such code should use uint32_t.
-   (The exception is gnu-md5.[ch], which uses its own detection for
-   portability across platforms.)  */
-
-#ifndef HAVE_UINT32_T
-# if SIZEOF_INT == 4
-typedef unsigned int uint32_t;
-# else
-#  if SIZEOF_LONG == 4
-typedef unsigned long uint32_t;
-#  else
-#   if SIZEOF_SHORT == 4
-typedef unsigned short uint32_t;
-#   else
- #error "Cannot determine a 32-bit unsigned integer type"
-#   endif
-#  endif
-# endif
-#endif
-
-/* If uintptr_t isn't defined, simply typedef it to unsigned long. */
-#ifndef HAVE_UINTPTR_T
-typedef unsigned long uintptr_t;
-#endif
-
-/* If intptr_t isn't defined, simply typedef it to long. */
-#ifndef HAVE_INTPTR_T
-typedef long intptr_t;
-#endif
+// This fails when building for the Android NDK
+///* Provide uint32_t on the platforms that don't define it.  Although
+//   most code should be agnostic about integer sizes, some code really
+//   does need a 32-bit integral type.  Such code should use uint32_t.
+//   (The exception is gnu-md5.[ch], which uses its own detection for
+//   portability across platforms.)  */
+//
+//#ifndef HAVE_UINT32_T
+//# if SIZEOF_INT == 4
+//typedef unsigned int uint32_t;
+//# else
+//#  if SIZEOF_LONG == 4
+//typedef unsigned long uint32_t;
+//#  else
+//#   if SIZEOF_SHORT == 4
+//typedef unsigned short uint32_t;
+//#   else
+// #error "Cannot determine a 32-bit unsigned integer type"
+//#   endif
+//#  endif
+//# endif
+//#endif
+//
+///* If uintptr_t isn't defined, simply typedef it to unsigned long. */
+//#ifndef HAVE_UINTPTR_T
+//typedef unsigned long uintptr_t;
+//#endif
+//
+///* If intptr_t isn't defined, simply typedef it to long. */
+//#ifndef HAVE_INTPTR_T
+//typedef long intptr_t;
+//#endif
 
 #endif /* SYSDEP_H */
diff -rupN wget.orig/src/utils.c wget/src/utils.c
--- wget.orig/src/utils.c	2009-09-21 22:00:27.000000000 -0700
+++ wget/src/utils.c	2009-09-21 21:58:22.000000000 -0700
@@ -1218,6 +1218,7 @@ get_grouping_data (const char **sep, con
   static bool initialized;
   if (!initialized)
     {
+#ifdef HAVE_NLS
       /* Get the grouping info from the locale. */
       struct lconv *lconv = localeconv ();
       cached_sep = lconv->thousands_sep;
@@ -1241,6 +1242,10 @@ get_grouping_data (const char **sep, con
             cached_sep = ".";
           cached_grouping = "\x03";
         }
+#else
+      cached_sep = ",";
+      cached_grouping = "\x03";
+#endif
       initialized = true;
     }
   *sep = cached_sep;
@@ -1707,9 +1712,11 @@ abort_run_with_timeout (int sig)
   /* We don't have siglongjmp to preserve the set of blocked signals;
      if we longjumped out of the handler at this point, SIGALRM would
      remain blocked.  We must unblock it manually. */
-  int mask = siggetmask ();
-  mask &= ~sigmask (SIGALRM);
-  sigsetmask (mask);
+  // Android NDK's libc doesn't have siggetmask and sigmask, so we do
+  // the wrong thing for now.
+//  int mask = siggetmask ();
+//  mask &= ~sigmask (SIGALRM);
+//  sigsetmask (mask);
 
   /* Now it's safe to longjump. */
   longjmp (run_with_timeout_env, -1);
diff -rupN wget.orig/src/wget.h wget/src/wget.h
--- wget.orig/src/wget.h	2009-09-21 22:00:27.000000000 -0700
+++ wget/src/wget.h	2009-09-21 21:38:18.000000000 -0700
@@ -137,7 +137,6 @@ as that of the covered work.  */
    off_t because: a) off_t is always 32-bit on Windows, and b) we
    don't necessarily want to tie having a 64-bit type for internal
    calculations to having LFS support.  */
-
 #ifdef WINDOWS
   /* nothing to do, see mswindows.h */
 #elif SIZEOF_LONG >= 8
@@ -159,10 +158,11 @@ as that of the covered work.  */
 #else
   /* Fall back to using long, which is always available and in most
      cases large enough. */
-typedef long off_t;
+typedef long wgint;
 # define SIZEOF_WGINT SIZEOF_LONG
 #endif
 
+
 /* Pick a strtol-compatible function that will work with wgint.  The
    choices are strtol, strtoll, or our own implementation of strtoll
    in cmpt.c, activated with NEED_STRTOLL.  */
