diff --git a/ChangeLog b/ChangeLog index 1e7202af8c..4f6de95fff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Feb 1 12:43:41 2008 Nobuyoshi Nakada + + * configure.in (darwin): _XOPEN_SOURCE is necessary to make ucontext_t + consistent with the library implementation of MacOS X 10.5. + [ruby-dev:33461] + Fri Feb 1 11:44:22 2008 Tanaka Akira * tool/compile_prelude.rb (C_ESC): use octal escape to avoid diff --git a/configure.in b/configure.in index 52f948d3ef..a5881685ba 100644 --- a/configure.in +++ b/configure.in @@ -466,6 +466,7 @@ nextstep*) ;; openstep*) ;; rhapsody*) ;; darwin*) LIBS="-lobjc $LIBS" + CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D_DARWIN_C_SOURCE" AC_TRY_CPP([#include #if MAC_OS_X_VERSION_MAX_ALLOWED <= 1040 #error pre OS X 10.4 @@ -475,7 +476,6 @@ darwin*) LIBS="-lobjc $LIBS" [ AC_DEFINE(BROKEN_SETREUID, 1) AC_DEFINE(BROKEN_SETREGID, 1) - ac_cv_header_ucontext_h=no ]) ;; hpux*) LIBS="-lm $LIBS" @@ -684,12 +684,18 @@ fi AC_DEFUN([RUBY_CHECK_VARTYPE], [dnl AC_CACHE_CHECK([for external $1], rb_cv_var_$1, [rb_cv_var_$1=no - AC_TRY_COMPILE([#define _XOPEN_SOURCE 1 + AC_TRY_COMPILE([ +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE 1 +#endif $2 const volatile void *volatile t;], [t = &(&$1)[0];], [for t in $3; do - AC_TRY_COMPILE([#define _XOPEN_SOURCE 1 + AC_TRY_COMPILE([ +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE 1 +#endif $2 extern $t $1; const volatile void *volatile t;],