diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2002-01-02 19:05:30 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2002-01-02 19:05:30 (GMT) |
commit | 2453f290ecff579cc17907c250eeb697a7792e8b (patch) | |
tree | e6a014ca9d5d6137a62ccddf707dd6419b4f0245 /configure.in | |
parent | dc886d2d4f12f5f87ee7590d1605707be3c129a6 (diff) | |
download | hdf5-2453f290ecff579cc17907c250eeb697a7792e8b.zip hdf5-2453f290ecff579cc17907c250eeb697a7792e8b.tar.gz hdf5-2453f290ecff579cc17907c250eeb697a7792e8b.tar.bz2 |
[svn-r4765] Purpose:
Bug fix.
Description:
FreeBSD would fail the threadsafe feature if static-exec is not on.
Solution:
Force enable-static-exec on if enable-threadsafe is on.
Also moved the chunk of FreeBSD specific code for Pthread setup
from configure.in to config/freebsd.
Also changed enable-threadsafe to check on linking pthread program.
That takes care of platforms (e.g. freebsd) that has pthread
support builtin the default C library. Now one can just use
"enable-threadsafe" if the compiler has pthread support by default.
Platforms tested:
eirene, Sleipnir
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/configure.in b/configure.in index b0dabd0..90628ab 100644 --- a/configure.in +++ b/configure.in @@ -965,13 +965,7 @@ AC_ARG_WITH(pthread, case "$withval" in yes) AC_CHECK_HEADERS(pthread.h) - if test `uname` != "FreeBSD"; then - AC_CHECK_LIB(pthread, pthread_create,,unset PTHREAD) - else - CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" - LDFLAGS="$LDFLAGS -pthread" - LIBS="$LIBS -lcipher" - fi + AC_CHECK_LIB(pthread, pthread_create,,unset PTHREAD) ;; no) AC_MSG_CHECKING(for pthread) @@ -1012,7 +1006,7 @@ case "$withval" in esac dnl ---------------------------------------------------------------------- -dnl Enable thread-safe version of library. It requires pthread on. +dnl Enable thread-safe version of library. It requires Pthreads support. dnl AC_MSG_CHECKING(for thread safe support) AC_ARG_ENABLE(threadsafe, @@ -1024,13 +1018,10 @@ case "X-$THREADSAFE" in AC_MSG_RESULT(no) ;; X-yes) - if test -n "$PTHREAD"; then - AC_MSG_RESULT(yes) - THREADSAFE=yes - else - AC_MSG_RESULT(error) - AC_MSG_ERROR(needed pthread library not available) - fi + dnl Check that we can link a simple Pthread program. + AC_TRY_LINK(,pthread_create(), + AC_MSG_RESULT(yes); THREADSAFE=yes, + AC_MSG_ERROR(needed pthread library not available)) ;; *) AC_MSG_RESULT(error) |