thread compilation fixed for FreeBSD 3.1

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1904 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-03-12 14:12:38 +00:00
parent d90810420b
commit 903b682c6b
2 changed files with 51 additions and 28 deletions

53
configure vendored
View File

@@ -7549,21 +7549,22 @@ fi
if test "$wxUSE_THREADS" = "1"; then
for ac_hdr in sched.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7557: checking for $ac_hdr" >&5
echo "configure:7558: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 7562 "configure"
#line 7563 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:7568: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -7591,7 +7592,7 @@ done
echo $ac_n "checking for sched_yield in -l$THREADS_LINK""... $ac_c" 1>&6
echo "configure:7595: checking for sched_yield in -l$THREADS_LINK" >&5
echo "configure:7596: checking for sched_yield in -l$THREADS_LINK" >&5
ac_lib_var=`echo $THREADS_LINK'_'sched_yield | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7599,7 +7600,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$THREADS_LINK $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7603 "configure"
#line 7604 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -7610,7 +7611,7 @@ int main() {
sched_yield()
; return 0; }
EOF
if { (eval echo configure:7614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:7615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -7632,7 +7633,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_yield in -l"posix4"""... $ac_c" 1>&6
echo "configure:7636: checking for sched_yield in -l"posix4"" >&5
echo "configure:7637: checking for sched_yield in -l"posix4"" >&5
ac_lib_var=`echo "posix4"'_'sched_yield | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7640,7 +7641,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l"posix4" $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7644 "configure"
#line 7645 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -7651,7 +7652,7 @@ int main() {
sched_yield()
; return 0; }
EOF
if { (eval echo configure:7655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:7656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -7680,27 +7681,27 @@ fi
fi
echo $ac_n "checking for sched_get_priority_min in -l$THREADS_LINK""... $ac_c" 1>&6
echo "configure:7685: checking for sched_get_priority_min in -l$THREADS_LINK" >&5
ac_lib_var=`echo $THREADS_LINK'_'sched_get_priority_min | sed 'y%./+-%__p_%'`
echo $ac_n "checking for pthread_attr_getschedpolicy in -l$THREADS_LINK""... $ac_c" 1>&6
echo "configure:7686: checking for pthread_attr_getschedpolicy in -l$THREADS_LINK" >&5
ac_lib_var=`echo $THREADS_LINK'_'pthread_attr_getschedpolicy | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-l$THREADS_LINK $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7693 "configure"
#line 7694 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char sched_get_priority_min();
char pthread_attr_getschedpolicy();
int main() {
sched_get_priority_min()
pthread_attr_getschedpolicy()
; return 0; }
EOF
if { (eval echo configure:7704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:7705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -7721,27 +7722,27 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_get_priority_min in -l"posix4"""... $ac_c" 1>&6
echo "configure:7726: checking for sched_get_priority_min in -l"posix4"" >&5
ac_lib_var=`echo "posix4"'_'sched_get_priority_min | sed 'y%./+-%__p_%'`
echo $ac_n "checking for pthread_attr_getschedpolicy in -l"posix4"""... $ac_c" 1>&6
echo "configure:7727: checking for pthread_attr_getschedpolicy in -l"posix4"" >&5
ac_lib_var=`echo "posix4"'_'pthread_attr_getschedpolicy | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-l"posix4" $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7734 "configure"
#line 7735 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char sched_get_priority_min();
char pthread_attr_getschedpolicy();
int main() {
sched_get_priority_min()
pthread_attr_getschedpolicy()
; return 0; }
EOF
if { (eval echo configure:7745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:7746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -7771,7 +7772,7 @@ fi
echo $ac_n "checking for pthread_cancel in -l$THREADS_LINK""... $ac_c" 1>&6
echo "configure:7775: checking for pthread_cancel in -l$THREADS_LINK" >&5
echo "configure:7776: checking for pthread_cancel in -l$THREADS_LINK" >&5
ac_lib_var=`echo $THREADS_LINK'_'pthread_cancel | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7779,7 +7780,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$THREADS_LINK $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7783 "configure"
#line 7784 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -7790,7 +7791,7 @@ int main() {
pthread_cancel()
; return 0; }
EOF
if { (eval echo configure:7794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:7795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else

View File

@@ -1439,6 +1439,21 @@ fi
dnl do other tests only if we are using threads
if test "$wxUSE_THREADS" = "1"; then
dnl define autoconf macro to check for given function in both pthread and
dnl posix4 libraries
dnl usage: AC_FUNC_THREAD(FUNCTION_NAME)
dnl VZ: TODO
dnl AC_DEFUN(AC_FUNC_THREAD,
dnl [
dnl AC_CHECK_LIB($THREADS_LINK, $1,
dnl AC_DEFINE(HAVE_`'translit($1, `A-Z', 'a-z'),
dnl [AC_CHECK_LIB("posix4", $1,
dnl [AC_DEFINE(HAVE_`'translit($1, `A-Z', 'a-z'))
dnl POSIX4_LINK="-lposix4"
dnl ])
dnl ])
dnl ])
AC_CHECK_HEADERS(sched.h)
AC_CHECK_LIB($THREADS_LINK, sched_yield,
@@ -1449,9 +1464,16 @@ if test "$wxUSE_THREADS" = "1"; then
)]
)
AC_CHECK_LIB($THREADS_LINK, sched_get_priority_min,
dnl VZ: we should be checking for all of the following functions instead:
dnl 1. pthread_attr_getschedpolicy
dnl 2. sched_get_priority_min and sched_get_priority_max
dnl 3. pthread_attr_getschedparam and pthread_attr_setschedparam
dnl but it seems that if the first one is there, the other ones are too (of
dnl course the proper solution would be to implement AC_FUNC_THREAD above
dnl and do test for them all - anyone?)
AC_CHECK_LIB($THREADS_LINK, pthread_attr_getschedpolicy,
AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS),
[AC_CHECK_LIB("posix4", sched_get_priority_min,
[AC_CHECK_LIB("posix4", pthread_attr_getschedpolicy,
[AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS) POSIX4_LINK="-lposix4"],
AC_MSG_WARN(Setting thread priority will not work)
)]