diff --git a/ChangeLog b/ChangeLog index 2fb825ccdda..a6b66dbc3e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-09-04 Paul Eggert + + * configure.ac (_setjmp, _longjmp): Check by compiling + instead of by guessing. The guesses were wrong for + recent versions of Solaris, such as Solaris 11. + 2012-09-03 Paul Eggert * configure.ac (WARN_CFLAGS): Omit -Wjump-misses-init. diff --git a/configure.ac b/configure.ac index 77e11910553..1694c98d897 100644 --- a/configure.ac +++ b/configure.ac @@ -3791,13 +3791,27 @@ else esac fi dnl GCC? +AC_CACHE_CHECK([for _setjmp], [emacs_cv_func__setjmp], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[jmp_buf j; + if (! _setjmp (j)) + _longjmp (j, 1);]])], + [emacs_cv_func__setjmp=yes], + [emacs_cv_func__setjmp=no])]) +if test $emacs_cv_func__setjmp = no; then + AC_DEFINE([_setjmp], [setjmp], + [Define to setjmp if _setjmp and _longjmp do not work. See _longjmp.]) + AC_DEFINE([_longjmp], [longjmp], + [Define to longjmp if _setjmp and _longjmp do not work. + Because longjmp may alter signal masks, callers of _longjmp + should not assume that it leaves signal masks alone.]) +fi case $opsys in sol2* | unixware ) - dnl setjmp and longjmp can safely replace _setjmp and _longjmp, - dnl but they will run more slowly. - AC_DEFINE(_setjmp, setjmp, [Some platforms redefine this.]) - AC_DEFINE(_longjmp, longjmp, [Some platforms redefine this.]) dnl TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY dnl subprocesses the usual way. But TIOCSIGNAL does work for PTYs, dnl and this is all we need.