bootstrap: Avoid failure when gnulib-tool removed gettext.m4.
[gnulib.git] / modules / sigsegv
blobeedce3a9d91c470f7707412ae25cbde4bdfa01b9
1 Description:
2 A simplified variant of GNU libsigsegv.
3 It implements the most important features of GNU libsigsegv: catching SIGSEGV
4 and catching stack overflow. It does *not* implement the 'sigsegv_dispatcher'
5 type (which is not multithread-safe).
6 It supports all modern Unix-like platforms: Linux, Hurd, FreeBSD, NetBSD,
7 OpenBSD, macOS, AIX, Solaris, Cygwin, Haiku, even IRIX. It does *not* support
8 HP-UX, Minix, native Windows; on these platforms the module compiles and
9 provides a <sigsegv.h> header file, but it does not define HAVE_SIGSEGV_RECOVERY
10 and HAVE_STACK_OVERFLOW_RECOVERY.
11 Unlike GNU libsigsegv, which consists of many .h and .c files, this module
12 compiles to just two object files, rather than a library.
14 Files:
15 lib/sigsegv.in.h
16 lib/sigsegv.c
17 lib/stackvma.h
18 lib/stackvma.c
19 m4/mmap-anon.m4
20 m4/musl.m4
21 m4/sigaltstack.m4
22 m4/stack-direction.m4
23 m4/libsigsegv.m4
24 m4/sigsegv.m4
26 Depends-on:
27 gen-header
28 havelib
29 host-cpu-c-abi
30 stdint
31 getpagesize
33 configure.ac:
34 AC_REQUIRE([gl_SIGSEGV])
35 if test $gl_sigsegv_uses_libsigsegv = yes; then
36   GL_GENERATE_SIGSEGV_H=false
37 else
38   GL_GENERATE_SIGSEGV_H=true
40 gl_CONDITIONAL_HEADER([sigsegv.h])
41 AC_PROG_MKDIR_P
42 if $GL_GENERATE_SIGSEGV_H; then
43   dnl Persuade glibc <sys/ucontext.h> to declare macros designating register
44   dnl indices: REG_RSP on x86_64, REG_ESP on i386.
45   dnl Persuade Solaris OpenIndiana <ucontext.h> to include <sys/regset.h>,
46   dnl which declares macros designating register indices, such as ESP on i386.
47   dnl Persuade Solaris OpenIndiana <unistd.h> to declare mincore().
48   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
50   gl_MUSL_LIBC
52   AC_REQUIRE([AC_CANONICAL_HOST])
53   case "$host_os" in
54     solaris2.11)
55       AC_DEFINE([SOLARIS11], [1], [Define on Solaris 11 and its derivates.])
56       ;;
57   esac
59   gl_FUNC_MMAP_ANON
61   dnl Stack direction.
62   SV_STACK_DIRECTION
64   dnl Catching stack overflow requires an alternate signal stack.
65   dnl The old "install a guard page" trick would be unreliable, because
66   dnl we don't know where exactly to place the guard page.
67   SV_SIGALTSTACK
69   AC_CHECK_FUNCS_ONCE([getrlimit])
72 Makefile.am:
73 BUILT_SOURCES += $(SIGSEGV_H)
75 if GL_GENERATE_SIGSEGV_H
76 sigsegv.h: sigsegv.in.h $(top_builddir)/config.status
77 @NMD@   $(AM_V_GEN)$(MKDIR_P) '%reldir%'
78         $(gl_V_at)$(SED_HEADER_TO_AT_t) $(srcdir)/sigsegv.in.h
79         $(AM_V_at)mv $@-t $@
80 else
81 sigsegv.h: $(top_builddir)/config.status
82         rm -f $@
83 endif
84 MOSTLYCLEANFILES += sigsegv.h sigsegv.h-t
86 if GL_GENERATE_SIGSEGV_H
87 lib_SOURCES += sigsegv.c stackvma.c
88 endif
90 Include:
91 <sigsegv.h>
93 Link:
94 $(LTLIBSIGSEGV) when linking with libtool, $(LIBSIGSEGV) otherwise
96 License:
97 GPLv2+
99 Maintainer:
100 Bruno Haible