summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-20 03:50:32 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-20 03:50:32 +0000
commit340a511fdf6571a1f4adfc254a07edc5605f46e4 (patch)
tree0bceac7407eab6b80f3f77cd0ec1c48a7fc2521d /configure.in
parent531022ace399a527c5735c2caf41921b4ba7afe7 (diff)
* configure.in: always check existence of the pthread library
* ruby.h: define macros for ruby's native thread check * eval.c: add ruby's native thread check * gc.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in88
1 files changed, 47 insertions, 41 deletions
diff --git a/configure.in b/configure.in
index c662e3fee4..07f34b76c5 100644
--- a/configure.in
+++ b/configure.in
@@ -662,52 +662,58 @@ int main()
], rb_cv_stack_grow_dir=-1, rb_cv_stack_grow_dir=+1, rb_cv_stack_grow_dir=0)])
AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $rb_cv_stack_grow_dir)
-dnl default value for $KANJI
-DEFAULT_KCODE="KCODE_NONE"
-
-AC_ARG_WITH(pthread-ext,
- [ --with-pthread-ext use pthread library on external modules ],
- [AC_DEFINE(USE_PTHREAD_EXTLIB)
- AC_CHECK_LIB(pthread, pthread_mutex_init,
- rb_use_pthread_ext=yes, rb_use_pthread_ext=no)
- if test "$rb_use_pthread_ext" = "no"; then
- AC_CHECK_LIB(pthread, __pthread_mutex_init,
- rb_use_pthread_ext=yes, rb_use_pthread_ext=no)
- fi
- if test "$rb_use_pthread_ext" = "yes"; then
- LIBS="-lpthread $LIBS"
- AC_DEFINE(_REENTRANT)
- AC_DEFINE(_THREAD_SAFE)
- AC_DEFINE(HAVE_LIBPTHREAD)
- else
- AC_CHECK_LIB(pthreads, pthread_mutex_init,
- rb_use_pthread_ext=yes, rb_use_pthread_ext=no)
- if test "$rb_use_pthread_ext" = "yes"; then
- LIBS="-lpthreads $LIBS"
+AC_CHECK_LIB(pthread, pthread_mutex_init,
+ rb_with_pthread=yes, rb_with_pthread=no)
+if test "$rb_with_pthread" = "no"; then
+ AC_CHECK_LIB(pthread, __pthread_mutex_init,
+ rb_with_pthread=yes, rb_with_pthread=no)
+fi
+if test "$rb_with_pthread" = "yes"; then
+ LIBS="-lpthread $LIBS"
+ AC_DEFINE(_REENTRANT)
+ AC_DEFINE(_THREAD_SAFE)
+ AC_DEFINE(HAVE_LIBPTHREAD)
+else
+ AC_CHECK_LIB(pthreads, pthread_mutex_init,
+ rb_with_pthread=yes, rb_with_pthread=no)
+ if test "$rb_with_pthread" = "yes"; then
+ LIBS="-lpthreads $LIBS"
+ AC_DEFINE(_REENTRANT)
+ AC_DEFINE(_THREAD_SAFE)
+ AC_DEFINE(HAVE_LIBPTHREAD)
+ else
+ AC_CHECK_LIB(c, pthread_mutex_init,
+ rb_with_pthread=yes, rb_with_pthread=no)
+ if test "$rb_with_pthread" = "yes"; then
+ AC_DEFINE(_REENTRANT)
+ AC_DEFINE(_THREAD_SAFE)
+ AC_DEFINE(HAVE_LIBPTHREAD)
+ else
+ AC_CHECK_LIB(c_r, pthread_mutex_init,
+ rb_with_pthread=yes, rb_with_pthread=no)
+ if test "$rb_with_pthread" = "yes"; then
+ if test "$with_libc_r" = "yes"; then
+ if test "$rb_cv_supplementary_lib_c_r" = "yes"; then
+ AC_DEFINE(_REENTRANT)
+ AC_DEFINE(_THREAD_SAFE)
+ AC_DEFINE(HAVE_LIBPTHREAD)
+ MAINLIBS="-pthread $MAINLIBS"
+ fi
+ else
+ MAINLIBS="-pthread $MAINLIBS"
AC_DEFINE(_REENTRANT)
AC_DEFINE(_THREAD_SAFE)
AC_DEFINE(HAVE_LIBPTHREAD)
- else
- AC_CHECK_LIB(c_r, pthread_mutex_init,
- rb_use_pthread_ext=yes, rb_use_pthread_ext=no)
- if test "$rb_use_pthread_ext" = "yes"; then
- if test "$with_libc_r" = "yes"; then
- if test "$rb_cv_supplementary_lib_c_r" = "yes"; then
- AC_DEFINE(_REENTRANT)
- AC_DEFINE(_THREAD_SAFE)
- AC_DEFINE(HAVE_LIBPTHREAD)
- MAINLIBS="-pthread $MAINLIBS"
- fi
- else
- MAINLIBS="-pthread $MAINLIBS"
- AC_DEFINE(_REENTRANT)
- AC_DEFINE(_THREAD_SAFE)
- AC_DEFINE(HAVE_LIBPTHREAD)
- fi
- fi
fi
+ else
+ AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled")
fi
- ])
+ fi
+ fi
+fi
+
+dnl default value for $KANJI
+DEFAULT_KCODE="KCODE_NONE"
AC_ARG_WITH(default-kcode,
[ --with-default-kcode=CODE specify default value for \$KCODE (utf8|euc|sjis|none)],