summaryrefslogtreecommitdiffstats
path: root/configure.in
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.in
parent0389295dcdc72df81a037d2712afea600aad9445 (diff)
downloadcpython-5f433f0ef4f283b7d5a76cafd22dc8a9d5ac1bcd.zip
cpython-5f433f0ef4f283b7d5a76cafd22dc8a9d5ac1bcd.tar.gz
cpython-5f433f0ef4f283b7d5a76cafd22dc8a9d5ac1bcd.tar.bz2
Patch #732234: Check for -Kthread.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in39
1 files changed, 39 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 9db7f43..fdda1f7 100644
--- a/configure.in
+++ b/configure.in
@@ -752,6 +752,37 @@ CC="$ac_save_cc"])
AC_MSG_RESULT($ac_cv_kpthread)
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.
+AC_MSG_CHECKING(whether $CC accepts -Kthread)
+AC_CACHE_VAL(ac_cv_kthread,
+[ac_save_cc="$CC"
+CC="$CC -Kthread"
+AC_TRY_RUN([
+#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;
+}
+],
+ ac_cv_kthread=yes,
+ ac_cv_kthread=no,
+ ac_cv_kthread=no)
+CC="$ac_save_cc"])
+AC_MSG_RESULT($ac_cv_kthread)
+fi
+
dnl # check for ANSI or K&R ("traditional") preprocessor
dnl AC_MSG_CHECKING(for C preprocessor type)
dnl AC_TRY_COMPILE([
@@ -940,6 +971,8 @@ AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t,
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
AC_MSG_CHECKING(for pthread_t)
have_pthread_t=no
@@ -1367,6 +1400,12 @@ then
AC_DEFINE(WITH_THREAD)
posix_threads=yes
THREADOBJ="Python/thread.o"
+elif test "$ac_cv_kthread" = "yes"
+then
+ CC="$CC -Kthread"
+ AC_DEFINE(WITH_THREAD)
+ posix_threads=yes
+ THREADOBJ="Python/thread.o"
else
if test ! -z "$with_threads" -a -d "$with_threads"
then LDFLAGS="$LDFLAGS -L$with_threads"