aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert2011-07-06 10:58:37 -0700
committerPaul Eggert2011-07-06 10:58:37 -0700
commit6db30f83447f4667d2ca84c33979f2745ca96bd5 (patch)
tree9304b3fb361c6aa6f0b3274efbe0fdc379785b68 /m4
parent84e04a29b9fddf5c5ede9873aa0356cd13af6f41 (diff)
downloademacs-6db30f83447f4667d2ca84c33979f2745ca96bd5.tar.gz
emacs-6db30f83447f4667d2ca84c33979f2745ca96bd5.zip
Add gnulib support for pthread_sigmask.
* Makefile.in (GNULIB_MODULES): Add pthread_sigmask. (GNULIB_TOOL_FLAGS): Avoid sigprocmask. Emacs does its own implementation of 'sigprocmask' on Windows, and it assumes 'sigprocmask' on non-Windows hosts, so it doesn't need the sigprocmask module. * lib/signal.in.h, m4/pthread_sigmask.m4, m4/signal_h.m4: New files, automatically imported from gnulib. * lib/gnulib.mk, m4/gl-comp.m4: Automatically-imported update due to the above changes. * .bzrignore: Add lib/signal.h.
Diffstat (limited to 'm4')
-rw-r--r--m4/gl-comp.m411
-rw-r--r--m4/pthread_sigmask.m426
-rw-r--r--m4/signal_h.m476
3 files changed, 113 insertions, 0 deletions
diff --git a/m4/gl-comp.m4 b/m4/gl-comp.m4
index 16bb02e686f..004c01a10a0 100644
--- a/m4/gl-comp.m4
+++ b/m4/gl-comp.m4
@@ -52,7 +52,9 @@ AC_DEFUN([gl_EARLY],
52 # Code from module lstat: 52 # Code from module lstat:
53 # Code from module mktime: 53 # Code from module mktime:
54 # Code from module multiarch: 54 # Code from module multiarch:
55 # Code from module pthread_sigmask:
55 # Code from module readlink: 56 # Code from module readlink:
57 # Code from module signal:
56 # Code from module socklen: 58 # Code from module socklen:
57 # Code from module ssize_t: 59 # Code from module ssize_t:
58 # Code from module stat: 60 # Code from module stat:
@@ -140,12 +142,15 @@ if test $REPLACE_MKTIME = 1; then
140fi 142fi
141gl_TIME_MODULE_INDICATOR([mktime]) 143gl_TIME_MODULE_INDICATOR([mktime])
142gl_MULTIARCH 144gl_MULTIARCH
145gl_PTHREAD_SIGMASK
146gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask])
143gl_FUNC_READLINK 147gl_FUNC_READLINK
144if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then 148if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
145 AC_LIBOBJ([readlink]) 149 AC_LIBOBJ([readlink])
146 gl_PREREQ_READLINK 150 gl_PREREQ_READLINK
147fi 151fi
148gl_UNISTD_MODULE_INDICATOR([readlink]) 152gl_UNISTD_MODULE_INDICATOR([readlink])
153gl_SIGNAL_H
149gl_TYPE_SOCKLEN_T 154gl_TYPE_SOCKLEN_T
150gt_TYPE_SSIZE_T 155gt_TYPE_SSIZE_T
151gl_STDARG_H 156gl_STDARG_H
@@ -241,6 +246,9 @@ gl_STDLIB_MODULE_INDICATOR([strtoull])
241 if test $REPLACE_LSTAT = 1; then 246 if test $REPLACE_LSTAT = 1; then
242 func_gl_gnulib_m4code_stat 247 func_gl_gnulib_m4code_stat
243 fi 248 fi
249 if test $REPLACE_PTHREAD_SIGMASK = 1; then
250 func_gl_gnulib_m4code_sigprocmask
251 fi
244 if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then 252 if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
245 func_gl_gnulib_m4code_stat 253 func_gl_gnulib_m4code_stat
246 fi 254 fi
@@ -433,6 +441,7 @@ AC_DEFUN([gl_FILE_LIST], [
433 lib/sha256.h 441 lib/sha256.h
434 lib/sha512.c 442 lib/sha512.c
435 lib/sha512.h 443 lib/sha512.h
444 lib/signal.in.h
436 lib/stat.c 445 lib/stat.c
437 lib/stdarg.in.h 446 lib/stdarg.in.h
438 lib/stdbool.in.h 447 lib/stdbool.in.h
@@ -470,10 +479,12 @@ AC_DEFUN([gl_FILE_LIST], [
470 m4/md5.m4 479 m4/md5.m4
471 m4/mktime.m4 480 m4/mktime.m4
472 m4/multiarch.m4 481 m4/multiarch.m4
482 m4/pthread_sigmask.m4
473 m4/readlink.m4 483 m4/readlink.m4
474 m4/sha1.m4 484 m4/sha1.m4
475 m4/sha256.m4 485 m4/sha256.m4
476 m4/sha512.m4 486 m4/sha512.m4
487 m4/signal_h.m4
477 m4/socklen.m4 488 m4/socklen.m4
478 m4/ssize_t.m4 489 m4/ssize_t.m4
479 m4/st_dm_mode.m4 490 m4/st_dm_mode.m4
diff --git a/m4/pthread_sigmask.m4 b/m4/pthread_sigmask.m4
new file mode 100644
index 00000000000..d25e2cc3e70
--- /dev/null
+++ b/m4/pthread_sigmask.m4
@@ -0,0 +1,26 @@
1# pthread_sigmask.m4 serial 2
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
7AC_DEFUN([gl_PTHREAD_SIGMASK],
8[
9 m4_ifdef([gl_THREADLIB], [
10 AC_REQUIRE([gl_THREADLIB])
11 if test "$gl_threads_api" = posix; then
12 gl_save_LIBS="$LIBS"
13 LIBS="$LIBS $LIBMULTITHREAD"
14 AC_CHECK_FUNCS([pthread_sigmask])
15 LIBS="$gl_save_LIBS"
16 else
17 ac_cv_func_pthread_sigmask=no
18 fi
19 ], [
20 AC_CHECK_FUNCS_ONCE([pthread_sigmask])
21 ])
22
23 if test $ac_cv_func_pthread_sigmask = no; then
24 REPLACE_PTHREAD_SIGMASK=1
25 fi
26])
diff --git a/m4/signal_h.m4 b/m4/signal_h.m4
new file mode 100644
index 00000000000..53972fba54f
--- /dev/null
+++ b/m4/signal_h.m4
@@ -0,0 +1,76 @@
1# signal_h.m4 serial 14
2dnl Copyright (C) 2007-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
7AC_DEFUN([gl_SIGNAL_H],
8[
9 AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
10 AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
11 gl_NEXT_HEADERS([signal.h])
12
13# AIX declares sig_atomic_t to already include volatile, and C89 compilers
14# then choke on 'volatile sig_atomic_t'. C99 requires that it compile.
15 AC_CHECK_TYPE([volatile sig_atomic_t], [],
16 [HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0], [[
17#include <signal.h>
18 ]])
19
20 AC_REQUIRE([AC_TYPE_UID_T])
21
22 dnl Persuade glibc <signal.h> to define sighandler_t.
23 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
24 AC_CHECK_TYPE([sighandler_t], [], [HAVE_SIGHANDLER_T=0], [[
25#include <signal.h>
26 ]])
27
28 dnl Check for declarations of anything we want to poison if the
29 dnl corresponding gnulib module is not in use.
30 gl_WARN_ON_USE_PREPARE([[#include <signal.h>
31 ]], [pthread_sigmask sigaction
32 sigaddset sigdelset sigemptyset sigfillset sigismember
33 sigpending sigprocmask])
34])
35
36AC_DEFUN([gl_CHECK_TYPE_SIGSET_T],
37[
38 AC_CHECK_TYPES([sigset_t],
39 [gl_cv_type_sigset_t=yes], [gl_cv_type_sigset_t=no],
40 [[
41 #include <signal.h>
42 /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
43 #include <sys/types.h>
44 ]])
45 if test $gl_cv_type_sigset_t != yes; then
46 HAVE_SIGSET_T=0
47 fi
48])
49
50AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR],
51[
52 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
53 AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
54 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
55 dnl Define it also as a C macro, for the benefit of the unit tests.
56 gl_MODULE_INDICATOR_FOR_TESTS([$1])
57])
58
59AC_DEFUN([gl_SIGNAL_H_DEFAULTS],
60[
61 GNULIB_PTHREAD_SIGMASK=0; AC_SUBST([GNULIB_PTHREAD_SIGMASK])
62 GNULIB_SIGNAL_H_SIGPIPE=0; AC_SUBST([GNULIB_SIGNAL_H_SIGPIPE])
63 GNULIB_SIGPROCMASK=0; AC_SUBST([GNULIB_SIGPROCMASK])
64 GNULIB_SIGACTION=0; AC_SUBST([GNULIB_SIGACTION])
65 dnl Assume proper GNU behavior unless another module says otherwise.
66 HAVE_POSIX_SIGNALBLOCKING=1; AC_SUBST([HAVE_POSIX_SIGNALBLOCKING])
67 HAVE_SIGSET_T=1; AC_SUBST([HAVE_SIGSET_T])
68 HAVE_SIGINFO_T=1; AC_SUBST([HAVE_SIGINFO_T])
69 HAVE_SIGACTION=1; AC_SUBST([HAVE_SIGACTION])
70 HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
71 AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION])
72 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
73 AC_SUBST([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T])
74 HAVE_SIGHANDLER_T=1; AC_SUBST([HAVE_SIGHANDLER_T])
75 REPLACE_PTHREAD_SIGMASK=0; AC_SUBST([REPLACE_PTHREAD_SIGMASK])
76])