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.
........
diff --git a/configure b/configure
index 69ad375..a7dfabb 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 76405 .
+# From configure.in Revision: 76552 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for python 3.2.
 #
@@ -23587,6 +23587,90 @@
 
 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.
+{ echo "$as_me:$LINENO: checking whether POSIX semaphores are enabled" >&5
+echo $ECHO_N "checking whether POSIX semaphores are enabled... $ECHO_C" >&6; }
+if test "${ac_cv_posix_semaphores_enabled+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_posix_semaphores_enabled=yes
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#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;
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_posix_semaphores_enabled=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_posix_semaphores_enabled=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_cv_posix_semaphores_enabled" >&5
+echo "${ECHO_T}$ac_cv_posix_semaphores_enabled" >&6; }
+if test $ac_cv_posix_semaphores_enabled = no
+then
+
+cat >>confdefs.h <<\_ACEOF
+#define POSIX_SEMAPHORES_NOT_ENABLED 1
+_ACEOF
+
+fi
+
 # Multiprocessing check for broken sem_getvalue
 { echo "$as_me:$LINENO: checking for broken sem_getvalue" >&5
 echo $ECHO_N "checking for broken sem_getvalue... $ECHO_C" >&6; }