pthread_sigmask: Assume POSIX when not gl_THREADLIB.
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 8 Jul 2011 17:49:07 +0000 (10:49 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 8 Jul 2011 17:52:34 +0000 (10:52 -0700)
* m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK):
When gl_THREADLIB is not in use, assume that the POSIX sematics
are desired.  This is better for Emacs, which uses POSIX semantics
on GNUish and/or POSIXish platforms, and does not use threads at
all otherwise.

ChangeLog
m4/pthread_sigmask.m4

index cffcb04..cd3fce3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2011-07-08  Paul Eggert  <eggert@cs.ucla.edu>
 
+       pthread_sigmask: Assume POSIX when not gl_THREADLIB.
+       * m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK):
+       When gl_THREADLIB is not in use, assume that the POSIX sematics
+       are desired.  This is better for Emacs, which uses POSIX semantics
+       on GNUish and/or POSIXish platforms, and does not use threads at
+       all otherwise.
+
        pthread_sigmask: fix typo when testing for libraries
        * m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK):
        AC_LINK_IFELSE, not AC_COMPILE_IFELSE.
index 80ac4c5..dfa0f66 100644 (file)
@@ -1,4 +1,4 @@
-# pthread_sigmask.m4 serial 6
+# pthread_sigmask.m4 serial 7
 dnl Copyright (C) 2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -57,12 +57,17 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
       fi
     fi
   ] ,[
-    dnl If module 'threadlib' is not in use, assume all programs will be
-    dnl single-threaded.
-    if test $ac_cv_func_pthread_sigmask = yes; then
-      REPLACE_PTHREAD_SIGMASK=1
-    else
-      HAVE_PTHREAD_SIGMASK=0
+    dnl gl_THREADLIB is not in use.  Assume the application wants
+    dnl POSIX semantics.
+    if test $ac_cv_func_pthread_sigmask != yes; then
+      gl_save_LIBS=$LIBS
+      AC_SEARCH_LIBS([pthread_sigmask], [pthread c_r])
+      LIBS=$gl_save_LIBS
+      if test "$ac_cv_search_pthread_sigmask" = no; then
+        HAVE_PTHREAD_SIGMASK=0
+      elif test "$ac_cv_search_pthread_sigmask" != 'none required'; then
+        LIB_PTHREAD_SIGMASK=$ac_cv_search_pthread_sigmask
+      fi
     fi
   ])
   AC_SUBST([LIB_PTHREAD_SIGMASK])