]> Savannah Git Hosting - gnulib.git/commitdiff
c-stack: streamline Solaris configuration
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 3 Oct 2020 19:51:08 +0000 (12:51 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 3 Oct 2020 20:02:40 +0000 (13:02 -0700)
* lib/c-stack.c: Omit mention of HAVE_SIGALTSTACK, since
the code is used only if a test for sigaltstack worked
in some other way.
* m4/c-stack.m4 (gl_PREREQ_C_STACK): Do not require gl_LIBSIGSEGV;
instead, execute gl_LIBSIGSEGV only if needed (because the XSI
heuristic does not work).
* modules/c-stack (Files): Add m4/libsigsegv.m4, since
we no longer require the libsigsegv module.
(Depends-on): Depend on havelib, not libsigsegv.

ChangeLog
lib/c-stack.c
m4/c-stack.m4
modules/c-stack

index 7f54b7860cdb69cf0acc57bddd9f770ba62d1e5b..7b528a73dbaa349dae4a7bfe48750b90836badbf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2020-10-03  Paul Eggert  <eggert@cs.ucla.edu>
 
+       c-stack: streamline Solaris configuration
+       * lib/c-stack.c: Omit mention of HAVE_SIGALTSTACK, since
+       the code is used only if a test for sigaltstack worked
+       in some other way.
+       * m4/c-stack.m4 (gl_PREREQ_C_STACK): Do not require gl_LIBSIGSEGV;
+       instead, execute gl_LIBSIGSEGV only if needed (because the XSI
+       heuristic does not work).
+       * modules/c-stack (Files): Add m4/libsigsegv.m4, since
+       we no longer require the libsigsegv module.
+       (Depends-on): Depend on havelib, not libsigsegv.
+
        c-stack: stop using SIGSTKSZ
        It’s been proposed to stop making SIGSTKSZ an integer constant:
        https://sourceware.org/pipermail/libc-alpha/2020-September/118028.html
index cf0fe8da0e081fb03e2c7bd35bca5585a4ad7ec8..187bcafff178a1e7f1d244c8b7e88441124cb8b6 100644 (file)
@@ -107,8 +107,7 @@ static char const * volatile program_error_message;
 static char const * volatile stack_overflow_message;
 
 #if (USE_LIBSIGSEGV                                           \
-     || (HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK            \
-         && HAVE_STACK_OVERFLOW_HANDLING))
+     || (HAVE_DECL_SIGALTSTACK && HAVE_STACK_OVERFLOW_HANDLING))
 
 /* Output an error message, then exit with status EXIT_FAILURE if it
    appears to have been a stack overflow, or with a core dump
@@ -236,7 +235,7 @@ c_stack_action (_GL_ASYNC_SAFE void (*action) (int))
   return 0;
 }
 
-#elif HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK && HAVE_STACK_OVERFLOW_HANDLING
+#elif HAVE_DECL_SIGALTSTACK && HAVE_STACK_OVERFLOW_HANDLING
 
 # if SIGINFO_WORKS
 
@@ -361,8 +360,7 @@ c_stack_action (_GL_ASYNC_SAFE void (*action) (int))
 }
 
 #else /* ! (USE_LIBSIGSEGV
-            || (HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK
-                && HAVE_STACK_OVERFLOW_HANDLING)) */
+            || (HAVE_DECL_SIGALTSTACK && HAVE_STACK_OVERFLOW_HANDLING)) */
 
 int
 c_stack_action (_GL_ASYNC_SAFE void (*action) (int)  _GL_UNUSED)
index e98f80fffba99e53af2f758d4c2e3c160d247af9..1523a724da15b10202cad4bad55aa7b67b665589 100644 (file)
@@ -7,7 +7,7 @@
 
 # Written by Paul Eggert.
 
-# serial 18
+# serial 19
 
 AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
   [
@@ -351,21 +351,20 @@ int main ()
 
 AC_DEFUN([gl_PREREQ_C_STACK],
   [AC_REQUIRE([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC])
-   AC_REQUIRE([gl_LIBSIGSEGV])
 
    AC_CHECK_FUNCS_ONCE([sigaltstack])
    AC_CHECK_DECLS([sigaltstack], , , [[#include <signal.h>]])
 
    AC_CHECK_HEADERS_ONCE([ucontext.h])
 
-   AC_CHECK_TYPES([stack_t], , , [#include <signal.h>])
+   AC_CHECK_TYPES([stack_t], , , [[#include <signal.h>]])
 
    dnl c-stack does not need -lsigsegv if the system has XSI heuristics.
-   if test "$gl_cv_lib_sigsegv" = yes \
-       && test "$gl_cv_sys_xsi_stack_overflow_heuristic" != yes; then
-     AC_SUBST([LIBCSTACK], [$LIBSIGSEGV])
-     AC_SUBST([LTLIBCSTACK], [$LTLIBSIGSEGV])
-   fi
+   AS_IF([test "$gl_cv_sys_xsi_stack_overflow_heuristic" != yes],
+     [gl_LIBSIGSEGV
+      AS_IF([test "$gl_cv_lib_sigsegv" = yes],
+        [AC_SUBST([LIBCSTACK], [$LIBSIGSEGV])
+         AC_SUBST([LTLIBCSTACK], [$LTLIBSIGSEGV])])])
 ])
 
 AC_DEFUN([gl_C_STACK],
index 5ddf6e6f5a8a79198eb12640327b16c43787a38c..77cf6aab84a9441db056d280e2f6dbf47dd067a8 100644 (file)
@@ -5,6 +5,7 @@ Files:
 lib/c-stack.h
 lib/c-stack.c
 m4/c-stack.m4
+m4/libsigsegv.m4
 
 Depends-on:
 c99
@@ -12,10 +13,10 @@ errno
 exitfail
 getprogname
 gettext-h
+havelib
 ignore-value
 intprops
 inttypes
-libsigsegv
 mempcpy
 raise
 sigaction