commit:     7962de6a71a4f8c99df1ad448a455c96ee4c33b3
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 11 08:45:52 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Mar 11 08:55:49 2021 +0000
URL:        https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=7962de6a

Fix detecting libsigsegv

Apparently the hack to pretend that libsigsegv's headers do not exist
does not work anymore.  Fix the test to actually respect library check
status instead.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 configure.ac           | 1 -
 tests/Makefile.am      | 2 ++
 tests/libsigsegv_tst.c | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index d0f46e2..b3bc10d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -90,7 +90,6 @@ AM_CONDITIONAL([SB_SCHIZO], [test "x$enable_schizo" != "xno"])
 dnl this test fills up the stack and then triggers a segfault ...
 dnl but it's hard to wrap things without a stack, so let's ignore
 dnl this test for now ...
-ac_cv_header_sigsegv_h=no
 ac_cv_lib_sigsegv_stackoverflow_install_handler=false
 
 dnl Checks for libraries.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3baf5b1..52746ee 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -96,7 +96,9 @@ sb_printf_tst_LDADD = $(top_builddir)/libsbutil/libsbutil.la
 
 malloc_hooked_tst_LDFLAGS = $(AM_LDFLAGS) -pthread
 
+libsigsegv_tst_CPPFLAGS = ${AM_CPPFLAGS}
 if HAVE_LIBSIGSEGV
+libsigsegv_tst_CPPFLAGS += -DHAVE_LIBSIGSEGV
 libsigsegv_tst_LDADD = -lsigsegv
 endif
 

diff --git a/tests/libsigsegv_tst.c b/tests/libsigsegv_tst.c
index 82ed21b..2b17fa4 100644
--- a/tests/libsigsegv_tst.c
+++ b/tests/libsigsegv_tst.c
@@ -11,7 +11,7 @@
 
 #define WRITE(msg) ({ ssize_t w = write(1, msg, sizeof(msg) - 1); w; })
 
-#ifdef HAVE_SIGSEGV_H
+#if defined(HAVE_SIGSEGV_H) && defined(HAVE_LIBSIGSEGV)
 #include <sigsegv.h>
 
 static int segv_handler(void *address, int serious)

Reply via email to