diff options
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, |