You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.2 KiB

  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. If the pthread.h header is found, make sure library containing
  6. "pthread_atfork" is added to the list of libraries against which to link.
  7. On some hosts (e.g. openSUSE 15.1) "-lpthread" needs to be explicitly added
  8. in order for the code to compile correctly.
  9. Signed-off-by: Trevor Woerner <twoerner@gmail.com>
  10. ---
  11. configure.ac | 4 +++-
  12. 1 file changed, 3 insertions(+), 1 deletion(-)
  13. diff --git a/configure.ac b/configure.ac
  14. index 9d6aca3..4fbe4d3 100644
  15. --- a/configure.ac
  16. +++ b/configure.ac
  17. @@ -56,7 +56,9 @@ AC_CHECK_HEADERS(sys/xattr.h, [], [
  18. AC_CHECK_HEADERS(attr/xattr.h, [], [AC_MSG_WARN(attr/xattr.h not found, disabling file system capabilities.)])
  19. ])
  20. AC_CHECK_HEADERS(linux/securebits.h, [], [])
  21. -AC_CHECK_HEADERS(pthread.h, [], [AC_MSG_WARN(pthread.h not found, disabling pthread_atfork.)])
  22. +AC_CHECK_HEADERS(pthread.h,
  23. + [AC_SEARCH_LIBS(pthread_atfork, pthread)],
  24. + [AC_MSG_WARN(pthread.h not found, disabling pthread_atfork.)])
  25. AC_C_CONST
  26. AC_C_INLINE