diff options
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | configure.in | 20 |
2 files changed, 23 insertions, 3 deletions
@@ -1,3 +1,9 @@ +Wed Jun 23 21:36:45 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * configure.in: avoid getcontext() overhead if possible. + [ruby-core:27380][Bug #2553] + Thanks, Joe Damato, Dan Peterson and Patrick Mohr. + Tue Jun 22 21:33:23 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> * test/optparse/test_summary.rb: fixed superclass so that it run diff --git a/configure.in b/configure.in index 363f7db9a8..3013cae5c9 100644 --- a/configure.in +++ b/configure.in @@ -587,7 +587,7 @@ AC_CHECK_HEADERS(stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h sys/ fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\ syscall.h pwd.h grp.h a.out.h utime.h memory.h direct.h sys/resource.h \ sys/mkdev.h sys/utime.h netinet/in_systm.h float.h ieeefp.h \ - ucontext.h intrinsics.h time.h) + intrinsics.h time.h) dnl Check additional types. AC_CHECK_SIZEOF(rlim_t, 0, [ @@ -1146,8 +1146,22 @@ if test x"$enable_pthread" = xyes; then fi fi fi -if test x"$ac_cv_header_ucontext_h" = xyes; then - if test x"$rb_with_pthread" = xyes; then + +use_context=no +if test x"$rb_with_pthread" = xyes; then + AS_CASE("$target_cpu:$target_os:$cross_compiling", + [*:linux*:no], [ + if test -n "`(/lib/libc.so.6 2>/dev/null | fgrep 'Native POSIX Threads') 2> /dev/null`"; then + use_context=yes + fi + ], + [sparc*], [ + use_context=yes + ]) +fi +if test x"$use_context" = xyes; then + AC_CHECK_HEADERS(ucontext.h) + if test x"$ac_cv_header_ucontext_h" = xyes; then AC_CHECK_FUNCS(getcontext setcontext) fi fi |
