summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-23 12:48:31 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-23 12:48:31 +0000
commit26b193d548c05ba859407d60e28823f32d367d97 (patch)
treeb84892e6dc5daaeca014f5fbb67b9026449537f0
parentde2a1b33c22732a2c18aa80c1ec5bae28b71cc8f (diff)
* configure.in: avoid getcontext() overhead if possible.
[ruby-core:27380][Bug #2553] Thanks, Joe Damato, Dan Peterson and Patrick Mohr. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--configure.in20
2 files changed, 23 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 0e89a822a2..c50b4deb81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Jun 23 21:36:45 2010 Nobuyoshi Nakada <[email protected]>
+
+ * 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 <[email protected]>
* 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