diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-20 07:05:25 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-20 07:05:25 +0000 |
commit | 0664a6377a7fc51e6d96d7b69361cc457e248b00 (patch) | |
tree | 73693b397f6eeae289b23379ce433dc6d3691419 /tool/m4/ruby_setjmp_type.m4 | |
parent | 645e441c32ea5379aef712a9d9a26a6db2c1740b (diff) | |
download | ruby-0664a6377a7fc51e6d96d7b69361cc457e248b00.tar.gz |
refactor split configure.ac into files
This does not (yet) change anything. The generated configure file
is the identical to previous one (except several empty lines added
and deleted).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/m4/ruby_setjmp_type.m4')
-rw-r--r-- | tool/m4/ruby_setjmp_type.m4 | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tool/m4/ruby_setjmp_type.m4 b/tool/m4/ruby_setjmp_type.m4 new file mode 100644 index 0000000000..2550fdcf4c --- /dev/null +++ b/tool/m4/ruby_setjmp_type.m4 @@ -0,0 +1,51 @@ +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= +unset setjmp_sigmask +AC_ARG_WITH(setjmp-type, + AS_HELP_STRING([--with-setjmp-type], [select setjmp type]), + [ + AS_CASE([$withval], + [__builtin_setjmp], [setjmp=__builtin_setjmp], + [_setjmp], [ setjmp_prefix=_], + [sigsetjmp,*], [ setjmp_prefix=sig setjmp_sigmask=`expr "$withval" : 'sigsetjmp\(,.*\)'`], + [sigsetjmp], [ setjmp_prefix=sig], + [setjmp], [ setjmp_prefix=], + [setjmpex], [ setjmp_prefix= setjmp_suffix=ex], + [''], [ unset setjmp_prefix], + [ AC_MSG_ERROR(invalid setjmp type: $withval)])], [unset setjmp_prefix]) +setjmp_cast= +AS_IF([test ${setjmp_prefix+set}], [ + AS_IF([test "${setjmp_prefix}" && eval test '$ac_cv_func_'${setjmp_prefix}setjmp${setjmp_suffix} = no], [ + AC_MSG_ERROR(${setjmp_prefix}setjmp${setjmp_suffix} is not available) + ]) +], [{ AS_CASE("$ac_cv_func___builtin_setjmp", [yes*], [true], [false]) }], [ + setjmp_cast=`expr "$ac_cv_func___builtin_setjmp" : "yes with cast (\(.*\))"` + setjmp_prefix=__builtin_ + setjmp_suffix= +], [test "$ac_cv_header_setjmpex_h:$ac_cv_func__setjmpex" = yes:yes], [ + setjmp_prefix= + setjmp_suffix=ex +], [test "$ac_cv_func__setjmp" = yes], [ + setjmp_prefix=_ + setjmp_suffix= +], [test "$ac_cv_func_sigsetjmp" = yes], [ + AS_CASE([$target_os],[solaris*|cygwin*],[setjmp_prefix=],[setjmp_prefix=sig]) + setjmp_suffix= +], [ + setjmp_prefix= + setjmp_suffix= +]) +AS_IF([test x$setjmp_prefix:$setjmp_sigmask = xsig:], [ + setjmp_sigmask=,0 +]) +AC_MSG_RESULT(${setjmp_prefix}setjmp${setjmp_suffix}${setjmp_cast:+\($setjmp_cast\)}${setjmp_sigmask}) +AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp${setjmp_suffix}($setjmp_cast(env)${setjmp_sigmask})]) +AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp($setjmp_cast(env),val)]) +AC_DEFINE_UNQUOTED(RUBY_JMP_BUF, ${setjmp_sigmask+${setjmp_prefix}}jmp_buf) +AS_IF([test x$setjmp_suffix = xex], [AC_DEFINE_UNQUOTED(RUBY_USE_SETJMPEX, 1)]) +])dnl |