changeset 109080:25b707510762

merge trunk
author Kenichi Handa <handa@etlken>
date Wed, 30 Jun 2010 15:51:39 +0900
parents 0a56ed7397f0 (current diff) ec99501be565 (diff)
children bcae1f83a33e
files lisp/vc/diff-mode.el lisp/vc/vc.el
diffstat 23 files changed, 266 insertions(+), 348 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jun 29 11:41:29 2010 +0900
+++ b/ChangeLog	Wed Jun 30 15:51:39 2010 +0900
@@ -1,3 +1,21 @@
+2010-06-30  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Fix CFLAGS for non-GCC compilers.
+	* configure.in (CFLAGS): Always use -g like it was done before the
+	2010-03-30 change.
+	(REAL_CFLAGS): Use CFLAGS for non-GCC to get optimization flags.  (Bug#6538)
+
+2010-06-30  Glenn Morris  <rgm@gnu.org>
+
+	* configure.in (HAVE_SOUND, HAVE_X_I18N, HAVE_X11R6_XIM):
+	Set with AC_DEFINE rather than AH_BOTTOM.
+
+	* configure.in (C_OPTIMIZE_SWITCH, CANNOT_DUMP, SYSTEM_MALLOC):
+	(USE_MMAP_FOR_BUFFERS, C_WARNING_SWITCH, CFLAGS, REAL_CFLAGS):
+	Set with shell, not cpp.
+	(LIBX): Remove, just use -lX11 in the one place this was used.
+	(cannot_dump): Replace with CANNOT_DUMP.
+
 2010-06-28  Jan Djärv  <jan.h.d@swipnet.se>
 
 	* configure.in: Add --with-x-toolkit=gtk3. Remove HAVE_GTK_MULTIDISPLAY,
--- a/admin/CPP-DEFINES	Tue Jun 29 11:41:29 2010 +0900
+++ b/admin/CPP-DEFINES	Wed Jun 30 15:51:39 2010 +0900
@@ -60,10 +60,8 @@
 SEPCHAR
 SIGTYPE
 SYSTEM_TYPE
-USE_MMAP_FOR_BUFFERS
 
 ** Machine specific macros, decribed in detail in src/m/template.h
-CANNOT_DUMP
 EXPLICIT_SIGN_EXTEND
 LOAD_AVE_CVT
 LOAD_AVE_TYPE
@@ -205,7 +203,6 @@
 HAVE_WORKING_VFORK
 HAVE_XRMSETDATABASE
 HPUX
-INHIBIT_X11R6_XIM
 INTERNAL_TERMINAL
 IS_ANY_SEP
 IS_DIRECTORY_SEP
--- a/configure	Tue Jun 29 11:41:29 2010 +0900
+++ b/configure	Wed Jun 30 15:51:39 2010 +0900
@@ -718,7 +718,7 @@
 UNEXEC_OBJ
 C_SWITCH_MACHINE
 LD_SWITCH_SYSTEM
-cannot_dump
+CANNOT_DUMP
 MAKEINFO
 GZIP_PROG
 INSTALL_INFO
@@ -4286,14 +4286,12 @@
   CC="$NON_GNU_CC"
 fi
 
-if test x$GCC = xyes && test "x$GCC_TEST_OPTIONS" != x
-then
-  CC="$CC $GCC_TEST_OPTIONS"
-fi
-
-if test x$GCC = x && test "x$NON_GCC_TEST_OPTIONS" != x
-then
-  CC="$CC $NON_GCC_TEST_OPTIONS"
+if test x$GCC = xyes; then
+  C_OPTIMIZE_SWITCH=-O2
+  test "x$GCC_TEST_OPTIONS" != x && CC="$CC $GCC_TEST_OPTIONS"
+else
+    C_OPTIMIZE_SWITCH=-O
+  test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
 fi
 
 ac_ext=c
@@ -5428,102 +5426,43 @@
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 
-#### Extract some information from the operating system and machine files.
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the machine- and system-dependent files to find out
- - which libraries the lib-src programs will want, and
- - whether the GNU malloc routines are usable..." >&5
-$as_echo "$as_me: checking the machine- and system-dependent files to find out
- - which libraries the lib-src programs will want, and
- - whether the GNU malloc routines are usable..." >&6;}
-
-### First figure out CFLAGS (which we use for running the compiler here)
-### and REAL_CFLAGS (which we use for real compilation).
-### The two are the same except on a few systems, where they are made
-### different to work around various lossages.  For example,
-### GCC 2.5 on GNU/Linux needs them to be different because it treats -g
-### as implying static linking.
-
-### If the CFLAGS env var is specified, we use that value
-### instead of the default.
-
-### It's not important that this name contain the PID; you can't run
-### two configures in the same directory and have anything work
-### anyway.
-tempcname="conftest.c"
-
-echo '
-#include "'${srcdir}'/src/'${opsysfile}'"
-#include "'${srcdir}'/src/'${machfile}'"
-
-configure___ LIBX=-lX11
-
-#ifdef CANNOT_DUMP
-configure___ cannot_dump=yes
-#else
-configure___ cannot_dump=no
-#endif
-
-#ifdef SYSTEM_MALLOC
-configure___ system_malloc=yes
-#else
-configure___ system_malloc=no
-#endif
-
-#ifdef USE_MMAP_FOR_BUFFERS
-configure___ use_mmap_for_buffers=yes
-#else
-configure___ use_mmap_for_buffers=no
-#endif
-
-#ifndef C_OPTIMIZE_SWITCH
-#ifdef __GNUC__
-#define C_OPTIMIZE_SWITCH -O2
-#else
-#define C_OPTIMIZE_SWITCH -O
-#endif
-#endif
-
-#ifndef C_WARNINGS_SWITCH
-#define C_WARNINGS_SWITCH ${C_WARNINGS_SWITCH}
-#endif
-
-#ifdef THIS_IS_CONFIGURE
-
-/* Get the CFLAGS for tests in configure.  */
-#ifdef __GNUC__
-configure___ CFLAGS=-g C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
-#else
-configure___ CFLAGS='${SPECIFIED_CFLAGS}'
-#endif
-
-#else /* not THIS_IS_CONFIGURE */
-
-/* Get the CFLAGS for real compilation.  */
-#ifdef __GNUC__
-configure___ REAL_CFLAGS=-g C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}'
-#else
-configure___ REAL_CFLAGS='${SPECIFIED_CFLAGS}'
-#endif
-
-#endif /* not THIS_IS_CONFIGURE */
-' > ${tempcname}
-
 LDFLAGS="${LDFLAGS} ${PROFILING_LDFLAGS}"
 
+
 # The value of CPP is a quoted variable reference, so we need to do this
 # to get its actual value...
 CPP=`eval "echo $CPP"`
-eval `${CPP} -Isrc ${tempcname} \
-       | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
+
+
+### First figure out CFLAGS (which we use for running the compiler here)
+### and REAL_CFLAGS (which we use for real compilation).
+### The two are the same except when using GCC where we might use
+### extra warning and profiling flags.
+
+### If the CFLAGS env var is specified, we use that value
+### instead of the default.
+
 if test "x$SPECIFIED_CFLAGS" = x; then
-  eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \
-	 | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
+  CFLAGS="-g $C_OPTIMIZE_SWITCH"
+  if test x$GCC = xyes; then
+    REAL_CFLAGS="$CFLAGS $C_WARNINGS_SWITCH $PROFILING_CFLAGS"
+  else
+    REAL_CFLAGS="$CFLAGS"
+  fi
 else
   REAL_CFLAGS="$CFLAGS"
 fi
-rm ${tempcname}
-
+
+
+CANNOT_DUMP=no
+case "$opsys" in
+  your-opsys-here)
+   CANNOT_DUMP=yes
+
+$as_echo "#define CANNOT_DUMP 1" >>confdefs.h
+
+  ;;
+esac
 
 
 
@@ -5956,7 +5895,7 @@
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
-
+ have_sound_header=yes
 fi
 
 done
@@ -6157,6 +6096,17 @@
 
   fi
 
+        if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then
+     case "$opsys" in
+              gnu-linux|freebsd|netbsd)
+
+$as_echo "#define HAVE_SOUND 1" >>confdefs.h
+
+         ;;
+     esac
+  fi
+
+
 fi
 
 for ac_header in sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
@@ -7623,7 +7573,17 @@
   doug_lea_malloc=no
 fi
 
+
+system_malloc=no
+case "$opsys" in
+  ## darwin ld insists on the use of malloc routines in the System framework.
+  darwin|sol2-10) system_malloc=yes ;;
+esac
+
 if test "${system_malloc}" = "yes"; then
+
+$as_echo "#define SYSTEM_MALLOC 1" >>confdefs.h
+
   GNU_MALLOC=no
   GNU_MALLOC_reason="
     (The GNU allocators don't work with this system configuration.)"
@@ -7658,6 +7618,10 @@
   REL_ALLOC=${GNU_MALLOC}
 fi
 
+use_mmap_for_buffers=no
+case "$opsys" in
+  freebsd|irix6-5) use_mmap_for_buffers=yes ;;
+esac
 
 
 
@@ -7861,6 +7825,9 @@
 rm -f conftest.mmap conftest.txt
 
 if test $use_mmap_for_buffers = yes; then
+
+$as_echo "#define USE_MMAP_FOR_BUFFERS 1" >>confdefs.h
+
   REL_ALLOC=no
 fi
 
@@ -8054,7 +8021,7 @@
 if test "${HAVE_X11}" = "yes"; then
   DEFS="$C_SWITCH_X_SITE $DEFS"
   LDFLAGS="$LDFLAGS $LD_SWITCH_X_SITE"
-  LIBS="$LIBX $LIBS"
+  LIBS="-lX11 $LIBS"
   CFLAGS="$C_SWITCH_X_SITE $CFLAGS"
   CPPFLAGS="$C_SWITCH_X_SITE $CPPFLAGS"
 
@@ -8216,6 +8183,18 @@
 
 $as_echo "#define HAVE_X11R6 1" >>confdefs.h
 
+
+$as_echo "#define HAVE_X_I18N 1" >>confdefs.h
+
+    ## inoue@ainet.or.jp says Solaris has a bug related to X11R6-style
+    ## XIM support.
+    case "$opsys" in
+      sol2-*) : ;;
+      *)
+$as_echo "#define HAVE_X11R6_XIM 1" >>confdefs.h
+
+         ;;
+    esac
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: before 6" >&5
 $as_echo "before 6" >&6; }
--- a/configure.in	Tue Jun 29 11:41:29 2010 +0900
+++ b/configure.in	Wed Jun 30 15:51:39 2010 +0900
@@ -710,14 +710,12 @@
   CC="$NON_GNU_CC"
 fi
 
-if test x$GCC = xyes && test "x$GCC_TEST_OPTIONS" != x
-then
-  CC="$CC $GCC_TEST_OPTIONS"
-fi
-
-if test x$GCC = x && test "x$NON_GCC_TEST_OPTIONS" != x
-then
-  CC="$CC $NON_GCC_TEST_OPTIONS"
+if test x$GCC = xyes; then
+  C_OPTIMIZE_SWITCH=-O2
+  test "x$GCC_TEST_OPTIONS" != x && CC="$CC $GCC_TEST_OPTIONS"
+else
+  C_OPTIMIZE_SWITCH=-O
+  test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
 fi
 
 dnl checks for Unix variants
@@ -838,101 +836,47 @@
   LDFLAGS=$late_LDFLAGS
   [AC_MSG_RESULT(no)])
 
-#### Extract some information from the operating system and machine files.
-
-AC_CHECKING([the machine- and system-dependent files to find out
- - which libraries the lib-src programs will want, and
- - whether the GNU malloc routines are usable])
-
-### First figure out CFLAGS (which we use for running the compiler here)
-### and REAL_CFLAGS (which we use for real compilation).
-### The two are the same except on a few systems, where they are made
-### different to work around various lossages.  For example,
-### GCC 2.5 on GNU/Linux needs them to be different because it treats -g
-### as implying static linking.
-
-### If the CFLAGS env var is specified, we use that value
-### instead of the default.
-
-### It's not important that this name contain the PID; you can't run
-### two configures in the same directory and have anything work
-### anyway.
-tempcname="conftest.c"
-
-echo '
-#include "'${srcdir}'/src/'${opsysfile}'"
-#include "'${srcdir}'/src/'${machfile}'"
-
-configure___ LIBX=-lX11
-
-#ifdef CANNOT_DUMP
-configure___ cannot_dump=yes
-#else
-configure___ cannot_dump=no
-#endif
-
-#ifdef SYSTEM_MALLOC
-configure___ system_malloc=yes
-#else
-configure___ system_malloc=no
-#endif
-
-#ifdef USE_MMAP_FOR_BUFFERS
-configure___ use_mmap_for_buffers=yes
-#else
-configure___ use_mmap_for_buffers=no
-#endif
-
-#ifndef C_OPTIMIZE_SWITCH
-#ifdef __GNUC__
-#define C_OPTIMIZE_SWITCH -O2
-#else
-#define C_OPTIMIZE_SWITCH -O
-#endif
-#endif
-
-#ifndef C_WARNINGS_SWITCH
-#define C_WARNINGS_SWITCH ${C_WARNINGS_SWITCH}
-#endif
-
-#ifdef THIS_IS_CONFIGURE
-
-/* Get the CFLAGS for tests in configure.  */
-#ifdef __GNUC__
-configure___ CFLAGS=-g C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
-#else
-configure___ CFLAGS='${SPECIFIED_CFLAGS}'
-#endif
-
-#else /* not THIS_IS_CONFIGURE */
-
-/* Get the CFLAGS for real compilation.  */
-#ifdef __GNUC__
-configure___ REAL_CFLAGS=-g C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}'
-#else
-configure___ REAL_CFLAGS='${SPECIFIED_CFLAGS}'
-#endif
-
-#endif /* not THIS_IS_CONFIGURE */
-' > ${tempcname}
-
 LDFLAGS="${LDFLAGS} ${PROFILING_LDFLAGS}"
 
+
 # The value of CPP is a quoted variable reference, so we need to do this
 # to get its actual value...
 CPP=`eval "echo $CPP"`
-[eval `${CPP} -Isrc ${tempcname} \
-       | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
+
+
+### First figure out CFLAGS (which we use for running the compiler here)
+### and REAL_CFLAGS (which we use for real compilation).
+### The two are the same except when using GCC where we might use
+### extra warning and profiling flags.
+
+### If the CFLAGS env var is specified, we use that value
+### instead of the default.
+
+dnl Note AC_PROG_CC sets CFLAGS to -g -O2 for gcc anyway.
 if test "x$SPECIFIED_CFLAGS" = x; then
-  eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \
-	 | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
+  CFLAGS="-g $C_OPTIMIZE_SWITCH"
+  if test x$GCC = xyes; then
+    REAL_CFLAGS="$CFLAGS $C_WARNINGS_SWITCH $PROFILING_CFLAGS"
+  else
+    REAL_CFLAGS="$CFLAGS"
+  fi
 else
   REAL_CFLAGS="$CFLAGS"
-fi]
-rm ${tempcname}
-
-
-AC_SUBST(cannot_dump)
+fi
+
+
+dnl Not used by any currently supported platform.
+dnl The function dump-emacs will not be defined and temacs will do
+dnl (load "loadup") automatically unless told otherwise.
+CANNOT_DUMP=no
+case "$opsys" in
+  your-opsys-here)
+   CANNOT_DUMP=yes
+   AC_DEFINE(CANNOT_DUMP, 1, [Define if Emacs cannot be dumped on your system.])
+  ;;
+esac
+AC_SUBST(CANNOT_DUMP)
+
 
 UNEXEC_OBJ=unexelf.o
 case "$opsys" in
@@ -1206,7 +1150,8 @@
 
 if test "${with_sound}" != "no"; then
   # Sound support for GNU/Linux and the free BSDs.
-  AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h)
+  AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h, 
+    have_sound_header=yes)
   # Emulation library used on NetBSD.
   AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=)
   AC_SUBST(LIBSOUND)
@@ -1239,6 +1184,19 @@
     CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS"
     AC_DEFINE(HAVE_ALSA, 1, [Define to 1 if ALSA is available.])
   fi
+
+  dnl Define HAVE_SOUND if we have sound support.  We know it works and
+  dnl compiles only on the specified platforms.  For others, it
+  dnl probably doesn't make sense to try.
+  if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then
+     case "$opsys" in
+       dnl defined __FreeBSD__ || defined __NetBSD__ || defined __linux__
+       gnu-linux|freebsd|netbsd)
+         AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.])
+         ;;
+     esac
+  fi
+
   AC_SUBST(CFLAGS_SOUND)
 fi
 
@@ -1647,7 +1605,16 @@
   doug_lea_malloc=no
 fi
 
+
+dnl See comments in aix4-2.h about maybe using system malloc there.
+system_malloc=no
+case "$opsys" in
+  ## darwin ld insists on the use of malloc routines in the System framework.
+  darwin|sol2-10) system_malloc=yes ;;
+esac
+
 if test "${system_malloc}" = "yes"; then
+  AC_DEFINE(SYSTEM_MALLOC, 1, [Define to use system malloc.])
   GNU_MALLOC=no
   GNU_MALLOC_reason="
     (The GNU allocators don't work with this system configuration.)"
@@ -1681,12 +1648,14 @@
   REL_ALLOC=${GNU_MALLOC}
 fi
 
-dnl For now, need to use an explicit `#define USE_MMAP_FOR_BUFFERS 1'
-dnl the system configuration file (s/*.h) to turn the use of mmap
-dnl in the relocating allocator on.
+use_mmap_for_buffers=no
+case "$opsys" in
+  freebsd|irix6-5) use_mmap_for_buffers=yes ;;
+esac
 
 AC_FUNC_MMAP
 if test $use_mmap_for_buffers = yes; then
+  AC_DEFINE(USE_MMAP_FOR_BUFFERS, 1, [Define to use mmap to allocate buffer text.])
   REL_ALLOC=no
 fi
 
@@ -1741,7 +1710,7 @@
 if test "${HAVE_X11}" = "yes"; then
   DEFS="$C_SWITCH_X_SITE $DEFS"
   LDFLAGS="$LDFLAGS $LD_SWITCH_X_SITE"
-  LIBS="$LIBX $LIBS"
+  LIBS="-lX11 $LIBS"
   CFLAGS="$C_SWITCH_X_SITE $CFLAGS"
   CPPFLAGS="$C_SWITCH_X_SITE $CPPFLAGS"
 
@@ -1817,6 +1786,15 @@
     AC_MSG_RESULT(6 or newer)
     AC_DEFINE(HAVE_X11R6, 1,
 	      [Define to 1 if you have the X11R6 or newer version of Xlib.])
+    AC_DEFINE(HAVE_X_I18N, 1, [Define if you have usable i18n support.])
+    ## inoue@ainet.or.jp says Solaris has a bug related to X11R6-style
+    ## XIM support.
+    case "$opsys" in
+      sol2-*) : ;;
+      *) AC_DEFINE(HAVE_X11R6_XIM, 1,
+           [Define if you have usable X11R6-style XIM support.])
+         ;;
+    esac
   else
     AC_MSG_RESULT(before 6)
   fi
@@ -3493,25 +3471,6 @@
 /* Turned on June 1996 supposing nobody will mind it.  */
 #define AMPERSAND_FULL_NAME
 
-/* Define HAVE_SOUND if we have sound support.  We know it works
-   and compiles only on the specified platforms.   For others,
-   it probably doesn't make sense to try.  */
-
-#if defined __FreeBSD__ || defined __NetBSD__ || defined __linux__
-#ifdef HAVE_MACHINE_SOUNDCARD_H
-#define HAVE_SOUND 1
-#endif
-#ifdef HAVE_SYS_SOUNDCARD_H
-#define HAVE_SOUND 1
-#endif
-#ifdef HAVE_SOUNDCARD_H
-#define HAVE_SOUND 1
-#endif
-#ifdef HAVE_ALSA
-#define HAVE_SOUND 1
-#endif
-#endif /* __FreeBSD__ || __NetBSD__ || __linux__  */
-
 /* If using GNU, then support inline function declarations.  */
 /* Don't try to switch on inline handling as detected by AC_C_INLINE
    generally, because even if non-gcc compilers accept `inline', they
@@ -3602,9 +3561,8 @@
 #endif
 #endif
 
-/* Define if the compiler supports function prototypes.  It may do so
-   but not define __STDC__ (e.g. DEC C by default) or may define it as
-   zero.  */
+/* Define if the compiler supports function prototypes.  It may do so but
+   not define __STDC__ (e.g. DEC C by default) or may define it as zero.  */
 #undef PROTOTYPES
 /* For mktime.c:  */
 #ifndef __P
@@ -3645,18 +3603,6 @@
 typedef unsigned size_t;
 #endif
 
-/* Define HAVE_X_I18N if we have usable i18n support.  */
-
-#ifdef HAVE_X11R6
-#define HAVE_X_I18N
-#endif
-
-/* Define HAVE_X11R6_XIM if we have usable X11R6-style XIM support.  */
-
-#if defined HAVE_X11R6 && !defined INHIBIT_X11R6_XIM
-#define HAVE_X11R6_XIM
-#endif
-
 #if defined __GNUC__ && (__GNUC__ > 2 \
                          || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
 #define NO_RETURN	__attribute__ ((__noreturn__))
--- a/etc/DEBUG	Tue Jun 29 11:41:29 2010 +0900
+++ b/etc/DEBUG	Wed Jun 30 15:51:39 2010 +0900
@@ -5,9 +5,8 @@
 See the end of the file for license conditions.
 
 
-[People who debug Emacs on Windows using Microsoft debuggers
-should read the Windows-specific section near the end of this
-document.]
+[People who debug Emacs on Windows using Microsoft debuggers should
+read the Windows-specific section near the end of this document.]
 
 ** When you debug Emacs with GDB, you should start it in the directory
 where the executable was made.  That directory has a .gdbinit file
@@ -50,8 +49,7 @@
    handle SIGINT stop nopass
 
 After this `handle' command, SIGINT will return control to GDB.  If
-you want the C-g to cause a QUIT within Emacs as well, omit the
-`nopass'.
+you want the C-g to cause a QUIT within Emacs as well, omit the `nopass'.
 
 A technique that can work when `handle SIGINT' does not is to store
 the code for some character into the variable stop_character.  Thus,
@@ -443,10 +441,9 @@
 numeric addresses into symbols and vice versa.
 
 It is useful to be running under a window system.
-Then, if Emacs becomes hopelessly wedged, you can create
-another window to do kill -9 in.  kill -ILL is often
-useful too, since that may make Emacs dump core or return
-to adb.
+Then, if Emacs becomes hopelessly wedged, you can create another
+window to do kill -9 in.  kill -ILL is often useful too, since that
+may make Emacs dump core or return to adb.
 
 
 ** Debugging incorrect screen updating.
@@ -483,16 +480,14 @@
 Building Emacs like that activates many assertions which scrutinize
 display code operation more than Emacs does normally.  (To see the
 code which tests these assertions, look for calls to the `xassert'
-macros.)  Any assertion that is reported to fail should be
-investigated.
+macros.)  Any assertion that is reported to fail should be investigated.
 
 Building with GLYPH_DEBUG defined also defines several helper
 functions which can help debugging display code.  One such function is
 `dump_glyph_matrix'.  If you run Emacs under GDB, you can print the
 contents of any glyph matrix by just calling that function with the
 matrix as its argument.  For example, the following command will print
-the contents of the current matrix of the window whose pointer is in
-`w':
+the contents of the current matrix of the window whose pointer is in `w':
 
   (gdb) p dump_glyph_matrix (w->current_matrix, 2)
 
@@ -621,13 +616,9 @@
 because Emacs replaces the system's memory allocation functions with
 its own versions, and because the dumping process might be
 incompatible with the way these packages use to track allocated
-memory.  Here are some of the changes you might find necessary
-(SYSTEM-NAME and MACHINE-NAME are the names of your OS- and
-CPU-specific headers in the subdirectories of `src'):
+memory.  Here are some of the changes you might find necessary:
 
-  - In src/s/SYSTEM-NAME.h add "#define SYSTEM_MALLOC".
-
-  - In src/m/MACHINE-NAME.h add "#define CANNOT_DUMP"
+  - Edit configure, to set system_malloc and CANNOT_DUMP to "yes".
 
   - Configure with a different --prefix= option.  If you use GCC,
     version 2.7.2 is preferred, as some malloc debugging packages
--- a/lisp/ChangeLog	Tue Jun 29 11:41:29 2010 +0900
+++ b/lisp/ChangeLog	Wed Jun 30 15:51:39 2010 +0900
@@ -1,3 +1,12 @@
+2010-06-29  Chong Yidong  <cyd@stupidchicken.com>
+
+	* vc/vc.el (vc-deduce-backend): New fun.  Handle diff buffers.
+	(vc-root-diff, vc-print-root-log, vc-log-incoming)
+	(vc-log-outgoing): Use it.
+	(vc-diff-internal): Set diff-vc-backend.
+
+	* vc/diff-mode.el (diff-vc-backend): New var.
+
 2010-06-28  Jan Djärv  <jan.h.d@swipnet.se>
 
 	* dynamic-setting.el (font-setting-change-default-font): Remove
--- a/lisp/vc/diff-mode.el	Tue Jun 29 11:41:29 2010 +0900
+++ b/lisp/vc/diff-mode.el	Wed Jun 30 15:51:39 2010 +0900
@@ -97,6 +97,9 @@
   :options '(diff-delete-empty-files diff-make-unified)
   :group 'diff-mode)
 
+(defvar diff-vc-backend nil
+  "The VC backend that created the current Diff buffer, if any.")
+
 (defvar diff-outline-regexp
   "\\([*+][*+][*+] [^0-9]\\|@@ ...\\|\\*\\*\\* [0-9].\\|--- [0-9]..\\)")
 
--- a/lisp/vc/vc.el	Tue Jun 29 11:41:29 2010 +0900
+++ b/lisp/vc/vc.el	Wed Jun 30 15:51:39 2010 +0900
@@ -913,6 +913,16 @@
     (nreverse flattened)))
 
 (defvar vc-dir-backend)
+(defvar log-view-vc-backend)
+(defvar diff-vc-backend)
+
+(defun vc-deduce-backend ()
+  (cond ((derived-mode-p 'vc-dir-mode)   vc-dir-backend)
+	((derived-mode-p 'log-view-mode) log-view-vc-backend)
+	((derived-mode-p 'diff-mode)     diff-vc-backend)
+	((derived-mode-p 'dired-mode)
+	 (vc-responsible-backend default-directory))
+	(vc-mode (vc-backend buffer-file-name))))
 
 (declare-function vc-dir-current-file "vc-dir" ())
 (declare-function vc-dir-deduce-fileset "vc-dir" (&optional state-model-only-files))
@@ -1547,6 +1557,7 @@
           (message "%s" (cdr messages))
           nil)
       (diff-mode)
+      (set (make-local-variable 'diff-vc-backend) (car vc-fileset))
       (set (make-local-variable 'revert-buffer-function)
 	   `(lambda (ignore-auto noconfirm)
 	      (vc-diff-internal ,async ',vc-fileset ,rev1 ,rev2 ,verbose)))
@@ -1656,10 +1667,7 @@
       ;; that's not what we want here, we want the diff for the VC root dir.
       (call-interactively 'vc-version-diff)
     (when buffer-file-name (vc-buffer-sync not-urgent))
-    (let ((backend
-	   (cond ((derived-mode-p 'vc-dir-mode)  vc-dir-backend)
-		 ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory))
-		 (vc-mode (vc-backend buffer-file-name))))
+    (let ((backend (vc-deduce-backend))
 	  rootdir working-revision)
       (unless backend
 	(error "Buffer is not version controlled"))
@@ -1956,7 +1964,6 @@
 If it contains `file' then show short logs for files.
 Not all VC backends support short logs!")
 
-(defvar log-view-vc-backend)
 (defvar log-view-vc-fileset)
 
 (defun vc-print-log-setup-buttons (working-revision is-start-revision limit pl-return)
@@ -2105,10 +2112,7 @@
        (list lim)))
     (t
      (list (when (> vc-log-show-limit 0) vc-log-show-limit)))))
-  (let ((backend
-	 (cond ((derived-mode-p 'vc-dir-mode)  vc-dir-backend)
-	       ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory))
-	       (vc-mode (vc-backend buffer-file-name))))
+  (let ((backend (vc-deduce-backend))
 	rootdir working-revision)
     (unless backend
       (error "Buffer is not version controlled"))
@@ -2120,10 +2124,7 @@
 (defun vc-log-incoming (&optional remote-location)
   "Show a log of changes that will be received with a pull operation from REMOTE-LOCATION."
   (interactive "sRemote location (empty for default): ")
-  (let ((backend
-	 (cond ((derived-mode-p 'vc-dir-mode)  vc-dir-backend)
-	       ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory))
-	       (vc-mode (vc-backend buffer-file-name))))
+  (let ((backend (vc-deduce-backend))
 	rootdir working-revision)
     (unless backend
       (error "Buffer is not version controlled"))
@@ -2133,10 +2134,7 @@
 (defun vc-log-outgoing (&optional remote-location)
   "Show a log of changes that will be sent with a push operation to REMOTE-LOCATION."
   (interactive "sRemote location (empty for default): ")
-  (let ((backend
-	 (cond ((derived-mode-p 'vc-dir-mode)  vc-dir-backend)
-	       ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory))
-	       (vc-mode (vc-backend buffer-file-name))))
+  (let ((backend (vc-deduce-backend))
 	rootdir working-revision)
     (unless backend
       (error "Buffer is not version controlled"))
--- a/msdos/ChangeLog	Tue Jun 29 11:41:29 2010 +0900
+++ b/msdos/ChangeLog	Wed Jun 30 15:51:39 2010 +0900
@@ -1,3 +1,7 @@
+2010-06-30  Glenn Morris  <rgm@gnu.org>
+
+	* sed1v2.inp (CANNOT_DUMP): Update for configure name change.
+
 2010-06-26  Eli Zaretskii  <eliz@gnu.org>
 
 	* mainmake.v2 (version): Use emacs_version[] in src/emacs.c
--- a/msdos/sed1v2.inp	Tue Jun 29 11:41:29 2010 +0900
+++ b/msdos/sed1v2.inp	Wed Jun 30 15:51:39 2010 +0900
@@ -116,7 +116,7 @@
 /^PRE_ALLOC_OBJ *=/s/@PRE_ALLOC_OBJ@/lastfile.o/
 /^POST_ALLOC_OBJ *=/s/@POST_ALLOC_OBJ@/$(vmlimitobj)/
 /^UNEXEC_OBJ *=/s/@UNEXEC_OBJ@/unexec.o/
-/^CANNOT_DUMP *=/s/@cannot_dump@/no/
+/^CANNOT_DUMP *=/s/@CANNOT_DUMP@/no/
 /^DEPFLAGS *=/s/@DEPFLAGS@//
 /^MKDEPDIR *=/s/@MKDEPDIR@//
 /^version *=/s/@[^@\n]*@//
--- a/src/ChangeLog	Tue Jun 29 11:41:29 2010 +0900
+++ b/src/ChangeLog	Wed Jun 30 15:51:39 2010 +0900
@@ -1,3 +1,20 @@
+2010-06-30  Glenn Morris  <rgm@gnu.org>
+
+	* s/sol2-6.h (INHIBIT_X11R6_XIM): Remove, handled by configure now.
+
+	* Makefile.in (CANNOT_DUMP): Update for configure name change.
+
+	* s/freebsd.h (USE_MMAP_FOR_BUFFERS):
+	* s/irix6-5.h (USE_MMAP_FOR_BUFFERS):
+	* s/darwin.h (SYSTEM_MALLOC):
+	* s/sol2-10.h (SYSTEM_MALLOC): Move to configure.
+
+2010-06-29  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* nsfns.m: extern declare Vmenu_bar_mode, Vtool_bar_mode.
+	(ns_get_screen): Don't assign integer to f.
+	(Fx_display_color_cells): Declarations before statements.
+
 2010-06-28  Jan Djärv  <jan.h.d@swipnet.se>
 
 	* xfns.c (x_default_font_parameter): Remove got_from_system
--- a/src/Makefile.in	Tue Jun 29 11:41:29 2010 +0900
+++ b/src/Makefile.in	Wed Jun 30 15:51:39 2010 +0900
@@ -283,7 +283,7 @@
 
 UNEXEC_OBJ = @UNEXEC_OBJ@
 
-CANNOT_DUMP=@cannot_dump@
+CANNOT_DUMP=@CANNOT_DUMP@
 
 DEPDIR=deps
 ## -MMD -MF ${DEPDIR}/$*.d if AUTO_DEPEND; else empty.
--- a/src/config.in	Tue Jun 29 11:41:29 2010 +0900
+++ b/src/config.in	Wed Jun 30 15:51:39 2010 +0900
@@ -30,6 +30,9 @@
 /* Define to 1 if the mktime function is broken. */
 #undef BROKEN_MKTIME
 
+/* Define if Emacs cannot be dumped on your system. */
+#undef CANNOT_DUMP
+
 /* 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.
    */
@@ -585,6 +588,9 @@
 /* Define to 1 if the system has the type `size_t'. */
 #undef HAVE_SIZE_T
 
+/* Define to 1 if you have sound support. */
+#undef HAVE_SOUND
+
 /* Define to 1 if you have the <soundcard.h> header file. */
 #undef HAVE_SOUNDCARD_H
 
@@ -762,6 +768,9 @@
 /* Define to 1 if you have the X11R6 or newer version of Xlib. */
 #undef HAVE_X11R6
 
+/* Define if you have usable X11R6-style XIM support. */
+#undef HAVE_X11R6_XIM
+
 /* Define to 1 if you have the X11R6 or newer version of Xt. */
 #undef HAVE_X11XTR6
 
@@ -792,6 +801,9 @@
 /* Define to 1 if you have the `XSetWMProtocols' function. */
 #undef HAVE_XSETWMPROTOCOLS
 
+/* Define if you have usable i18n support. */
+#undef HAVE_X_I18N
+
 /* Define to 1 if you have the SM library (-lSM). */
 #undef HAVE_X_SM
 
@@ -899,6 +911,9 @@
 /* Process async input synchronously. */
 #undef SYNC_INPUT
 
+/* Define to use system malloc. */
+#undef SYSTEM_MALLOC
+
 /* Define to 1 if you use terminfo instead of termcap. */
 #undef TERMINFO
 
@@ -921,6 +936,9 @@
 /* Define to 1 if using the Lucid X toolkit. */
 #undef USE_LUCID
 
+/* Define to use mmap to allocate buffer text. */
+#undef USE_MMAP_FOR_BUFFERS
+
 /* Define to 1 if using the Motif X toolkit. */
 #undef USE_MOTIF
 
@@ -1027,25 +1045,6 @@
 /* Turned on June 1996 supposing nobody will mind it.  */
 #define AMPERSAND_FULL_NAME
 
-/* Define HAVE_SOUND if we have sound support.  We know it works
-   and compiles only on the specified platforms.   For others,
-   it probably doesn't make sense to try.  */
-
-#if defined __FreeBSD__ || defined __NetBSD__ || defined __linux__
-#ifdef HAVE_MACHINE_SOUNDCARD_H
-#define HAVE_SOUND 1
-#endif
-#ifdef HAVE_SYS_SOUNDCARD_H
-#define HAVE_SOUND 1
-#endif
-#ifdef HAVE_SOUNDCARD_H
-#define HAVE_SOUND 1
-#endif
-#ifdef HAVE_ALSA
-#define HAVE_SOUND 1
-#endif
-#endif /* __FreeBSD__ || __NetBSD__ || __linux__  */
-
 /* If using GNU, then support inline function declarations.  */
 /* Don't try to switch on inline handling as detected by AC_C_INLINE
    generally, because even if non-gcc compilers accept `inline', they
@@ -1136,9 +1135,8 @@
 #endif
 #endif
 
-/* Define if the compiler supports function prototypes.  It may do so
-   but not define __STDC__ (e.g. DEC C by default) or may define it as
-   zero.  */
+/* Define if the compiler supports function prototypes.  It may do so but
+   not define __STDC__ (e.g. DEC C by default) or may define it as zero.  */
 #undef PROTOTYPES
 /* For mktime.c:  */
 #ifndef __P
@@ -1179,18 +1177,6 @@
 typedef unsigned size_t;
 #endif
 
-/* Define HAVE_X_I18N if we have usable i18n support.  */
-
-#ifdef HAVE_X11R6
-#define HAVE_X_I18N
-#endif
-
-/* Define HAVE_X11R6_XIM if we have usable X11R6-style XIM support.  */
-
-#if defined HAVE_X11R6 && !defined INHIBIT_X11R6_XIM
-#define HAVE_X11R6_XIM
-#endif
-
 #if defined __GNUC__ && (__GNUC__ > 2 \
                          || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
 #define NO_RETURN	__attribute__ ((__noreturn__))
--- a/src/m/alpha.h	Tue Jun 29 11:41:29 2010 +0900
+++ b/src/m/alpha.h	Wed Jun 30 15:51:39 2010 +0900
@@ -47,19 +47,6 @@
 /* Convert that into an integer that is 100 for a load average of 1.0  */
 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
 
-/* GNU malloc and the relocating allocator do not work together
-   with X.   [Who wrote that?]  */
-
-/* May 1995: reportedly [Rainer Schoepf <schoepf@uni-mainz.de>] both the
-   system and the gnu malloc system work with "alpha-dec-osf3.0" and
-   "alpha-dec-osf3.2".  */
-
-/* May 1995: it seems to me [Morten Welinder <terra@diku.dk>] that both
-   mallocs work with "alpha-dec-osf2.0", but I daren't break anything
-   right now.  Feel free to play if you want.  */
-
-/* #define SYSTEM_MALLOC */
-
 #ifdef __ELF__
 
 #if !defined(GNU_LINUX) && !defined(__NetBSD__)
--- a/src/m/template.h	Tue Jun 29 11:41:29 2010 +0900
+++ b/src/m/template.h	Wed Jun 30 15:51:39 2010 +0900
@@ -39,11 +39,6 @@
 /* Convert that into an integer that is 100 for a load average of 1.0  */
 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
 
-/* Define CANNOT_DUMP on machines where unexec does not work.
-   Then the function dump-emacs will not be defined
-   and temacs will do (load "loadup") automatically unless told otherwise.  */
-#define CANNOT_DUMP
-
 /* Define VIRT_ADDR_VARIES if the virtual addresses of
    pure and impure space as loaded can vary, and even their
    relative order cannot be relied on.
--- a/src/nsfns.m	Tue Jun 29 11:41:29 2010 +0900
+++ b/src/nsfns.m	Wed Jun 30 15:51:39 2010 +0900
@@ -83,6 +83,10 @@
 extern Lisp_Object Qnone;
 extern Lisp_Object Vframe_title_format;
 
+/* The below are defined in frame.c.  */
+
+extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
+
 Lisp_Object Qbuffered;
 Lisp_Object Qfontsize;
 
@@ -224,7 +228,8 @@
   else
     {
       struct ns_display_info *dpyinfo = terminal->display_info.ns;
-      f = (dpyinfo->x_focus_frame || dpyinfo->x_highlight_frame);
+      f = dpyinfo->x_focus_frame
+        ? dpyinfo->x_focus_frame : dpyinfo->x_highlight_frame;
     }
 
   return ((f && FRAME_NS_P (f)) ? [[FRAME_NS_VIEW (f) window] screen]
@@ -2381,9 +2386,10 @@
      (display)
      Lisp_Object display;
 {
+  struct ns_display_info *dpyinfo;
   check_ns ();
-  struct ns_display_info *dpyinfo = check_ns_display_info (display);
-
+  
+  dpyinfo = check_ns_display_info (display);
   /* We force 24+ bit depths to 24-bit to prevent an overflow.  */
   return make_number (1 << min (dpyinfo->n_planes, 24));
 }
--- a/src/s/aix4-2.h	Tue Jun 29 11:41:29 2010 +0900
+++ b/src/s/aix4-2.h	Wed Jun 30 15:51:39 2010 +0900
@@ -89,8 +89,8 @@
    memory use the libc malloc implementation. Calling xfree or
    xrealloc on the results of such functions results in a crash.
 
-   One solution for this could be to define SYSTEM_MALLOC here, but
-   that does not currently work on this system.
+   One solution for this could be to define SYSTEM_MALLOC in configure,
+   but that does not currently work on this system.
 
    It is possible to completely override the malloc implementation on
    AIX, but that involves putting the malloc functions in a shared
--- a/src/s/darwin.h	Tue Jun 29 11:41:29 2010 +0900
+++ b/src/s/darwin.h	Wed Jun 30 15:51:39 2010 +0900
@@ -114,9 +114,6 @@
 /* System uses OXTABS instead of the expected TAB3.  (Copied from bsd386.h.)  */
 #define TAB3 OXTABS
 
-/* Darwin ld insists on the use of malloc routines in the System framework.  */
-#define SYSTEM_MALLOC
-
 /* Define HAVE_SOCKETS if system supports 4.2-compatible sockets.  */
 #define HAVE_SOCKETS
 
--- a/src/s/freebsd.h	Tue Jun 29 11:41:29 2010 +0900
+++ b/src/s/freebsd.h	Wed Jun 30 15:51:39 2010 +0900
@@ -67,9 +67,5 @@
 /* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the stack.  */
 #define GC_MARK_STACK 	GC_MAKE_GCPROS_NOOPS
 
-/* Define USE_MMAP_FOR_BUFFERS to let Emacs use mmap(2) to allocate
-   buffer text.  This overrides REL_ALLOC.  */
-#define USE_MMAP_FOR_BUFFERS	1
-
 /* arch-tag: 426529ca-b7c4-448f-b10a-d4dcdc9c78eb
    (do not change this comment) */
--- a/src/s/irix6-5.h	Tue Jun 29 11:41:29 2010 +0900
+++ b/src/s/irix6-5.h	Wed Jun 30 15:51:39 2010 +0900
@@ -85,8 +85,6 @@
 
 #define NARROWPROTO 1
 
-#define USE_MMAP_FOR_BUFFERS 1
-
 #if _MIPS_SZLONG == 64		/* -mabi=64 (gcc) or -64 (MIPSpro) */
 #define _LP64			/* lisp.h takes care of the rest */
 #endif /* _MIPS_SZLONG */
--- a/src/s/sol2-10.h	Tue Jun 29 11:41:29 2010 +0900
+++ b/src/s/sol2-10.h	Wed Jun 30 15:51:39 2010 +0900
@@ -2,8 +2,6 @@
 
 #include "sol2-6.h"
 
-#define SYSTEM_MALLOC
-
 /* This is used in list_system_processes.  */
 #define HAVE_PROCFS 1
 
--- a/src/s/sol2-6.h	Tue Jun 29 11:41:29 2010 +0900
+++ b/src/s/sol2-6.h	Wed Jun 30 15:51:39 2010 +0900
@@ -34,10 +34,6 @@
 #define HAVE_LIBKSTAT
 #endif
 
-/* inoue@ainet.or.jp says Solaris has a bug related to X11R6-style
-   XIM support.  */
-#define INHIBIT_X11R6_XIM
-
 /* This is the same definition as in usg5-4.h, but with sigblock/sigunblock
    rather than sighold/sigrelse, which appear to be BSD4.1 specific.
    It may also be appropriate for SVR4.x
--- a/src/s/template.h	Tue Jun 29 11:41:29 2010 +0900
+++ b/src/s/template.h	Wed Jun 30 15:51:39 2010 +0900
@@ -108,9 +108,6 @@
    is not ':', #define this to be the appropriate character constant.  */
 /* #define SEPCHAR ':' */
 
-/* Define this if the system can use mmap for buffer text allocation.  */
-/* #define USE_MMAP_FOR_BUFFERS 1 */
-
 /* ============================================================ */
 
 /* Here, add any special hacks needed to make Emacs work on this