diff options
author | Bruno Haible <bruno@clisp.org> | 2021-08-22 01:25:59 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2021-08-22 01:33:47 +0200 |
commit | 4ea0e64a8db7064427f6aa5624a4efd4b41db132 (patch) | |
tree | 6081197284cf0e81866b841e4b0f89f999ae7520 | |
parent | 4585c30b40122b7bfe299eac532b8a712607237b (diff) | |
download | gnulib-4ea0e64a8db7064427f6aa5624a4efd4b41db132.tar.gz |
c-stack: Test for libsigsegv once, not twice.
* m4/sigsegv.m4: New file, based on modules/sigsegv.
* modules/sigsegv (Files): Add it.
(configure.ac): Require gl_SIGSEGV. Test gl_sigsegv_uses_libsigsegv
instead of with_libsigsegv and gl_cv_lib_sigsegv.
* m4/c-stack.m4 (gl_C_STACK): Likewise.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | m4/c-stack.m4 | 12 | ||||
-rw-r--r-- | m4/sigsegv.m4 | 20 | ||||
-rw-r--r-- | modules/sigsegv | 15 |
4 files changed, 41 insertions, 17 deletions
@@ -1,5 +1,14 @@ 2021-08-21 Bruno Haible <bruno@clisp.org> + c-stack: Test for libsigsegv once, not twice. + * m4/sigsegv.m4: New file, based on modules/sigsegv. + * modules/sigsegv (Files): Add it. + (configure.ac): Require gl_SIGSEGV. Test gl_sigsegv_uses_libsigsegv + instead of with_libsigsegv and gl_cv_lib_sigsegv. + * m4/c-stack.m4 (gl_C_STACK): Likewise. + +2021-08-21 Bruno Haible <bruno@clisp.org> + rawmemchr: Fix use in relocatable-prog-wrapper (regression 2021-08-20). * lib/rawmemchr.c: Restore test of HAVE_RAWMEMCHR. * modules/relocatable-prog-wrapper (Depends-on): Add stdalign. @@ -23,7 +32,7 @@ 2021-08-17 Paul Eggert <eggert@cs.ucla.edu> - c-stack: fix libsigsegv dependency + c-stack: fix libsigsegv dependency (regression 2021-05-18) Problem reported for GNU grep by Evan Miller (Bug#50098). * m4/c-stack.m4 (gl_C_STACK): Call gl_LIBSIGSEGV before testing gl_cv_lib_sigsegv. diff --git a/m4/c-stack.m4 b/m4/c-stack.m4 index f3de54fad4..caf1d2de72 100644 --- a/m4/c-stack.m4 +++ b/m4/c-stack.m4 @@ -7,16 +7,14 @@ # Written by Paul Eggert. -# serial 24 +# serial 25 AC_DEFUN([gl_C_STACK], [ dnl 'c-stack' needs -lsigsegv if and only if the 'sigsegv' module needs it. - if test "$with_libsigsegv" = yes; then - gl_LIBSIGSEGV - if test "$gl_cv_lib_sigsegv" = yes; then - AC_SUBST([LIBCSTACK], [$LIBSIGSEGV]) - AC_SUBST([LTLIBCSTACK], [$LTLIBSIGSEGV]) - fi + AC_REQUIRE([gl_SIGSEGV]) + if test $gl_sigsegv_uses_libsigsegv = yes; then + AC_SUBST([LIBCSTACK], [$LIBSIGSEGV]) + AC_SUBST([LTLIBCSTACK], [$LTLIBSIGSEGV]) fi ]) diff --git a/m4/sigsegv.m4 b/m4/sigsegv.m4 new file mode 100644 index 0000000000..d5d1fc4b1a --- /dev/null +++ b/m4/sigsegv.m4 @@ -0,0 +1,20 @@ +# sigsegv.m4 serial 1 +dnl Copyright (C) 2021 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. + +AC_DEFUN_ONCE([gl_SIGSEGV], +[ + AC_ARG_WITH([libsigsegv], + [AS_HELP_STRING([--with-libsigsegv], + [use the GNU libsigsegv library, when present, instead of the gnulib module 'sigsegv'])]) + if test "$with_libsigsegv" = yes; then + gl_LIBSIGSEGV + gl_sigsegv_uses_libsigsegv="$gl_cv_lib_sigsegv" + else + gl_sigsegv_uses_libsigsegv=no + fi +]) diff --git a/modules/sigsegv b/modules/sigsegv index 2ef84332d2..fdd815c370 100644 --- a/modules/sigsegv +++ b/modules/sigsegv @@ -20,6 +20,7 @@ m4/mmap-anon.m4 m4/sigaltstack.m4 m4/stack-direction.m4 m4/libsigsegv.m4 +m4/sigsegv.m4 Depends-on: havelib @@ -28,15 +29,11 @@ stdint getpagesize configure.ac: -AC_ARG_WITH([libsigsegv], - [AS_HELP_STRING([--with-libsigsegv], - [use the GNU libsigsegv library, when present, instead of the gnulib module 'sigsegv'])]) -SIGSEGV_H=sigsegv.h -if test "$with_libsigsegv" = yes; then - gl_LIBSIGSEGV - if test "$gl_cv_lib_sigsegv" = yes; then - SIGSEGV_H= - fi +AC_REQUIRE([gl_SIGSEGV]) +if test $gl_sigsegv_uses_libsigsegv = yes; then + SIGSEGV_H= +else + SIGSEGV_H=sigsegv.h fi AC_SUBST([SIGSEGV_H]) AM_CONDITIONAL([GL_GENERATE_SIGSEGV_H], [test -n "$SIGSEGV_H"]) |