1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
#! /bin/sh -e
# DP: Add GNU/k*BSD pthread support
dir=./
if [ $# -eq 3 -a "$2" = '-d' ]; then
pdir="-d $3"
dir="$3/"
elif [ $# -ne 1 ]; then
echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
exit 1
fi
case "$1" in
-patch)
patch $pdir -f --no-backup-if-mismatch -p1 < $0
cd ${dir} && autoconf
;;
-unpatch)
patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
rm -f ${dir}configure
;;
*)
echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
exit 1
esac
exit 0
From: Robert Millan <rmh@debian.org>
Sender: <rmh@khazad.dyndns.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Bug#264315: FTBFS on GNU/k*BSD (because of gnu pth)
Date: Sun, 08 Aug 2004 09:00:19 +0200
The attached patch fixes FTBFS on GNU/k*BSD. The problem happens on GNU/k*BSD
because we use gnu pth to provide pthreads, but will also happen on any
system that does the same.
python2.3 fails to build because it doesn't detect gnu pth in pthread
emulation. See C comments in patch for details.
diff -ur python2.3-2.3.4.old/Python/thread.c python2.3-2.3.4/Python/thread.c
--- python2.3-2.3.4.old/Python/thread.c 2003-09-20 13:13:18.000000000 +0200
+++ python2.3-2.3.4/Python/thread.c 2004-08-08 08:43:44.000000000 +0200
@@ -7,6 +7,16 @@
#include "Python.h"
+
+#ifndef _POSIX_THREADS
+/* This means pthreads are not implemented in libc headers, hence the macro
+ not present in unistd.h. But they still can be implemented as an external
+ library (e.g. gnu pth in pthread emulation) */
+# ifdef HAVE_PTHREAD_H
+# include <pthread.h> /* _POSIX_THREADS */
+# endif
+#endif
+
#ifndef DONT_HAVE_STDIO_H
#include <stdio.h>
#endif
diff -ur python2.3-2.3.4.old/configure.in python2.3-2.3.4/configure.in
--- python2.3-2.3.4.old/configure.in 2004-05-07 21:13:47.000000000 +0200
+++ python2.3-2.3.4/configure.in 2004-08-08 08:51:29.000000000 +0200
@@ -1579,7 +1579,8 @@
fi
# According to the POSIX spec, a pthreads implementation must
- # define _POSIX_THREADS in unistd.h. Some apparently don't (which ones?)
+ # define _POSIX_THREADS in unistd.h. Some apparently don't
+ # (e.g. gnu pth with pthread emulation)
AC_MSG_CHECKING(for _POSIX_THREADS in unistd.h)
AC_EGREP_CPP(yes,
[
|