Remove some cpp that is internal to configure.in.
authorGlenn Morris <rgm@gnu.org>
Wed, 30 Jun 2010 02:48:54 +0000 (19:48 -0700)
committerGlenn Morris <rgm@gnu.org>
Wed, 30 Jun 2010 02:48:54 +0000 (19:48 -0700)
* configure.in (C_OPTIMIZE_SWITCH, CANNOT_DUMP, SYSTEM_MALLOC):
(USE_MMAP_FOR_BUFFERS, C_WARNING_SWITCH): Set with shell, not cpp.
(LIBX): Remove, just use -lX11 in the one place this was used.
(cannot_dump): Replace with CANNOT_DUMP.

* src/Makefile.in (CANNOT_DUMP): Update for configure name change.

* src/s/freebsd.h (USE_MMAP_FOR_BUFFERS):
* src/s/irix6-5.h (USE_MMAP_FOR_BUFFERS):
* src/s/darwin.h (SYSTEM_MALLOC):
* src/s/sol2-10.h (SYSTEM_MALLOC): Move to configure.

* src/m/alpha.h: Remove old comment.
* src/s/aix4-2.h: Update comment.
* src/s/template.h: Remove USE_MMAP_FOR_BUFFERS.

* msdos/sed1v2.inp (CANNOT_DUMP): Update for configure name change.

* admin/CPP-DEFINES: Remove USE_MMAP_FOR_BUFFERS, CANNOT_DUMP.

* etc/DEBUG: Update SYSTEM_MALLOC and CANNOT_DUMP references.
Some re-filling.

16 files changed:
ChangeLog
admin/CPP-DEFINES
configure.in
etc/DEBUG
msdos/ChangeLog
msdos/sed1v2.inp
src/ChangeLog
src/Makefile.in
src/m/alpha.h
src/m/template.h
src/s/aix4-2.h
src/s/darwin.h
src/s/freebsd.h
src/s/irix6-5.h
src/s/sol2-10.h
src/s/template.h

index 03efce0..2c3aeec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-06-30  Glenn Morris  <rgm@gnu.org>
+
+       * configure.in (C_OPTIMIZE_SWITCH, CANNOT_DUMP, SYSTEM_MALLOC):
+       (USE_MMAP_FOR_BUFFERS, C_WARNING_SWITCH): 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,
index 4425b79..db96443 100644 (file)
@@ -60,10 +60,8 @@ NARROWPROTO
 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
index d941bbc..6fcea08 100644 (file)
@@ -710,14 +710,13 @@ then
   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
+  dnl FIXME? unused.
+  C_OPTIMIZE_SWITCH=-O
+  test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
 fi
 
 dnl checks for Unix variants
@@ -863,43 +862,11 @@ 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}'
+configure___ CFLAGS=-g ${C_OPTIMIZE_SWITCH} '${SPECIFIED_CFLAGS}'
 #else
 configure___ CFLAGS='${SPECIFIED_CFLAGS}'
 #endif
@@ -908,7 +875,7 @@ configure___ CFLAGS='${SPECIFIED_CFLAGS}'
 
 /* Get the CFLAGS for real compilation.  */
 #ifdef __GNUC__
-configure___ REAL_CFLAGS=-g C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}'
+configure___ REAL_CFLAGS=-g ${C_OPTIMIZE_SWITCH} ${C_WARNINGS_SWITCH} ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}'
 #else
 configure___ REAL_CFLAGS='${SPECIFIED_CFLAGS}'
 #endif
@@ -932,7 +899,18 @@ fi]
 rm ${tempcname}
 
 
-AC_SUBST(cannot_dump)
+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
@@ -1647,7 +1625,16 @@ if test $emacs_cv_var___after_morecore_hook = no; then
   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 +1668,14 @@ if test x"${REL_ALLOC}" = x; then
   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 +1730,7 @@ REAL_CPPFLAGS="$CPPFLAGS"
 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"
 
index b427292..6fd5b41 100644 (file)
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -5,9 +5,8 @@ Copyright (C) 1985, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
 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 @@ On modern POSIX systems, you can override that with this command:
    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 @@ It is necessary to refer to the file `nmout' to convert
 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 @@ suitable for Unix and GNU systems, to build such a debugging version:
 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 @@ Emacs compiled with such packages might not run without some hacking,
 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
index 71d2acb..287f568 100644 (file)
@@ -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
index 8f7c06c..eef9ea8 100644 (file)
@@ -116,7 +116,7 @@ s/\.h\.in/.h-in/
 /^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]*@//
index 12af1e6..dc0dd35 100644 (file)
@@ -1,3 +1,12 @@
+2010-06-30  Glenn Morris  <rgm@gnu.org>
+
+       * 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.
index b2fec7e..0f8294f 100644 (file)
@@ -283,7 +283,7 @@ START_FILES = @START_FILES@
 
 UNEXEC_OBJ = @UNEXEC_OBJ@
 
-CANNOT_DUMP=@cannot_dump@
+CANNOT_DUMP=@CANNOT_DUMP@
 
 DEPDIR=deps
 ## -MMD -MF ${DEPDIR}/$*.d if AUTO_DEPEND; else empty.
index c57fd0d..a7e4fa6 100644 (file)
@@ -47,19 +47,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /* 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__)
index 3beac1a..0b14941 100644 (file)
@@ -39,11 +39,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /* 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.
index 48f4312..cf06f9b 100644 (file)
@@ -89,8 +89,8 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    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
index 5c8db12..cd1f938 100644 (file)
@@ -114,9 +114,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /* 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
 
index f8d8834..9082935 100644 (file)
@@ -67,9 +67,5 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /* 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) */
index 1691daa..e2b18b2 100644 (file)
@@ -85,8 +85,6 @@ char *_getpty();
 
 #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 */
index 7441eaa..fd7f300 100644 (file)
@@ -2,8 +2,6 @@
 
 #include "sol2-6.h"
 
-#define SYSTEM_MALLOC
-
 /* This is used in list_system_processes.  */
 #define HAVE_PROCFS 1
 
index 694a104..67ed13e 100644 (file)
@@ -108,9 +108,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    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