Index: configure.in =================================================================== RCS file: /sources/emacs/emacs/configure.in,v retrieving revision 1.479 diff -u -r1.479 configure.in --- configure.in 7 Nov 2007 04:00:24 -0000 1.479 +++ configure.in 15 Nov 2007 11:50:05 -0000 @@ -1326,6 +1326,23 @@ unset has_option unset SAVE_CFLAGS +AC_ARG_ENABLE(combine, +[AS_HELP_STRING([--enable-combine], + [compile with -combine option (GCC only)])], + AC_MSG_CHECKING([whether combined compilation is supported]) + combine=no + if test $(basename ${CC}) = "gcc"; then + LANG=C ${CC} -combine 2>&1 | grep -q unrecognized + test $? -eq 1 && combine=yes + fi + if test "$combine" = "yes"; then + AC_DEFINE(COMBINE, [1], [Define to build with -combine GCC option.]) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + AC_MSG_ERROR([Reconfigure without --enable-combine option.]) + fi) + #### Some other nice autoconf tests. dnl checks for programs @@ -2192,6 +2209,11 @@ fi +dnl Using both GTK and -combine doesn't work for now. +if test "${HAVE_GTK}" = "yes" && test "${enable_combine+set}" = set; then + AC_MSG_ERROR([(Due to GCC bugs ?) GTK toolkit may not be used with -combine option. +Reconfigure either with another X toolkit or without --enable-combine.]) +fi if test "${HAVE_GTK}" = "yes"; then Index: src/Makefile.in =================================================================== RCS file: /sources/emacs/emacs/src/Makefile.in,v retrieving revision 1.359 diff -u -r1.359 Makefile.in --- src/Makefile.in 1 Nov 2007 07:16:09 -0000 1.359 +++ src/Makefile.in 15 Nov 2007 11:50:06 -0000 @@ -978,7 +978,13 @@ for the first time, this prevents any variation between configurations in the contents of the DOC file. Likewise for ${SOME_MACHINE_LISP}. */ + +#ifdef COMBINE +combobj = everything.o +${etc}DOC: ${libsrc}make-docfile${EXEEXT} ${combobj} ${shortlisp} ${SOME_MACHINE_LISP} +#else ${etc}DOC: ${libsrc}make-docfile${EXEEXT} ${obj} ${shortlisp} ${SOME_MACHINE_LISP} +#endif /* COMBINE */ -rm -f ${etc}DOC ${libsrc}make-docfile -d ${srcdir} ${SOME_MACHINE_OBJECTS} ${obj} > ${etc}DOC ${libsrc}make-docfile -a ${etc}DOC -d ${srcdir} ${SOME_MACHINE_LISP} ${shortlisp} @@ -991,11 +997,21 @@ #define MAKE_PARALLEL #endif +#ifdef COMBINE +${combobj}: $(obj:.o=.c) $(otherobj:.o=.c) + $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) -combine $? -o $@ + +temacs${EXEEXT}: MAKE_PARALLEL $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${combobj} OBJECTS_MACHINE prefix-args${EXEEXT} + echo "${obj} ${otherobj} " OBJECTS_MACHINE > buildobj.lst + $(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${TEMACS_LDFLAGS}) $(LDFLAGS) \ + -o temacs ${STARTFILES} ${combobj} OBJECTS_MACHINE ${LIBES} +#else temacs${EXEEXT}: MAKE_PARALLEL $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} ${otherobj} OBJECTS_MACHINE prefix-args${EXEEXT} echo "${obj} ${otherobj} " OBJECTS_MACHINE > buildobj.lst $(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${TEMACS_LDFLAGS}) $(LDFLAGS) \ -o temacs ${STARTFILES} ${obj} ${otherobj} \ OBJECTS_MACHINE ${LIBES} +#endif /* COMBINE */ /* We do not use ALL_LDFLAGS because LD_SWITCH_SYSTEM and LD_SWITCH_MACHINE often contain options that have to do with using Emacs''s crt0, Index: src/cm.c =================================================================== RCS file: /sources/emacs/emacs/src/cm.c,v retrieving revision 1.24 diff -u -r1.24 cm.c --- src/cm.c 29 Aug 2007 05:27:53 -0000 1.24 +++ src/cm.c 15 Nov 2007 11:50:06 -0000 @@ -30,18 +30,6 @@ #include "termhooks.h" #include "termchar.h" - -/* For now, don't try to include termcap.h. On some systems, - configure finds a non-standard termcap.h that the main build - won't find. */ - -#if defined HAVE_TERMCAP_H && 0 -#include -#else -extern void tputs P_ ((const char *, int, int (*)(int))); -extern char *tgoto P_ ((const char *, int, int)); -#endif - #define BIG 9999 /* 9999 good on VAXen. For 16 bit machines use about 2000.... */ Index: src/cm.h =================================================================== RCS file: /sources/emacs/emacs/src/cm.h,v retrieving revision 1.23 diff -u -r1.23 cm.h --- src/cm.h 29 Aug 2007 05:27:54 -0000 1.23 +++ src/cm.h 15 Nov 2007 11:50:06 -0000 @@ -162,6 +162,17 @@ extern int cost; extern int evalcost (); +/* For now, don't try to include termcap.h. On some systems, + configure finds a non-standard termcap.h that the main build + won't find. */ + +#if defined HAVE_TERMCAP_H && 0 +#include +#else +extern int tputs P_ ((const char *, int, int (*)(int))); +extern char *tgoto P_ ((const char *, int, int)); +#endif + #define emacs_tputs(tty, str, affcnt, putc) (current_tty = (tty), tputs (str, affcnt, putc)) extern struct tty_display_info *current_tty; Index: src/config.in =================================================================== RCS file: /sources/emacs/emacs/src/config.in,v retrieving revision 1.236 diff -u -r1.236 config.in --- src/config.in 1 Nov 2007 07:38:58 -0000 1.236 +++ src/config.in 15 Nov 2007 11:50:06 -0000 @@ -32,6 +32,9 @@ /* Define to 1 if the mktime function is broken. */ #undef BROKEN_MKTIME +/* Define to build with -combine GCC option. */ +#undef COMBINE + /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ Index: src/fringe.c =================================================================== RCS file: /sources/emacs/emacs/src/fringe.c,v retrieving revision 1.48 diff -u -r1.48 fringe.c --- src/fringe.c 14 Sep 2007 07:33:27 -0000 1.48 +++ src/fringe.c 15 Nov 2007 11:50:06 -0000 @@ -1659,7 +1659,7 @@ /* Garbage collection hook */ void -mark_fringe_data () +mark_fringe_data (void) { int i; Index: src/keyboard.c =================================================================== RCS file: /sources/emacs/emacs/src/keyboard.c,v retrieving revision 1.929 diff -u -r1.929 keyboard.c --- src/keyboard.c 9 Nov 2007 12:19:21 -0000 1.929 +++ src/keyboard.c 15 Nov 2007 11:50:06 -0000 @@ -12519,7 +12519,7 @@ /* Mark the pointers in the kboard objects. Called by the Fgarbage_collector. */ void -mark_kboards () +mark_kboards (void) { KBOARD *kb; Lisp_Object *p; Index: src/lisp.h =================================================================== RCS file: /sources/emacs/emacs/src/lisp.h,v retrieving revision 1.599 diff -u -r1.599 lisp.h --- src/lisp.h 29 Oct 2007 18:15:02 -0000 1.599 +++ src/lisp.h 15 Nov 2007 11:50:06 -0000 @@ -2361,6 +2361,7 @@ void hash_remove P_ ((struct Lisp_Hash_Table *, Lisp_Object)); void hash_clear P_ ((struct Lisp_Hash_Table *)); void remove_hash_entry P_ ((struct Lisp_Hash_Table *, int)); +extern void seed_random P_ ((long)); extern void init_fns P_ ((void)); EXFUN (Fsxhash, 1); EXFUN (Fmake_hash_table, MANY); @@ -3227,6 +3228,11 @@ extern int emacs_close P_ ((int)); extern int emacs_read P_ ((int, char *, unsigned int)); extern int emacs_write P_ ((int, const char *, unsigned int)); +extern void fatal (const char *, ...) NO_RETURN; + +/* Defined in unexec implementation. */ +extern void unexec P_ ((char *, char *, unsigned int, + unsigned int, unsigned int)); /* defined in filelock.c */ EXFUN (Funlock_buffer, 0); @@ -3255,7 +3261,6 @@ /* Defined in term.c */ extern void syms_of_term P_ ((void)); -extern void fatal () NO_RETURN; /* Defined in terminal.c */ extern void syms_of_terminal P_ ((void)); Index: src/sysdep.c =================================================================== RCS file: /sources/emacs/emacs/src/sysdep.c,v retrieving revision 1.288 diff -u -r1.288 sysdep.c --- src/sysdep.c 27 Sep 2007 21:20:06 -0000 1.288 +++ src/sysdep.c 15 Nov 2007 11:50:06 -0000 @@ -26,6 +26,8 @@ #include #include #include +#include + #ifdef HAVE_UNISTD_H #include #endif @@ -2421,7 +2423,7 @@ */ #ifndef start_of_data -char * +POINTER_TYPE * start_of_data () { #ifdef DATA_START @@ -5496,5 +5498,19 @@ } #endif /* HAVE_STRSIGNAL */ +void +fatal (const char *fmt, ...) +{ + va_list ap; + + va_start (ap, fmt); + fprintf (stderr, "emacs: "); + vfprintf (stderr, fmt, ap); + va_end (ap); + fprintf (stderr, "\n"); + fflush (stderr); + exit (1); +} + /* arch-tag: edb43589-4e09-4544-b325-978b5b121dcf (do not change this comment) */ Index: src/term.c =================================================================== RCS file: /sources/emacs/emacs/src/term.c,v retrieving revision 1.209 diff -u -r1.209 term.c --- src/term.c 25 Oct 2007 02:38:37 -0000 1.209 +++ src/term.c 15 Nov 2007 11:50:06 -0000 @@ -54,20 +54,6 @@ #include "syssignal.h" #include "systty.h" #include "intervals.h" - -/* For now, don't try to include termcap.h. On some systems, - configure finds a non-standard termcap.h that the main build - won't find. */ - -#if defined HAVE_TERMCAP_H && 0 -#include -#else -extern void tputs P_ ((const char *, int, int (*)(int))); -extern int tgetent P_ ((char *, const char *)); -extern int tgetflag P_ ((char *id)); -extern int tgetnum P_ ((char *id)); -#endif - #include "cm.h" #ifdef HAVE_X_WINDOWS #include "xterm.h" @@ -3754,18 +3740,6 @@ abort (); } -/* VARARGS 1 */ -void -fatal (str, arg1, arg2) - char *str, *arg1, *arg2; -{ - fprintf (stderr, "emacs: "); - fprintf (stderr, str, arg1, arg2); - fprintf (stderr, "\n"); - fflush (stderr); - exit (1); -} - /* Delete the given tty terminal, closing all frames on it. */ Index: src/terminfo.c =================================================================== RCS file: /sources/emacs/emacs/src/terminfo.c,v retrieving revision 1.22 diff -u -r1.22 terminfo.c --- src/terminfo.c 26 Jul 2007 05:27:57 -0000 1.22 +++ src/terminfo.c 15 Nov 2007 11:50:06 -0000 @@ -42,7 +42,7 @@ int len, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9; { char *temp; - extern char *tparm(); + extern char *tparm (char *, ...); temp = tparm (string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); if (outstring == 0)