Fix crash at startup under XASSERTS.
[bpt/emacs.git] / m4 / pthread_sigmask.m4
CommitLineData
d9706d9f 1# pthread_sigmask.m4 serial 7-emacs1
6db30f83
PE
2dnl Copyright (C) 2011 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
2a84b02d 7AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
6db30f83 8[
2a84b02d
PE
9 AC_CHECK_FUNCS_ONCE([pthread_sigmask])
10 LIB_PTHREAD_SIGMASK=
2a84b02d
PE
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
6db30f83 22 fi
2a84b02d
PE
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".
6db30f83 27])