]> git.eshelyaron.com Git - emacs.git/commitdiff
Move GC_SETJMP_WORKS, GC_MARK_STACK from src/s to configure
authorGlenn Morris <rgm@gnu.org>
Sat, 14 Jul 2012 00:04:10 +0000 (20:04 -0400)
committerGlenn Morris <rgm@gnu.org>
Sat, 14 Jul 2012 00:04:10 +0000 (20:04 -0400)
* configure.ac (GC_SETJMP_WORKS, GC_MARK_STACK): Move here from src/s.
(AH_BOTTOM): Move GC_SETJMP_WORKS GCC fallback to main body.

* src/s/aix4-2.h, src/s/freebsd.h, src/s/gnu-linux.h, src/s/hpux10-20.h:
* src/s/irix6-5.h, src/s/netbsd.h, src/s/sol2-6.h, src/s/unixware.h:
Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.

ChangeLog
configure.ac
src/ChangeLog
src/s/aix4-2.h
src/s/freebsd.h
src/s/gnu-linux.h
src/s/hpux10-20.h
src/s/irix6-5.h
src/s/netbsd.h
src/s/sol2-6.h
src/s/unixware.h

index 54159560e5d5001267da18e73f7f5541daa0368a..cb7d197c8d135688ec8b27df8a6a51b20e89fa71 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-07-14  Glenn Morris  <rgm@gnu.org>
+
+       * configure.ac (GC_SETJMP_WORKS, GC_MARK_STACK): Move here from src/s.
+       (AH_BOTTOM): Move GC_SETJMP_WORKS GCC fallback to main body.
+
 2012-07-13  Glenn Morris  <rgm@gnu.org>
 
        * configure.ac (opsysfile): Set to empty on gnu, cygwin.
index ed500dd6ea89cc45c0761bfb1b904a131f83f4c5..a553c340b85d74dc0f75a77a76931f9f5bb38d1d 100644 (file)
@@ -3600,6 +3600,55 @@ case $opsys in
 esac
 
 
+dnl These won't be used automatically yet.  We also need to know, at least,
+dnl that the stack is continuous.
+AH_TEMPLATE(GC_SETJMP_WORKS, [Define if setjmp is known to save all
+  registers relevant for conservative garbage collection in the jmp_buf.])
+
+AH_TEMPLATE(GC_MARK_STACK, [Define to GC_USE_GCPROS_AS_BEFORE if
+  conservative garbage collection is not known to work.])
+
+
+case $opsys in
+  aix4-2 | hpux* | unixware)
+    dnl Conservative garbage collection has not been tested, so for now
+    dnl play it safe and stick with the old-fashioned way of marking.
+    AC_DEFINE(GC_MARK_STACK, [GC_USE_GCPROS_AS_BEFORE])
+    ;;
+
+  dnl Not all the architectures are tested, but there are Debian packages
+  dnl for SCM and/or Guile on them, so the technique must work.  See also
+  dnl comments in alloc.c concerning setjmp and gcc.
+  dnl Fixme: it's probably safe to just use the GCC conditional below.
+  gnu-linux | gnu-kfreebsd )
+    AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+#if defined __i386__ || defined __sparc__ || defined __mc68000__ \
+  || defined __alpha__ || defined __mips__ || defined __s390__ \
+  || defined __arm__ || defined __powerpc__ || defined __amd64__ \
+  || defined __ia64__ || defined __sh__
+/* ok */
+#else
+# error "setjmp not known to work on this arch"
+#endif
+    ]], [[]])], AC_DEFINE(GC_SETJMP_WORKS, 1),
+      AC_DEFINE(GC_MARK_STACK, [GC_USE_GCPROS_AS_BEFORE]) )
+    ;;
+esac
+
+
+if test x$GCC = xyes; then
+   dnl GC_SETJMP_WORKS is nearly always appropriate for GCC.
+   AC_DEFINE(GC_SETJMP_WORKS, 1)
+else
+  case $opsys in
+    dnl irix: Tested on Irix 6.5.  SCM worked on earlier versions.
+    freebsd | netbsd | openbsd | irix6-5 | sol2* )
+      AC_DEFINE(GC_SETJMP_WORKS, 1)
+      ;;
+  esac
+fi                              dnl GCC?
+
+
 dnl Used in xfaces.c.
 case $opsys in
   hpux* | sol2* )
@@ -4221,15 +4270,6 @@ AH_BOTTOM([
 #undef noinline
 #endif
 
-/* These won't be used automatically yet.  We also need to know, at least,
-   that the stack is continuous.  */
-#ifdef __GNUC__
-#  ifndef GC_SETJMP_WORKS
-  /* GC_SETJMP_WORKS is nearly always appropriate for GCC.  */
-#    define GC_SETJMP_WORKS 1
-#  endif
-#endif
-
 #endif /* EMACS_CONFIG_H */
 
 /*
index b7736ae5db626ea7bd5a743eb877b73e6bdf8c35..6571030039c8771bd92cd4cff7dc1660def64573 100644 (file)
@@ -1,3 +1,9 @@
+2012-07-14  Glenn Morris  <rgm@gnu.org>
+
+       * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
+       * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
+       Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
+
 2012-07-13  Glenn Morris  <rgm@gnu.org>
 
        * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
index debc9f78c1672019d06bf8e4a1e8a2028236d0a9..6c881a7fb8ccef58030b89fd6421066fb1f3b486 100644 (file)
@@ -19,6 +19,3 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /* Perry Smith <pedz@ddivt1.austin.ibm.com> says these are correct.  */
 #undef sigmask
 
-/* Conservative garbage collection has not been tested, so for now
-   play it safe and stick with the old-fashioned way of marking.  */
-#define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE
index ff31f0734279a0459d864a05e3f8c876a6018737..9177403f426614ca4b4cba1945236d5f1f7a5685 100644 (file)
@@ -20,6 +20,3 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* Tell that garbage collector that setjmp is known to save all
-   registers relevant for conservative garbage collection in the jmp_buf.  */
-#define GC_SETJMP_WORKS 1
index 0a083fe3f1540be4088222057d4b2467623aad71..2847fd6d19c600ce0f5ac023bbd467b3e5a9ee93 100644 (file)
@@ -20,18 +20,3 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* Tell that garbage collector that setjmp is known to save all
-   registers relevant for conservative garbage collection in the jmp_buf.
-   Not all the architectures are tested, but there are Debian packages
-   for SCM and/or Guile on them, so the technique must work.  See also
-   comments in alloc.c concerning setjmp and gcc.  Fixme:  it's
-   probably safe to just let the GCC conditional in AH_BOTTOM handle this.
-*/
-#if defined __i386__ || defined __sparc__ || defined __mc68000__ \
-    || defined __alpha__ || defined __mips__ || defined __s390__ \
-    || defined __arm__ || defined __powerpc__ || defined __amd64__ \
-    || defined __ia64__ || defined __sh__
-#define GC_SETJMP_WORKS 1
-#else
-#define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE
-#endif
index c913062701a0268ab95c740de52cd0afa94c5a73..94b46a715ead845921a5ec7d906332257965bcc1 100644 (file)
@@ -25,7 +25,3 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    Note we also undef HAVE_RANDOM via configure.  */
 #undef srandom
 #undef random
-
-/* Conservative garbage collection has not been tested, so for now
-   play it safe and stick with the old-fashioned way of marking.  */
-#define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE
index 1d1989ad9ac2cbbbcd595ec3c4517a71d0d59009..9b21584546129f8ee91c2d4c3dde66a28d13a900 100644 (file)
@@ -30,5 +30,3 @@ char *_getpty();
 
 #undef TIOCSIGSEND             /* defined in usg5-4-common.h */
 
-/* Tested on Irix 6.5.  SCM worked on earlier versions.  */
-#define GC_SETJMP_WORKS 1
index b0e298f2c2e4339a88b6f27b9d8820a01b796a1e..7a571ee811671264d7a80870a732a4d5796faf41 100644 (file)
@@ -22,6 +22,3 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    that are handled with CPP __RENAME() macro in signal.h.  */
 #include <signal.h>
 
-/* Tell that garbage collector that setjmp is known to save all
-   registers relevant for conservative garbage collection in the jmp_buf.  */
-#define GC_SETJMP_WORKS 1
index 78d13f2063d7f09358d574d4a0bb9bc8516e41aa..3bed55598b7a6573374378e9d7c71516377257ea 100644 (file)
@@ -19,4 +19,3 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "usg5-4-common.h"
 
-#define GC_SETJMP_WORKS 1
index f42e6363245694aeaca3817d7d2f33ad3443d76d..59c74a56f4e0ce657ded6f128f887d55e5538b7a 100644 (file)
@@ -17,9 +17,4 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
-
 #include "usg5-4-common.h"
-
-/* Conservative garbage collection has not been tested, so for now
-   play it safe and stick with the old-fashioned way of marking.  */
-#define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE