Fix rmail-forward.
[emacs.git] / m4 / pthread_sigmask.m4
blobe98d8e0f4ea0d1700f6bef68f3c1f74f6c5a8983
1 # pthread_sigmask.m4 serial 7-emacs1
2 dnl Copyright (C) 2011 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
9   AC_CHECK_FUNCS_ONCE([pthread_sigmask])
10   LIB_PTHREAD_SIGMASK=
11     dnl gl_THREADLIB is not in use.  Assume the application wants
12     dnl POSIX semantics.
13     if test $ac_cv_func_pthread_sigmask != yes; then
14       gl_save_LIBS=$LIBS
15       AC_SEARCH_LIBS([pthread_sigmask], [pthread c_r])
16       LIBS=$gl_save_LIBS
17       if test "$ac_cv_search_pthread_sigmask" = no; then
18         HAVE_PTHREAD_SIGMASK=0
19       elif test "$ac_cv_search_pthread_sigmask" != 'none required'; then
20         LIB_PTHREAD_SIGMASK=$ac_cv_search_pthread_sigmask
21       fi
22     fi
23   AC_SUBST([LIB_PTHREAD_SIGMASK])
24   dnl We don't need a variable LTLIB_PTHREAD_SIGMASK, because when
25   dnl "$gl_threads_api" = posix, $LTLIBMULTITHREAD and $LIBMULTITHREAD are the
26   dnl same: either both empty or both "-lpthread".