UNIX_THREAD=""
if test "$wxUSE_THREADS" = "1"; then
-
- echo $ac_n "checking for pthread_create in -lpthread-0.7""... $ac_c" 1>&6
+
+ echo $ac_n "checking for pthread_create in -lpthread-0.7""... $ac_c" 1>&6
echo "configure:7364: 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
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
-
- ac_safe=`echo "sys/prctl.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for sys/prctl.h""... $ac_c" 1>&6
-echo "configure:7407: 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 7412 "configure"
-#include "confdefs.h"
-#include <sys/prctl.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7417: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
-
- UNIX_THREAD="gtk/threadsgi.cpp"
-
+ UNIX_THREAD="unix/threadpsx.cpp"
+ THREADS_LINK="pthread-0.7"
+
else
echo "$ac_t""no" 1>&6
-fi
-
-
- echo $ac_n "checking for pthread_setcanceltype in -lpthread""... $ac_c" 1>&6
-echo "configure:7443: checking for pthread_setcanceltype in -lpthread" >&5
-ac_lib_var=`echo pthread'_'pthread_setcanceltype | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
+echo "configure:7406: 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 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7451 "configure"
+#line 7414 "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_setcanceltype();
+char pthread_create();
int main() {
-pthread_setcanceltype()
+pthread_create()
; return 0; }
EOF
-if { (eval echo configure:7462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7425: \"$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
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"
-
+ UNIX_THREAD="unix/threadpsx.cpp"
+ THREADS_LINK="pthread"
+
else
echo "$ac_t""no" 1>&6
-fi
-
-
-fi
-
- if test "x$THREADS_LINK" = "x"; then
- echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:7491: checking for pthread_create in -lc_r" >&5
+ echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
+echo "configure:7448: 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
ac_save_LIBS="$LIBS"
LIBS="-lc_r $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7499 "configure"
+#line 7456 "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
pthread_create()
; return 0; }
EOF
-if { (eval echo configure:7510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7467: \"$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
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="c_r"
-
+ UNIX_THREAD="unix/threadpsx.cpp"
+ THREADS_LINK="c_r"
+
+else
+ echo "$ac_t""no" 1>&6
+
+ ac_safe=`echo "sys/prctl.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for sys/prctl.h""... $ac_c" 1>&6
+echo "configure:7491: 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 7496 "configure"
+#include "confdefs.h"
+#include <sys/prctl.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7501: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
+ UNIX_THREAD="gtk/threadsgi.cpp"
+
else
echo "$ac_t""no" 1>&6
fi
- fi
+
+fi
+
+
+fi
+
+
+fi
+
if test "$THREADS_LINK" != ""; then
- cat >> confdefs.h <<\EOF
+ cat >> confdefs.h <<\EOF
#define wxUSE_THREADS 1
EOF
+ else
+ echo "configure: warning: No thread support on this system" 1>&2
fi
fi
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7554: checking for $ac_hdr" >&5
+echo "configure:7555: 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 7559 "configure"
+#line 7560 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7564: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7565: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
echo $ac_n "checking for sched_yield in -l$THREADS_LINK""... $ac_c" 1>&6
-echo "configure:7592: checking for sched_yield in -l$THREADS_LINK" >&5
+echo "configure:7593: 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
ac_save_LIBS="$LIBS"
LIBS="-l$THREADS_LINK $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7600 "configure"
+#line 7601 "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
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:7611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7612: \"$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
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_yield in -l"posix4"""... $ac_c" 1>&6
-echo "configure:7633: checking for sched_yield in -l"posix4"" >&5
+echo "configure:7634: 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
ac_save_LIBS="$LIBS"
LIBS="-l"posix4" $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7641 "configure"
+#line 7642 "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
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:7652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7653: \"$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 $ac_n "checking for sched_get_priority_min in -l$THREADS_LINK""... $ac_c" 1>&6
-echo "configure:7682: checking for sched_get_priority_min in -l$THREADS_LINK" >&5
+echo "configure:7683: checking for sched_get_priority_min in -l$THREADS_LINK" >&5
ac_lib_var=`echo $THREADS_LINK'_'sched_get_priority_min | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-l$THREADS_LINK $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7690 "configure"
+#line 7691 "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
sched_get_priority_min()
; return 0; }
EOF
-if { (eval echo configure:7701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7702: \"$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
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:7723: checking for sched_get_priority_min in -l"posix4"" >&5
+echo "configure:7724: checking for sched_get_priority_min in -l"posix4"" >&5
ac_lib_var=`echo "posix4"'_'sched_get_priority_min | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-l"posix4" $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7731 "configure"
+#line 7732 "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
sched_get_priority_min()
; return 0; }
EOF
-if { (eval echo configure:7742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7743: \"$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 $ac_n "checking for pthread_cancel in -l$THREADS_LINK""... $ac_c" 1>&6
-echo "configure:7772: checking for pthread_cancel in -l$THREADS_LINK" >&5
+echo "configure:7773: 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
ac_save_LIBS="$LIBS"
LIBS="-l$THREADS_LINK $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7780 "configure"
+#line 7781 "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
pthread_cancel()
; return 0; }
EOF
-if { (eval echo configure:7791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7792: \"$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
UNIX_THREAD=""
if test "$wxUSE_THREADS" = "1"; then
- dnl For glibc 2 users who have the old libc 5 too
-
- AC_CHECK_LIB(pthread-0.7, pthread_create, [
- UNIX_THREAD="unix/threadpsx.cpp"
- THREADS_LINK="pthread-0.7"
- ],[
- AC_CHECK_HEADER(sys/prctl.h, [
- UNIX_THREAD="gtk/threadsgi.cpp"
- ])
-
- dnl pthread_create is always available in pthread but it seems not to be
- dnl the case for pthread_setcanceltype.
-
- AC_CHECK_LIB(pthread, pthread_setcanceltype, [
- UNIX_THREAD="unix/threadpsx.cpp"
- THREADS_LINK="pthread"
- ])
+ 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, [
+ UNIX_THREAD="unix/threadpsx.cpp"
+ THREADS_LINK="pthread"
+ ], [
+ dnl thread functions are in libc_r under FreeBSD
+ AC_CHECK_LIB(c_r, pthread_create, [
+ UNIX_THREAD="unix/threadpsx.cpp"
+ THREADS_LINK="c_r"
+ ], [
+ dnl VZ: SGI threads are not supported currently
+ AC_CHECK_HEADER(sys/prctl.h, [
+ UNIX_THREAD="gtk/threadsgi.cpp"
+ ])
+ ])
+ ])
])
- if test "x$THREADS_LINK" = "x"; then
- dnl thread functions are in libc_r under FreeBSD
- AC_CHECK_LIB(c_r, pthread_create,
- [
- UNIX_THREAD="unix/threadpsx.cpp"
- THREADS_LINK="c_r"
- ])
- fi
-
if test "$THREADS_LINK" != ""; then
- AC_DEFINE(wxUSE_THREADS)
+ AC_DEFINE(wxUSE_THREADS)
+ else
+ AC_MSG_WARN(No thread support on this system)
fi
fi