summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-11-20 19:30:22 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-11-20 19:30:22 (GMT)
commitc4920e86ef7511b4e858028e870b1811437a71d0 (patch)
tree5cf1eca3d52fa0b815159c483e9108115dc05fcb /configure.in
parentab44226198f844d2854d13395c5fd303fb9e3570 (diff)
downloadcpython-c4920e86ef7511b4e858028e870b1811437a71d0.zip
cpython-c4920e86ef7511b4e858028e870b1811437a71d0.tar.gz
cpython-c4920e86ef7511b4e858028e870b1811437a71d0.tar.bz2
Issue #7272: Add configure test to detect whether sem_open works
properly, and use this to skip test_multiprocessing on platforms where sem_open raises a signal. This should fix some FreeBSD buildbot failures for test_multiprocessing.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in35
1 files changed, 35 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index c3a1678..48043ad 100644
--- a/configure.in
+++ b/configure.in
@@ -3387,6 +3387,41 @@ fi
LIBS_SAVE=$LIBS
LIBS="$LIBS $LIBM"
+# For multiprocessing module, check that sem_open
+# actually works. For FreeBSD versions <= 7.2,
+# the kernel module that provides POSIX semaphores
+# isn't loaded by default, so an attempt to call
+# sem_open results in a 'Signal 12' error.
+AC_MSG_CHECKING(whether POSIX semaphores are enabled)
+AC_CACHE_VAL(ac_cv_posix_semaphores_enabled,
+AC_TRY_RUN([
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <semaphore.h>
+#include <sys/stat.h>
+
+int main(void) {
+ sem_t *a = sem_open("/autoconf", O_CREAT, S_IRUSR|S_IWUSR, 0);
+ if (a == SEM_FAILED) {
+ perror("sem_open");
+ return 1;
+ }
+ sem_close(a);
+ return 0;
+}
+], ac_cv_posix_semaphores_enabled=yes,
+ ac_cv_posix_semaphores_enabled=no,
+ ac_cv_posix_semaphores_enabled=yes)
+)
+AC_MSG_RESULT($ac_cv_posix_semaphores_enabled)
+if test $ac_cv_posix_semaphores_enabled = no
+then
+ AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
+ [Define if the Posix semaphores do not work on your system])
+fi
+
+
# Multiprocessing check for broken sem_getvalue
AC_MSG_CHECKING(for broken sem_getvalue)
AC_CACHE_VAL(ac_cv_broken_sem_getvalue,