aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-17 01:40:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-17 01:40:20 +0000
commit0ec96c11d6b898b74a3dc7c3d81b7d7142bcd35c (patch)
tree5e1100ee6d9b765fbedd32180bfab83c3fee8604
parent8fb99342c6d2f89b5fef16ebe00230350371dc33 (diff)
downloadruby-0ec96c11d6b898b74a3dc7c3d81b7d7142bcd35c.tar.gz
configure.in: RUBY_CHECK_SETJMP
* configure.in (RUBY_CHECK_SETJMP): needs the header and proper arguments for builtin setjmp functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--configure.in22
2 files changed, 20 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c22673..7e1a6fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue May 17 10:40:18 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RUBY_CHECK_SETJMP): needs the header and proper
+ arguments for builtin setjmp functions.
+
Mon May 16 20:00:30 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
* enc/unicode.h: Additional uses of ONIG_CASE_MAPPING compilation switch
diff --git a/configure.in b/configure.in
index c1ccae5..3018762 100644
--- a/configure.in
+++ b/configure.in
@@ -2275,8 +2275,6 @@ AC_CHECK_FUNCS(__syscall)
AC_CHECK_FUNCS(_longjmp) # used for AC_ARG_WITH(setjmp-type)
# we don't use _setjmp if _longjmp doesn't exist.
test x$ac_cv_func__longjmp = xno && ac_cv_func__setjmp=no
-AC_CHECK_FUNCS(_setjmp) # used for AC_ARG_WITH(setjmp-type)
-AC_CHECK_FUNCS(_setjmpex) # used for AC_ARG_WITH(setjmp-type)
AC_CHECK_FUNCS(arc4random_buf)
AC_CHECK_FUNCS(atan2l atan2f)
AC_CHECK_FUNCS(chroot)
@@ -2579,12 +2577,19 @@ if test "$rb_cv_unsetenv_return_value" = no; then
fi
# used for AC_ARG_WITH(setjmp-type)
-AC_CACHE_CHECK(for sigsetjmp as a macro or function, ac_cv_func_sigsetjmp,
+AC_DEFUN([RUBY_CHECK_SETJMP], [
+AC_CACHE_CHECK([for ]$1[ as a macro or function], ac_cv_func_$1,
[AC_TRY_COMPILE([
-#include <setjmp.h>
-], [sigjmp_buf env; sigsetjmp(env,1);],
- ac_cv_func_sigsetjmp=yes,
- ac_cv_func_sigsetjmp=no)])
+@%:@include <setjmp.h>
+]AC_INCLUDES_DEFAULT([$3])[
+@%:@define JMPARGS_1 env
+@%:@define JMPARGS_2 env,1
+@%:@define JMPARGS JMPARGS_]m4_ifval($2,2,1)[
+],
+ m4_ifval($2,$2,jmp_buf)[ env; $1(JMPARGS);],
+ ac_cv_func_$1=yes,
+ ac_cv_func_$1=no)]
+)])
AC_DEFUN([RUBY_CHECK_BUILTIN_SETJMP], [
if test x"${ac_cv_func___builtin_setjmp}" = xyes; then
@@ -2612,6 +2617,9 @@ AC_CACHE_CHECK(for __builtin_setjmp, ac_cv_func___builtin_setjmp,
AC_DEFUN([RUBY_SETJMP_TYPE], [
RUBY_CHECK_BUILTIN_SETJMP
+RUBY_CHECK_SETJMP(_setjmpex, [], [@%:@include <setjmpex.h>])
+RUBY_CHECK_SETJMP(_setjmp)
+RUBY_CHECK_SETJMP(sigsetjmp, [sigjmp_buf])
AC_MSG_CHECKING(for setjmp type)
setjmp_suffix=
AC_ARG_WITH(setjmp-type,