diff --git a/config.sub b/config.sub index 5ecc18b..15bca70 100755 --- a/config.sub +++ b/config.sub @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. -timestamp='2009-10-07' +timestamp='2010-11-01' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -1430,6 +1430,9 @@ case $os in -dicos*) os=-dicos ;; + -android*) + os=-android + ;; -none) ;; *) diff --git a/configure b/configure index a9c31fd..297cb4f 100755 --- a/configure +++ b/configure @@ -2346,7 +2346,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;} || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi done @@ -2822,7 +2822,7 @@ do stringfreelist) ac_gc_check_string_free_list=1 ;; xmallocoverrun) ac_xmalloc_overrun=1 ;; conslist) ac_gc_check_cons_list=1 ;; - *) as_fn_error $? "unknown check category $check" "$LINENO" 5 ;; + *) as_fn_error $? "unknown check category $check" "$LINENO" 5 ;; esac done IFS="$ac_save_IFS" @@ -2976,7 +2976,7 @@ fi $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -3009,7 +3009,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -3316,6 +3316,11 @@ $as_echo "#define HAVE_CRTIN /**/" >>confdefs.h machine=sh3 opsys=gnu-linux ;; + ## Android + arm*-*-android* ) + machine=arm opsys=android + ;; + * ) unported=yes ;; @@ -3670,7 +3675,7 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3785,7 +3790,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3828,7 +3833,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3887,7 +3892,7 @@ $as_echo "$ac_try_echo"; } >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi fi fi @@ -3939,7 +3944,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -4361,7 +4366,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi ac_ext=c @@ -4895,7 +4900,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi ac_ext=c @@ -6918,7 +6923,7 @@ if test "x$with_x" = xno; then have_x=disabled else case $x_includes,$x_libraries in #( - *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( + *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5 ;; #( *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -8172,7 +8177,7 @@ done if test "${GTK_COMPILES}" != "yes"; then if test "$USE_X_TOOLKIT" != "maybe"; then - as_fn_error $? "Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?" "$LINENO" 5; + as_fn_error $? "Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?" "$LINENO" 5 ; fi else HAVE_GTK=yes @@ -14124,7 +14129,7 @@ do "leim/Makefile") CONFIG_FILES="$CONFIG_FILES leim/Makefile" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac done @@ -14440,7 +14445,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -14468,7 +14473,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -14495,7 +14500,7 @@ $as_echo "$as_me: creating $ac_file" >&6;} case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac diff --git a/configure.in b/configure.in old mode 100644 new mode 100755 index 304f6ab..bc8463e --- a/configure.in +++ b/configure.in @@ -634,6 +634,11 @@ dnl see the `changequote' comment above. machine=sh3 opsys=gnu-linux ;; + ## Android + arm*-*-android* ) + machine=arm opsys=android + ;; + * ) unported=yes ;; diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c old mode 100644 new mode 100755 index 05f01b3..b9c208e --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -722,8 +722,12 @@ main (argc, argv) #define AUTH_KEY_LENGTH 64 #define SEND_BUFFER_SIZE 4096 +#ifdef ANDROID +#include +#else extern char *strerror (); extern int errno; +#endif /* Buffer to accumulate data to send in TCP connections. */ char send_buffer[SEND_BUFFER_SIZE + 1]; diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c old mode 100644 new mode 100755 index f98fb74..1cc0720 --- a/lib-src/fakemail.c +++ b/lib-src/fakemail.c @@ -42,6 +42,13 @@ main () return 0; } #else /* not MSDOS */ +#ifdef ANDROID +int +main () +{ + return 0; +} +#else /* not ANDROID */ /* This conditional contains all the rest of the file. */ /* These are defined in config in some versions. */ @@ -768,6 +775,7 @@ main (argc, argv) exit (close_the_streams ()); } +#endif /* not ANDROID */ #endif /* not MSDOS */ #endif /* not BSD 4.2 (or newer) */ diff --git a/src/Makefile.in b/src/Makefile.in old mode 100644 new mode 100755 diff --git a/src/buffer.c b/src/buffer.c old mode 100644 new mode 100755 index 939e2bb..f8b7abe --- a/src/buffer.c +++ b/src/buffer.c @@ -28,9 +28,11 @@ along with GNU Emacs. If not, see . */ #include #include +#ifndef ANDROID #ifndef USE_CRT_DLL extern int errno; #endif +#endif #ifdef HAVE_UNISTD_H diff --git a/src/callproc.c b/src/callproc.c old mode 100644 new mode 100755 index 863d4e4..64f3dfe --- a/src/callproc.c +++ b/src/callproc.c @@ -25,9 +25,11 @@ along with GNU Emacs. If not, see . */ #include #include +#ifndef ANDROID #ifndef USE_CRT_DLL extern int errno; #endif +#endif /* Define SIGCHLD as an alias for SIGCLD. */ diff --git a/src/dispnew.c b/src/dispnew.c old mode 100644 new mode 100755 index b614905..409ee01 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -96,6 +96,9 @@ along with GNU Emacs. If not, see . */ #include #define PENDING_OUTPUT_COUNT(FILE) __fpending (FILE) #endif +#ifdef ANDROID +#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) +#endif #ifndef PENDING_OUTPUT_COUNT #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_ptr - (FILE)->_base) #endif @@ -6200,9 +6203,11 @@ window_change_signal (signalnum) /* If we don't have an argument, */ int signalnum; /* some compilers complain in signal calls. */ { int width, height; +#ifndef ANDROID #ifndef USE_CRT_DLL extern int errno; #endif +#endif int old_errno = errno; struct tty_display_info *tty; diff --git a/src/emacs.c b/src/emacs.c old mode 100644 new mode 100755 index 71ffa99..9ce5883 --- a/src/emacs.c +++ b/src/emacs.c @@ -618,7 +618,7 @@ void __do_global_dtors () {} /* GNU/Linux has a bug in its library; avoid an error. */ #ifndef GNU_LINUX -char * __CTOR_LIST__[2] = { (char *) (-1), 0 }; +//char * __CTOR_LIST__[2] = { (char *) (-1), 0 }; #endif char * __DTOR_LIST__[2] = { (char *) (-1), 0 }; #endif /* GCC_CTORS_IN_LIBC */ @@ -791,9 +791,11 @@ main (int argc, char **argv) char stack_bottom_variable; int do_initial_setlocale; int skip_args = 0; +#ifndef ANDROID #ifndef USE_CRT_DLL extern int errno; #endif +#endif #ifdef HAVE_SETRLIMIT struct rlimit rlim; #endif diff --git a/src/fileio.c b/src/fileio.c old mode 100644 new mode 100755 index 440a726..7823df5 --- a/src/fileio.c +++ b/src/fileio.c @@ -53,11 +53,13 @@ along with GNU Emacs. If not, see . */ #include #include +#ifndef ANDROID #ifndef vax11c #ifndef USE_CRT_DLL extern int errno; #endif #endif +#endif #include "lisp.h" #include "intervals.h" diff --git a/src/filelock.c b/src/filelock.c old mode 100644 new mode 100755 index 7c69ea9..a316bf9 --- a/src/filelock.c +++ b/src/filelock.c @@ -50,6 +50,7 @@ along with GNU Emacs. If not, see . */ #ifndef errno extern int errno; #endif +#define rindex strrchr #include "lisp.h" #include "buffer.h" diff --git a/src/floatfns.c b/src/floatfns.c old mode 100644 new mode 100755 index 97d9ec0..683e37f --- a/src/floatfns.c +++ b/src/floatfns.c @@ -100,10 +100,12 @@ extern double logb (); #ifdef FLOAT_CHECK_ERRNO # include +#ifndef ANDROID #ifndef USE_CRT_DLL extern int errno; #endif #endif +#endif #ifdef FLOAT_CATCH_SIGILL static SIGTYPE float_error (); diff --git a/src/keyboard.c b/src/keyboard.c old mode 100644 new mode 100755 index 22c5898..657ee8d --- a/src/keyboard.c +++ b/src/keyboard.c @@ -78,9 +78,11 @@ along with GNU Emacs. If not, see . */ #include "nsterm.h" #endif +#ifndef ANDROID #ifndef USE_CRT_DLL extern int errno; #endif +#endif /* Variables for blockinput.h: */ diff --git a/src/lread.c b/src/lread.c old mode 100644 new mode 100755 index c96e391..fd80c2e --- a/src/lread.c +++ b/src/lread.c @@ -76,9 +76,11 @@ along with GNU Emacs. If not, see . */ #define file_tell ftell #endif +#ifndef ANDROID #ifndef USE_CRT_DLL extern int errno; #endif +#endif /* hash table read constants */ Lisp_Object Qhash_table, Qdata; diff --git a/src/m/arm.h b/src/m/arm.h old mode 100644 new mode 100755 index b04c5ec..094a9dd --- a/src/m/arm.h +++ b/src/m/arm.h @@ -42,5 +42,13 @@ along with GNU Emacs. If not, see . */ #define LIB_GCC -lgcc_s #endif +#ifdef ANDROID + +#undef START_FILES + +#define START_FILES pre-crt0.o /home/zakki/android/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.2.1/lib/gcc/arm-eabi/4.2.1/thumb/crti.o /home/zakki/android/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.2.1/lib/gcc/arm-eabi/4.2.1/thumb/crtbegin.o + +#endif + /* arch-tag: 07856f0c-f0c8-4bd8-99af-0b7fa1e5ee42 (do not change this comment) */ diff --git a/src/process.c b/src/process.c old mode 100644 new mode 100755 index 3e2aa61..b005a80 --- a/src/process.c +++ b/src/process.c @@ -195,9 +195,11 @@ extern int serial_open (char *port); extern void serial_configure (struct Lisp_Process *p, Lisp_Object contact); #endif +#ifndef ANDROID #ifndef USE_CRT_DLL extern int errno; #endif +#endif #ifndef HAVE_H_ERRNO extern int h_errno; @@ -6600,10 +6602,12 @@ process has been transmitted to the serial port. */) send_process (proc, "\004", 1, Qnil); else if (EQ (XPROCESS (proc)->type, Qserial)) { +#ifndef ANDROID #ifdef HAVE_TERMIOS if (tcdrain (XPROCESS (proc)->outfd) != 0) error ("tcdrain() failed: %s", emacs_strerror (errno)); #endif +#endif /* Do nothing on Windows because writes are blocking. */ } else diff --git a/src/sysdep.c b/src/sysdep.c old mode 100644 new mode 100755 index 2f79a71..9146892 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -2888,11 +2888,12 @@ rmdir (dpath) void bzero (b, length) - register char *b; - register int length; + register void *b; + register size_t length; { + char *p = (char*)b; while (length-- > 0) - *b++ = 0; + *p++ = 0; } #endif /* no bzero */ @@ -2903,6 +2904,7 @@ bzero (b, length) /* Saying `void' requires a declaration, above, where bcopy is used and that declaration causes pain for systems where bcopy is a macro. */ +/* bcopy (b1, b2, length) register char *b1; register char *b2; @@ -2910,17 +2912,19 @@ bcopy (b1, b2, length) { while (length-- > 0) *b2++ = *b1++; -} +}*/ #endif /* (!defined (BSTRING) && !defined (bcopy)) || defined (NEED_BCOPY) */ #ifndef BSTRING #ifndef bcmp int -bcmp (b1, b2, length) /* This could be a macro! */ - register char *b1; - register char *b2; - register int length; +bcmp (p1, p2, length) /* This could be a macro! */ + const void *p1; + const void *p2; + register size_t length; { + register const char *b1 = (const char *)p1; + register const char *b2 = (const char *)p2; while (length-- > 0) if (*b1++ != *b2++) return 1;