diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-11-08 04:53:14 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-11-08 04:53:14 +0000 |
commit | 0eb9133fe023828f5c3248a564f0400a432e8464 (patch) | |
tree | edf21260aabb50dfecf131bde37d0788980bf56d | |
parent | 3caaf6f34eee033bd4a505d4d1d4a468358687ea (diff) | |
download | ruby-0eb9133fe023828f5c3248a564f0400a432e8464.tar.gz ruby-0eb9133fe023828f5c3248a564f0400a432e8464.tar.xz ruby-0eb9133fe023828f5c3248a564f0400a432e8464.zip |
* configure.in: improvement of pthread check
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | configure.in | 49 |
2 files changed, 48 insertions, 5 deletions
@@ -1,3 +1,7 @@ +Sat Nov 8 13:49:50 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> + + * configure.in: improvement of pthread check + Sat Nov 8 13:28:46 2003 Takaaki Tateishi <ttate@ttsky.net> * ext/dl/sym.c: Add DL.win32_last_error and DL.last_error. Thanks, Kaoru Shirai. diff --git a/configure.in b/configure.in index 2f66c572d..c662e3fee 100644 --- a/configure.in +++ b/configure.in @@ -321,11 +321,11 @@ freebsd*) LIBS="-lm $LIBS" rb_cv_supplementary_lib_c_r=yes, rb_cv_supplementary_lib_c_r=yes)]) if test "$rb_cv_supplementary_lib_c_r" = yes; then - MAINLIBS="-lc_r $MAINLIBS" + MAINLIBS="-lc_r $MAINLIBS" else AC_DEFINE(HAVE_LIBPTHREAD) - MAINLIBS="-pthread $MAINLIBS" - CFLAGS="-D_THREAD_SAFE $CFLAGS" + MAINLIBS="-pthread $MAINLIBS" + CFLAGS="-D_THREAD_SAFE -D_REENTRANT $CFLAGS" fi fi ;; @@ -667,8 +667,47 @@ DEFAULT_KCODE="KCODE_NONE" AC_ARG_WITH(pthread-ext, [ --with-pthread-ext use pthread library on external modules ], - [AC_CHECK_LIB(pthread, pthread_mutex_trylock) - AC_DEFINE(USE_PTHREAD_EXTLIB)]) + [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_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 + fi + ]) AC_ARG_WITH(default-kcode, [ --with-default-kcode=CODE specify default value for \$KCODE (utf8|euc|sjis|none)], |