summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-10-08 13:17:28 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-10-08 13:17:28 (GMT)
commit8158b5ad091d246748708794fba40dda724523b6 (patch)
tree0c0448af4d3d04df343221a76425a92df8d02366 /configure.in
parentb58f1c0c03b62a59ac38dc1239fed7025feb12ef (diff)
downloadcpython-8158b5ad091d246748708794fba40dda724523b6.zip
cpython-8158b5ad091d246748708794fba40dda724523b6.tar.gz
cpython-8158b5ad091d246748708794fba40dda724523b6.tar.bz2
Provide explicit program when trying to link pthread_create.
Contributed by Albert Chin in discussion of bug #210665.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in16
1 files changed, 14 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index 8fef6b2..f7f7ef7 100644
--- a/configure.in
+++ b/configure.in
@@ -952,15 +952,27 @@ else
LIBS="-lpth $LIBS"
LIBOBJS="$LIBOBJS thread.o"],[
AC_MSG_RESULT(no)
- AC_CHECK_LIB(pthread, pthread_create, [AC_DEFINE(WITH_THREAD)
+
+ # Just looking for pthread_create in libpthread is not enough:
+ # on HP/UX, pthread.h renames pthread_create to a different symbol name.
+ # So we really have to include pthread.h, and then link.
+ _libs=$LIBS
+ LIBS="$LIBS -lpthread"
+ AC_MSG_CHECKING([for pthread_create in -lpthread])
+ AC_TRY_LINK([#include <pthread.h>
+
+void * start_routine (void *arg) { exit (0); }], [
+pthread_create (NULL, NULL, start_routine, NULL)], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(WITH_THREAD)
case $ac_sys_system in
Darwin*) ;;
*) AC_DEFINE(_POSIX_THREADS)
posix_threads=yes
;;
esac
- LIBS="-lpthread $LIBS"
LIBOBJS="$LIBOBJS thread.o"],[
+ LIBS=$_libs
AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD)
case $ac_sys_system in
Darwin*) ;;