summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-05-05 05:05:30 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-05-05 05:05:30 (GMT)
commit5f433f0ef4f283b7d5a76cafd22dc8a9d5ac1bcd (patch)
tree4b69586cad18cf1ef7ffa8aebf0b3586de1d2794 /configure
parent0389295dcdc72df81a037d2712afea600aad9445 (diff)
downloadcpython-5f433f0ef4f283b7d5a76cafd22dc8a9d5ac1bcd.zip
cpython-5f433f0ef4f283b7d5a76cafd22dc8a9d5ac1bcd.tar.gz
cpython-5f433f0ef4f283b7d5a76cafd22dc8a9d5ac1bcd.tar.bz2
Patch #732234: Check for -Kthread.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure75
1 files changed, 74 insertions, 1 deletions
diff --git a/configure b/configure
index 1c678bc..d5cc892 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.in Revision: 1.404 .
+# From configure.in Revision: 1.405 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53 for python 2.3.
#
@@ -3878,6 +3878,68 @@ echo "$as_me:$LINENO: result: $ac_cv_kpthread" >&5
echo "${ECHO_T}$ac_cv_kpthread" >&6
fi
+if test $ac_cv_kpthread = no
+then
+# -Kthread, if available, provides the right #defines
+# and linker options to make pthread_create available
+# Some compilers won't report that they do not support -Kthread,
+# so we need to run a program to see whether it really made the
+# function available.
+echo "$as_me:$LINENO: checking whether $CC accepts -Kthread" >&5
+echo $ECHO_N "checking whether $CC accepts -Kthread... $ECHO_C" >&6
+if test "${ac_cv_kthread+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_save_cc="$CC"
+CC="$CC -Kthread"
+if test "$cross_compiling" = yes; then
+ ac_cv_kthread=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#include <pthread.h>
+
+void* routine(void* p){return NULL;}
+
+int main(){
+ pthread_t p;
+ if(pthread_create(&p,NULL,routine,NULL)!=0)
+ return 1;
+ (void)pthread_detach(p);
+ return 0;
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_kthread=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+( exit $ac_status )
+ac_cv_kthread=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+CC="$ac_save_cc"
+fi
+
+echo "$as_me:$LINENO: result: $ac_cv_kthread" >&5
+echo "${ECHO_T}$ac_cv_kthread" >&6
+fi
+
# checks for header files
echo "$as_me:$LINENO: checking for ANSI C header files" >&5
@@ -9128,6 +9190,8 @@ _ACEOF
ac_save_cc="$CC"
if test "$ac_cv_kpthread" = "yes"
then CC="$CC -Kpthread"
+elif test "$ac_cv_kthread" = "yes"
+then CC="$CC -Kthread"
fi
echo "$as_me:$LINENO: checking for pthread_t" >&5
echo $ECHO_N "checking for pthread_t... $ECHO_C" >&6
@@ -10139,6 +10203,15 @@ _ACEOF
posix_threads=yes
THREADOBJ="Python/thread.o"
+elif test "$ac_cv_kthread" = "yes"
+then
+ CC="$CC -Kthread"
+ cat >>confdefs.h <<\_ACEOF
+#define WITH_THREAD 1
+_ACEOF
+
+ posix_threads=yes
+ THREADOBJ="Python/thread.o"
else
if test ! -z "$with_threads" -a -d "$with_threads"
then LDFLAGS="$LDFLAGS -L$with_threads"