New module 'libsigsegv'.
authorBruno Haible <bruno@clisp.org>
Mon, 14 Jul 2008 11:17:26 +0000 (13:17 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 14 Jul 2008 11:17:26 +0000 (13:17 +0200)
ChangeLog
MODULES.html.sh
m4/libsigsegv.m4 [new file with mode: 0644]
modules/libsigsegv [new file with mode: 0644]

index b96e58d..660c12f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-07-14  Sam Steingold  <sds@gnu.org>
+            Bruno Haible  <bruno@clisp.org>
+
+       New module libsigsegv.
+       * modules/libsigsegv: New file.
+       * m4/libsigsegv.m4: New file, from GNU clisp sigsegv.m4 with
+       modifications.
+       * MODULES.html.sh (Signal handling): New section.
+
 2008-07-14  Bruno Haible  <bruno@clisp.org>
 
        * modules/unictype/ctype-* (Description): Add the word "function".
index 118e3f5..7b771ef 100755 (executable)
@@ -2380,6 +2380,18 @@ func_all_modules ()
   func_module openmp
   func_end_table
 
+  element="Signal handling"
+  element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
+  func_section_wrap posix_ext_signal
+  func_wrap H3
+  func_echo "$element"
+
+  func_begin_table
+  func_module c-stack
+  func_module libsigsegv
+  func_module sig2str
+  func_end_table
+
   element="Internationalization functions"
   element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"`
   func_section_wrap posix_ext_i18n
@@ -2877,7 +2889,6 @@ func_all_modules ()
   func_module argz
   func_module byteswap
   func_module exitfail
-  func_module c-stack
   func_module error
   func_module extensions
   func_module getdomainname
@@ -2891,7 +2902,6 @@ func_all_modules ()
   func_module quotearg
   func_module quote
   func_module readutmp
-  func_module sig2str
   func_module sysexits
   func_module verror
   func_module visibility
diff --git a/m4/libsigsegv.m4 b/m4/libsigsegv.m4
new file mode 100644 (file)
index 0000000..339cc69
--- /dev/null
@@ -0,0 +1,50 @@
+# libsigsegv.m4 serial 1
+dnl Copyright (C) 2002-2003, 2008 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible, Sam Steingold.
+
+AC_PREREQ(2.61)
+
+AC_DEFUN([gl_LIBSIGSEGV],
+[
+  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+
+  dnl Search for libsigsegv and define LIBSIGSEGV, LTLIBSIGSEGV and INCSIGSEGV
+  dnl accordingly.
+  AC_LIB_LINKFLAGS_BODY([sigsegv])
+
+  dnl Add $INCSIGSEGV to CPPFLAGS before performing the following checks,
+  dnl because if the user has installed libsigsegv and not disabled its use
+  dnl via --without-libsigsegv-prefix, he wants to use it.
+  gl_save_CPPFLAGS="$CPPFLAGS"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCSIGSEGV])
+
+  AC_CACHE_CHECK([for libsigsegv], gl_cv_lib_sigsegv, [
+    gl_cv_lib_sigsegv="no, consider installing GNU libsigsegv"
+    gl_save_LIBS="$LIBS"
+    LIBS="$LIBS $LIBSIGSEGV"
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sigsegv.h>]],
+      [sigsegv_deinstall_handler();])],
+      [gl_cv_lib_sigsegv=yes])
+    LIBS="$gl_save_LIBS"
+  ])
+  if test "$gl_cv_lib_sigsegv" = yes; then
+    AC_DEFINE([HAVE_LIBSIGSEGV], 1,
+      [Define if you have the libsigsegv library.])
+    AC_MSG_CHECKING([how to link with libsigsegv])
+    AC_MSG_RESULT([$LIBSIGSEGV])
+  else
+    dnl If $LIBSIGSEGV didn't lead to a usable library, we don't need
+    dnl $INCSIGSEGV either.
+    CPPFLAGS="$gl_save_CPPFLAGS"
+    LIBSIGSEGV=
+    LTLIBSIGSEGV=
+  fi
+  AC_SUBST(LIBSIGSEGV)
+  AC_SUBST(LTLIBSIGSEGV)
+])
diff --git a/modules/libsigsegv b/modules/libsigsegv
new file mode 100644 (file)
index 0000000..7b34045
--- /dev/null
@@ -0,0 +1,27 @@
+Description:
+Handle page faults in user mode.
+
+Files:
+m4/libsigsegv.m4
+
+Depends-on:
+havelib
+
+configure.ac:
+gl_LIBSIGSEGV
+
+Makefile.am:
+
+Include:
+#if HAVE_LIBSIGSEGV
+# include <sigsegv.h>
+#endif
+
+Link:
+$(LTLIBSIGSEGV) when linking with libtool, $(LIBSIGSEGV) otherwise
+
+License:
+GPL
+
+Maintainer:
+Bruno Haible