diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-11-28 12:48:43 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-11-28 12:48:43 (GMT) |
commit | a614f042a2f1725d5b57fdecb3b62e8c8846cee2 (patch) | |
tree | fcc15a825861b34f68122166c8a3ffbd827ba3cf /configure.in | |
parent | a4962cb694c5fc7ae53f762a682cdc1ca72410ee (diff) | |
download | cpython-a614f042a2f1725d5b57fdecb3b62e8c8846cee2.zip cpython-a614f042a2f1725d5b57fdecb3b62e8c8846cee2.tar.gz cpython-a614f042a2f1725d5b57fdecb3b62e8c8846cee2.tar.bz2 |
Merged revisions 76432,76558 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r76432 | mark.dickinson | 2009-11-20 19:30:22 +0000 (Fri, 20 Nov 2009) | 5 lines
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.
........
r76558 | mark.dickinson | 2009-11-28 10:44:20 +0000 (Sat, 28 Nov 2009) | 4 lines
Issue #7272, continued: don't re-use existing HAVE_BROKEN_POSIX_SEMAPHORES
to indicate that semaphores aren't available; define a new variable
POSIX_SEMAPHORES_NOT_ENABLED instead.
........
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/configure.in b/configure.in index ca9037b..f9840d4 100644 --- a/configure.in +++ b/configure.in @@ -3290,6 +3290,40 @@ AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include <math.h>]]) LIBS=$LIBS_SAVE +# 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(POSIX_SEMAPHORES_NOT_ENABLED, 1, + [Define if POSIX semaphores aren't enabled 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, |