Removed check for pthread-0.7 on Linux which causes problems on some glibc2

systems and break static linkage.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2073 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Karsten Ballüder 1999-04-08 20:52:29 +00:00
parent 53a8af592a
commit 08ee61e920
2 changed files with 36 additions and 87 deletions

110
configure vendored
View File

@ -7622,14 +7622,14 @@ UNIX_THREAD=""
if test "$wxUSE_THREADS" = "1"; then
echo $ac_n "checking for pthread_create in -lpthread-0.7""... $ac_c" 1>&6
echo "configure:7627: checking for pthread_create in -lpthread-0.7" >&5
ac_lib_var=`echo pthread-0.7'_'pthread_create | sed 'y%./+-%__p_%'`
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
echo "configure:7627: checking for pthread_create in -lpthread" >&5
ac_lib_var=`echo pthread'_'pthread_create | 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="-lpthread-0.7 $LIBS"
LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7635 "configure"
#include "confdefs.h"
@ -7658,20 +7658,20 @@ fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
UNIX_THREAD="unix/threadpsx.cpp"
THREADS_LINK="pthread-0.7"
UNIX_THREAD="unix/threadpsx.cpp"
THREADS_LINK="pthread"
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
echo "configure:7669: checking for pthread_create in -lpthread" >&5
ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
echo "configure:7669: checking for pthread_create in -lc_r" >&5
ac_lib_var=`echo c_r'_'pthread_create | 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="-lpthread $LIBS"
LIBS="-lc_r $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7677 "configure"
#include "confdefs.h"
@ -7696,48 +7696,6 @@ fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
UNIX_THREAD="unix/threadpsx.cpp"
THREADS_LINK="pthread"
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
echo "configure:7711: checking for pthread_create in -lc_r" >&5
ac_lib_var=`echo c_r'_'pthread_create | 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="-lc_r $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7719 "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 pthread_create();
int main() {
pthread_create()
; return 0; }
EOF
if { (eval echo configure:7730: \"$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
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
@ -7750,17 +7708,17 @@ else
ac_safe=`echo "sys/prctl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/prctl.h""... $ac_c" 1>&6
echo "configure:7754: checking for sys/prctl.h" >&5
echo "configure:7712: checking for sys/prctl.h" >&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 7759 "configure"
#line 7717 "configure"
#include "confdefs.h"
#include <sys/prctl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:7722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -7789,10 +7747,6 @@ fi
fi
fi
if test "$THREADS_LINK" != ""; then
cat >> confdefs.h <<\EOF
#define wxUSE_THREADS 1
@ -7814,17 +7768,17 @@ if test "$wxUSE_THREADS" = "1"; then
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7818: checking for $ac_hdr" >&5
echo "configure:7772: 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 7823 "configure"
#line 7777 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:7782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -7852,7 +7806,7 @@ done
echo $ac_n "checking for sched_yield in -l$THREADS_LINK""... $ac_c" 1>&6
echo "configure:7856: checking for sched_yield in -l$THREADS_LINK" >&5
echo "configure:7810: 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
@ -7860,7 +7814,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$THREADS_LINK $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7864 "configure"
#line 7818 "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
@ -7871,7 +7825,7 @@ int main() {
sched_yield()
; return 0; }
EOF
if { (eval echo configure:7875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:7829: \"$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
@ -7893,7 +7847,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:7897: checking for sched_yield in -l"posix4"" >&5
echo "configure:7851: 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
@ -7901,7 +7855,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l"posix4" $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7905 "configure"
#line 7859 "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
@ -7912,7 +7866,7 @@ int main() {
sched_yield()
; return 0; }
EOF
if { (eval echo configure:7916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:7870: \"$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
@ -7942,7 +7896,7 @@ fi
echo $ac_n "checking for pthread_attr_getschedpolicy in -l$THREADS_LINK""... $ac_c" 1>&6
echo "configure:7946: checking for pthread_attr_getschedpolicy in -l$THREADS_LINK" >&5
echo "configure:7900: 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
@ -7950,7 +7904,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$THREADS_LINK $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7954 "configure"
#line 7908 "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
@ -7961,7 +7915,7 @@ int main() {
pthread_attr_getschedpolicy()
; return 0; }
EOF
if { (eval echo configure:7965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:7919: \"$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
@ -7983,7 +7937,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_attr_getschedpolicy in -l"posix4"""... $ac_c" 1>&6
echo "configure:7987: checking for pthread_attr_getschedpolicy in -l"posix4"" >&5
echo "configure:7941: 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
@ -7991,7 +7945,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l"posix4" $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7995 "configure"
#line 7949 "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
@ -8002,7 +7956,7 @@ int main() {
pthread_attr_getschedpolicy()
; return 0; }
EOF
if { (eval echo configure:8006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:7960: \"$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
@ -8032,7 +7986,7 @@ fi
echo $ac_n "checking for pthread_cancel in -l$THREADS_LINK""... $ac_c" 1>&6
echo "configure:8036: checking for pthread_cancel in -l$THREADS_LINK" >&5
echo "configure:7990: 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
@ -8040,7 +7994,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$THREADS_LINK $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8044 "configure"
#line 7998 "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
@ -8051,7 +8005,7 @@ int main() {
pthread_cancel()
; return 0; }
EOF
if { (eval echo configure:8055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:8009: \"$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

@ -1494,13 +1494,10 @@ UNIX_THREAD=""
if test "$wxUSE_THREADS" = "1"; then
dnl find if POSIX threads are available
dnl For glibc 2 users who have the old libc 5 too check pthread-0.7 first
AC_CHECK_LIB(pthread-0.7, pthread_create, [
UNIX_THREAD="unix/threadpsx.cpp"
THREADS_LINK="pthread-0.7"
],[
dnl standard lib name is pthread
AC_CHECK_LIB(pthread, pthread_create, [
dnl standard lib name is pthread
dnl We no longer test for pthread-0.7 as it breaks compilation on some
dnl glibc2 systems, especially for static linkage.
AC_CHECK_LIB(pthread, pthread_create, [
UNIX_THREAD="unix/threadpsx.cpp"
THREADS_LINK="pthread"
], [
@ -1515,8 +1512,6 @@ if test "$wxUSE_THREADS" = "1"; then
])
])
])
])
if test "$THREADS_LINK" != ""; then
AC_DEFINE(wxUSE_THREADS)
else