changeset 109421:10cf940285f9

Merge from mainline.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Wed, 30 Jun 2010 22:57:08 +0000
parents c166807ffc89 (current diff) 9e474f641740 (diff)
children bcedeeedc5fb
files
diffstat 24 files changed, 279 insertions(+), 345 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jun 29 22:51:37 2010 +0000
+++ b/ChangeLog	Wed Jun 30 22:57:08 2010 +0000
@@ -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 22:51:37 2010 +0000
+++ b/admin/CPP-DEFINES	Wed Jun 30 22:57:08 2010 +0000
@@ -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 22:51:37 2010 +0000
+++ b/configure	Wed Jun 30 22:57:08 2010 +0000
@@ -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 22:51:37 2010 +0000
+++ b/configure.in	Wed Jun 30 22:57:08 2010 +0000
@@ -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 22:51:37 2010 +0000
+++ b/etc/DEBUG	Wed Jun 30 22:57:08 2010 +0000
@@ -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 22:51:37 2010 +0000
+++ b/lisp/ChangeLog	Wed Jun 30 22:57:08 2010 +0000
@@ -1,3 +1,9 @@
+2010-06-30  Chong Yidong  <cyd@stupidchicken.com>
+
+	* ruler-mode.el (ruler--save-header-line-format): New fun.
+	(ruler-mode): Use it as a setter function, so as not to overwrite
+	ruler-mode-header-line-format-old if Ruler mode is on (Bug#5370).
+
 2010-06-29  Chong Yidong  <cyd@stupidchicken.com>
 
 	* vc/vc.el (vc-deduce-backend): New fun.  Handle diff buffers.
--- a/lisp/ruler-mode.el	Tue Jun 29 22:51:37 2010 +0000
+++ b/lisp/ruler-mode.el	Wed Jun 30 22:57:08 2010 +0000
@@ -550,21 +550,37 @@
 Call `ruler-mode-ruler-function' to compute the ruler value.")
 
 ;;;###autoload
+(defvar ruler-mode nil
+  "Non-nil if Ruler mode is enabled.
+Use the command `ruler-mode' to change this variable.")
+(make-variable-buffer-local 'ruler-mode)
+
+(defun ruler--save-header-line-format ()
+  "Install the header line format for Ruler mode.
+Unless if Ruler mode is already enabled, save the old header line
+format first."
+  (when enable
+    (when (and (not ruler-mode)
+	       (local-variable-p 'header-line-format)
+	       (not (local-variable-p 'ruler-mode-header-line-format-old)))
+      (set (make-local-variable 'ruler-mode-header-line-format-old)
+	   header-line-format))
+    (setq header-line-format ruler-mode-header-line-format)))
+
+;;;###autoload
 (define-minor-mode ruler-mode
-  "Display a ruler in the header line if ARG > 0."
+  "Toggle Ruler mode.
+In Ruler mode, Emacs displays a ruler in the header line."
   nil nil
   ruler-mode-map
   :group 'ruler-mode
+  :variable (ruler-mode
+	     . (lambda (enable)
+		 (when enable
+		   (ruler--save-header-line-format))
+		 (setq ruler-mode enable)))
   (if ruler-mode
-      (progn
-        ;; When `ruler-mode' is on save previous header line format
-        ;; and install the ruler header line format.
-        (when (and (local-variable-p 'header-line-format)
-		   (not (local-variable-p 'ruler-mode-header-line-format-old)))
-          (set (make-local-variable 'ruler-mode-header-line-format-old)
-               header-line-format))
-        (setq header-line-format ruler-mode-header-line-format)
-        (add-hook 'post-command-hook 'force-mode-line-update nil t))
+      (add-hook 'post-command-hook 'force-mode-line-update nil t)
     ;; When `ruler-mode' is off restore previous header line format if
     ;; the current one is the ruler header line format.
     (when (eq header-line-format ruler-mode-header-line-format)
--- a/msdos/ChangeLog	Tue Jun 29 22:51:37 2010 +0000
+++ b/msdos/ChangeLog	Wed Jun 30 22:57:08 2010 +0000
@@ -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 22:51:37 2010 +0000
+++ b/msdos/sed1v2.inp	Wed Jun 30 22:57:08 2010 +0000
@@ -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 22:51:37 2010 +0000
+++ b/src/ChangeLog	Wed Jun 30 22:57:08 2010 +0000
@@ -1,3 +1,27 @@
+2010-06-30  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
+	Improve documentation.  Return font regardless of use_system_font.
+	(syms_of_xsettings): Improve documentation for font-use-system-font.
+
+2009-06-17  Naohiro Aota  <naota@elisp.net>  (tiny change)
+
+	* xftfont.c (xftfont_open): Check font width one by one also when
+	spacing is dual.
+
+	* ftfont.c (ftfont_open): Ditto.
+
+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.
--- a/src/Makefile.in	Tue Jun 29 22:51:37 2010 +0000
+++ b/src/Makefile.in	Wed Jun 30 22:57:08 2010 +0000
@@ -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 22:51:37 2010 +0000
+++ b/src/config.in	Wed Jun 30 22:57:08 2010 +0000
@@ -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/ftfont.c	Tue Jun 29 22:51:37 2010 +0000
+++ b/src/ftfont.c	Wed Jun 30 22:57:08 2010 +0000
@@ -1262,7 +1262,7 @@
     spacing = XINT (AREF (entity, FONT_SPACING_INDEX));
   else
     spacing = FC_PROPORTIONAL;
-  if (spacing != FC_PROPORTIONAL)
+  if (spacing != FC_PROPORTIONAL && spacing != FC_DUAL)
     font->min_width = font->average_width = font->space_width
       = (scalable ? ft_face->max_advance_width * size / upEM
 	 : ft_face->size->metrics.max_advance >> 6);
--- a/src/m/alpha.h	Tue Jun 29 22:51:37 2010 +0000
+++ b/src/m/alpha.h	Wed Jun 30 22:57:08 2010 +0000
@@ -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 22:51:37 2010 +0000
+++ b/src/m/template.h	Wed Jun 30 22:57:08 2010 +0000
@@ -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/s/aix4-2.h	Tue Jun 29 22:51:37 2010 +0000
+++ b/src/s/aix4-2.h	Wed Jun 30 22:57:08 2010 +0000
@@ -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 22:51:37 2010 +0000
+++ b/src/s/darwin.h	Wed Jun 30 22:57:08 2010 +0000
@@ -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 22:51:37 2010 +0000
+++ b/src/s/freebsd.h	Wed Jun 30 22:57:08 2010 +0000
@@ -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 22:51:37 2010 +0000
+++ b/src/s/irix6-5.h	Wed Jun 30 22:57:08 2010 +0000
@@ -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 22:51:37 2010 +0000
+++ b/src/s/sol2-10.h	Wed Jun 30 22:57:08 2010 +0000
@@ -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 22:51:37 2010 +0000
+++ b/src/s/sol2-6.h	Wed Jun 30 22:57:08 2010 +0000
@@ -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 22:51:37 2010 +0000
+++ b/src/s/template.h	Wed Jun 30 22:57:08 2010 +0000
@@ -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
--- a/src/xftfont.c	Tue Jun 29 22:51:37 2010 +0000
+++ b/src/xftfont.c	Wed Jun 30 22:57:08 2010 +0000
@@ -429,7 +429,7 @@
 	ascii_printable[i] = ' ' + i;
     }
   BLOCK_INPUT;
-  if (spacing != FC_PROPORTIONAL)
+  if (spacing != FC_PROPORTIONAL && spacing != FC_DUAL)
     {
       font->min_width = font->average_width = font->space_width
 	= xftfont->max_advance_width;
--- a/src/xsettings.c	Tue Jun 29 22:51:37 2010 +0000
+++ b/src/xsettings.c	Wed Jun 30 22:57:08 2010 +0000
@@ -719,20 +719,20 @@
 DEFUN ("font-get-system-normal-font", Ffont_get_system_normal_font,
        Sfont_get_system_normal_font,
        0, 0, 0,
-       doc: /* Get the system default font. */)
+       doc: /* Get the system default application font. */)
   ()
 {
-  return current_font && use_system_font
+  return current_font
     ? make_string (current_font, strlen (current_font))
     : Qnil;
 }
 
 DEFUN ("font-get-system-font", Ffont_get_system_font, Sfont_get_system_font,
        0, 0, 0,
-       doc: /* Get the system default monospaced font. */)
+       doc: /* Get the system default fixed width font. */)
   ()
 {
-  return current_mono_font && use_system_font
+  return current_mono_font
     ? make_string (current_mono_font, strlen (current_mono_font))
     : Qnil;
 }
@@ -774,7 +774,10 @@
   defsubr (&Sfont_get_system_normal_font);
 
   DEFVAR_BOOL ("font-use-system-font", &use_system_font,
-    doc: /* *Non-nil means to use the system defined font.  */);
+    doc: /* *Non-nil means to apply the system defined font dynamically.
+When this is non-nil and the system defined fixed width font changes, we
+update frames dynamically.
+If this variable is nil, Emacs ignores system font changes.  */);
   use_system_font = 0;
 
   DEFVAR_LISP ("xft-settings", &Vxft_settings,