[svn-r2274] Hacked to detect pthreads on FreeBSD and add correct compilation options.

This commit is contained in:
Quincey Koziol 2000-05-19 09:50:48 -05:00
parent 670770900a
commit f4b618e5e1

View File

@ -716,7 +716,12 @@ AC_ARG_WITH(pthread,[ --with-pthread=INC,LIB Use the Pthreads library],
case $withval in
yes)
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_LIB(pthread, pthread_create,,unset PTHREAD)
if test `uname` != "FreeBSD"; then
AC_CHECK_LIB(pthread, pthread_create,,unset PTHREAD)
else
CFLAGS="$CFLAGS -D_THREAD_SAFE"
LDFLAGS="$LDFLAGS -pthread"
fi
;;
no)
AC_MSG_CHECKING(for pthread)
@ -725,16 +730,16 @@ case $withval in
;;
*)
pthread_inc="`echo $withval |cut -f1 -d,`"
if test "X" != "$pthread_inc"; then
if test "X-" != "X-$pthread_inc"; then
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$pthread_inc"
AC_CHECK_HEADERS(pthread.h,,CPPFLAGS="$saved_CPPFLAGS"; unset PTHREAD)
else
else
AC_CHECK_HEADERS(pthread.h,,unset PTHREAD)
fi
pthread_lib="`echo $withval |cut -f2 -d, -s`"
if test "X" != "$pthread_lib"; then
if test "X-" != "X-$pthread_lib"; then
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$pthread_lib"
AC_CHECK_LIB(pthread, pthread_create,,LDFLAGS="$saved_LDFLAGS"; unset PTHREAD)