From 08ee61e920fa7010087aa09cff9f822b8caf8aa5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karsten=20Ball=C3=BCder?= Date: Thu, 8 Apr 1999 20:52:29 +0000 Subject: [PATCH] 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 --- configure | 100 ++++++++++++++------------------------------------- configure.in | 13 +++---- 2 files changed, 31 insertions(+), 82 deletions(-) diff --git a/configure b/configure index 62b9e436f2..092e29f150 100755 --- a/configure +++ b/configure @@ -7622,50 +7622,8 @@ 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_%'` -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" -cat > conftest.$ac_ext <&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 - - UNIX_THREAD="unix/threadpsx.cpp" - THREADS_LINK="pthread-0.7" - -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 +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 @@ -7673,7 +7631,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7646: \"$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 @@ -7707,7 +7665,7 @@ 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 +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 @@ -7715,7 +7673,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7688: \"$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 @@ -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 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 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 <&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 <&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 <&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 <&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 <&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 diff --git a/configure.in b/configure.in index 273f96eee1..12d8ca1af3 100644 --- a/configure.in +++ b/configure.in @@ -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 -- 2.45.2