[Python-checkins] python/dist/src configure,1.394,1.395 configure.in,1.405,1.406

loewis@users.sourceforge.net loewis@users.sourceforge.net
Sun, 04 May 2003 22:05:33 -0700


Update of /cvsroot/python/python/dist/src
In directory sc8-pr-cvs1:/tmp/cvs-serv3050

Modified Files:
	configure configure.in 
Log Message:
Patch #732234: Check for -Kthread.


Index: configure
===================================================================
RCS file: /cvsroot/python/python/dist/src/configure,v
retrieving revision 1.394
retrieving revision 1.395
diff -C2 -d -r1.394 -r1.395
*** configure	3 May 2003 12:10:46 -0000	1.394
--- configure	5 May 2003 05:05:26 -0000	1.395
***************
*** 1,4 ****
  #! /bin/sh
! # From configure.in Revision: 1.404 .
  # Guess values for system-dependent variables and create Makefiles.
  # Generated by GNU Autoconf 2.53 for python 2.3.
--- 1,4 ----
  #! /bin/sh
! # 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.
***************
*** 3879,3882 ****
--- 3879,3944 ----
  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
***************
*** 9129,9132 ****
--- 9191,9196 ----
  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
***************
*** 10134,10137 ****
--- 10198,10210 ----
  then
      CC="$CC -Kpthread"
+     cat >>confdefs.h <<\_ACEOF
+ #define WITH_THREAD 1
+ _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

Index: configure.in
===================================================================
RCS file: /cvsroot/python/python/dist/src/configure.in,v
retrieving revision 1.405
retrieving revision 1.406
diff -C2 -d -r1.405 -r1.406
*** configure.in	3 May 2003 12:10:48 -0000	1.405
--- configure.in	5 May 2003 05:05:30 -0000	1.406
***************
*** 753,756 ****
--- 753,787 ----
  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)
***************
*** 941,944 ****
--- 972,977 ----
  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)
***************
*** 1365,1368 ****
--- 1398,1407 ----
  then
      CC="$CC -Kpthread"
+     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