@@ -23782,6 +23782,91 @@ fi
2378223782LIBS_SAVE=$LIBS
2378323783LIBS="$LIBS $LIBM"
2378423784
23785+ # For multiprocessing module, check that sem_open
23786+ # actually works. For FreeBSD versions <= 7.2,
23787+ # the kernel module that provides POSIX semaphores
23788+ # isn't loaded by default, so an attempt to call
23789+ # sem_open results in a 'Signal 12' error.
23790+ { echo "$as_me:$LINENO: checking whether POSIX semaphores are enabled" >&5
23791+ echo $ECHO_N "checking whether POSIX semaphores are enabled... $ECHO_C" >&6; }
23792+ if test "${ac_cv_posix_semaphores_enabled+set}" = set; then
23793+ echo $ECHO_N "(cached) $ECHO_C" >&6
23794+ else
23795+ if test "$cross_compiling" = yes; then
23796+ ac_cv_posix_semaphores_enabled=yes
23797+ else
23798+ cat >conftest.$ac_ext <<_ACEOF
23799+ /* confdefs.h. */
23800+ _ACEOF
23801+ cat confdefs.h >>conftest.$ac_ext
23802+ cat >>conftest.$ac_ext <<_ACEOF
23803+ /* end confdefs.h. */
23804+
23805+ #include <unistd.h>
23806+ #include <fcntl.h>
23807+ #include <stdio.h>
23808+ #include <semaphore.h>
23809+ #include <sys/stat.h>
23810+
23811+ int main(void) {
23812+ sem_t *a = sem_open("/autoconf", O_CREAT, S_IRUSR|S_IWUSR, 0);
23813+ if (a == SEM_FAILED) {
23814+ perror("sem_open");
23815+ return 1;
23816+ }
23817+ sem_close(a);
23818+ return 0;
23819+ }
23820+
23821+ _ACEOF
23822+ rm -f conftest$ac_exeext
23823+ if { (ac_try="$ac_link"
23824+ case "(($ac_try" in
23825+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
23826+ *) ac_try_echo=$ac_try;;
23827+ esac
23828+ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
23829+ (eval "$ac_link") 2>&5
23830+ ac_status=$?
23831+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
23832+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
23833+ { (case "(($ac_try" in
23834+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
23835+ *) ac_try_echo=$ac_try;;
23836+ esac
23837+ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
23838+ (eval "$ac_try") 2>&5
23839+ ac_status=$?
23840+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
23841+ (exit $ac_status); }; }; then
23842+ ac_cv_posix_semaphores_enabled=yes
23843+ else
23844+ echo "$as_me: program exited with status $ac_status" >&5
23845+ echo "$as_me: failed program was:" >&5
23846+ sed 's/^/| /' conftest.$ac_ext >&5
23847+
23848+ ( exit $ac_status )
23849+ ac_cv_posix_semaphores_enabled=no
23850+ fi
23851+ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
23852+ fi
23853+
23854+
23855+
23856+ fi
23857+
23858+ { echo "$as_me:$LINENO: result: $ac_cv_posix_semaphores_enabled" >&5
23859+ echo "${ECHO_T}$ac_cv_posix_semaphores_enabled" >&6; }
23860+ if test $ac_cv_posix_semaphores_enabled = no
23861+ then
23862+
23863+ cat >>confdefs.h <<\_ACEOF
23864+ #define HAVE_BROKEN_POSIX_SEMAPHORES 1
23865+ _ACEOF
23866+
23867+ fi
23868+
23869+
2378523870# Multiprocessing check for broken sem_getvalue
2378623871{ echo "$as_me:$LINENO: checking for broken sem_getvalue" >&5
2378723872echo $ECHO_N "checking for broken sem_getvalue... $ECHO_C" >&6; }
0 commit comments