1 From 2c855b76362d1027abea967ac253cae8a7c160c3 Mon Sep 17 00:00:00 2001
2 From: Trevor Woerner <twoerner@gmail.com>
3 Date: Wed, 6 May 2020 17:38:05 -0400
4 Subject: [PATCH] configure.ac: add library if header found (#10)
6 If the pthread.h header is found, make sure library containing
7 "pthread_atfork" is added to the list of libraries against which to link.
8 On some hosts (e.g. openSUSE 15.1) "-lpthread" needs to be explicitly added
9 in order for the code to compile correctly.
11 Signed-off-by: Trevor Woerner <twoerner@gmail.com>
14 1 file changed, 3 insertions(+), 1 deletion(-)
16 diff --git a/configure.ac b/configure.ac
17 index 9d6aca3..4fbe4d3 100644
20 @@ -56,7 +56,9 @@ AC_CHECK_HEADERS(sys/xattr.h, [], [
21 AC_CHECK_HEADERS(attr/xattr.h, [], [AC_MSG_WARN(attr/xattr.h not found, disabling file system capabilities.)])
23 AC_CHECK_HEADERS(linux/securebits.h, [], [])
24 -AC_CHECK_HEADERS(pthread.h, [], [AC_MSG_WARN(pthread.h not found, disabling pthread_atfork.)])
25 +AC_CHECK_HEADERS(pthread.h,
26 + [AC_SEARCH_LIBS(pthread_atfork, pthread)],
27 + [AC_MSG_WARN(pthread.h not found, disabling pthread_atfork.)])