mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* configure.in: improvement of pthread check
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0f8d55fa98
commit
1ef5d9d443
2 changed files with 48 additions and 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>
|
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.
|
* ext/dl/sym.c: Add DL.win32_last_error and DL.last_error.
|
||||||
Thanks, Kaoru Shirai.
|
Thanks, Kaoru Shirai.
|
||||||
|
|
49
configure.in
49
configure.in
|
@ -321,11 +321,11 @@ freebsd*) LIBS="-lm $LIBS"
|
||||||
rb_cv_supplementary_lib_c_r=yes,
|
rb_cv_supplementary_lib_c_r=yes,
|
||||||
rb_cv_supplementary_lib_c_r=yes)])
|
rb_cv_supplementary_lib_c_r=yes)])
|
||||||
if test "$rb_cv_supplementary_lib_c_r" = yes; then
|
if test "$rb_cv_supplementary_lib_c_r" = yes; then
|
||||||
MAINLIBS="-lc_r $MAINLIBS"
|
MAINLIBS="-lc_r $MAINLIBS"
|
||||||
else
|
else
|
||||||
AC_DEFINE(HAVE_LIBPTHREAD)
|
AC_DEFINE(HAVE_LIBPTHREAD)
|
||||||
MAINLIBS="-pthread $MAINLIBS"
|
MAINLIBS="-pthread $MAINLIBS"
|
||||||
CFLAGS="-D_THREAD_SAFE $CFLAGS"
|
CFLAGS="-D_THREAD_SAFE -D_REENTRANT $CFLAGS"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@ -667,8 +667,47 @@ DEFAULT_KCODE="KCODE_NONE"
|
||||||
|
|
||||||
AC_ARG_WITH(pthread-ext,
|
AC_ARG_WITH(pthread-ext,
|
||||||
[ --with-pthread-ext use pthread library on external modules ],
|
[ --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,
|
AC_ARG_WITH(default-kcode,
|
||||||
[ --with-default-kcode=CODE specify default value for \$KCODE (utf8|euc|sjis|none)],
|
[ --with-default-kcode=CODE specify default value for \$KCODE (utf8|euc|sjis|none)],
|
||||||
|
|
Loading…
Reference in a new issue