libcap-ng: add package libcap-ng
[feed/packages.git] / libs / libcap-ng / patches / add_library_if_header_found.patch
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)
5
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.
10
11 Signed-off-by: Trevor Woerner <twoerner@gmail.com>
12 ---
13 configure.ac | 4 +++-
14 1 file changed, 3 insertions(+), 1 deletion(-)
15
16 diff --git a/configure.ac b/configure.ac
17 index 9d6aca3..4fbe4d3 100644
18 --- a/configure.ac
19 +++ b/configure.ac
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.)])
22 ])
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.)])
28
29 AC_C_CONST
30 AC_C_INLINE