0001-Adding-ability-to-detect-non-posix-extensions-for-pthreads.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From d1840e54a15fc454936cada10cce7fd91d06232b Mon Sep 17 00:00:00 2001
  2. From: Neil Horman <nhorman@gmail.com>
  3. Date: Thu, 15 Jul 2021 08:43:01 -0400
  4. Subject: [PATCH] Adding ability to detect non-posix extensions for pthreads
  5. Theres a desire to build rngd with musl, which doesn't have all the gnu
  6. extensions (but it has some). So test for those. Note, this requires
  7. the addition of the USE_EXTENSIONS macro to enable -d_GNU_SOURCE
  8. Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
  9. [Retrieved from:
  10. https://github.com/nhorman/rng-tools/commit/d1840e54a15fc454936cada10cce7fd91d06232b]
  11. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  12. ---
  13. configure.ac | 7 +++++++
  14. 1 file changed, 7 insertions(+)
  15. diff --git a/configure.ac b/configure.ac
  16. index 0fe06fc..de7dca3 100644
  17. --- a/configure.ac
  18. +++ b/configure.ac
  19. @@ -25,6 +25,7 @@ AC_CANONICAL_TARGET dnl required for broken AX_PTHREAD
  20. AM_INIT_AUTOMAKE([foreign])
  21. AC_CONFIG_HEADERS([rng-tools-config.h])
  22. AC_CONFIG_MACRO_DIRS([m4])
  23. +AC_USE_SYSTEM_EXTENSIONS
  24. dnl Parse options
  25. @@ -100,6 +101,12 @@ AS_IF(
  26. ], [AC_MSG_NOTICE([Disabling JITTER entropy source])]
  27. )
  28. +AC_CHECK_DECL(pthread_attr_setaffinity_np,
  29. + [AC_DEFINE([HAVE_PTHREAD_ATTR_SETAFFINITY], 1,[Set ATTR_SETAFFINITY])],
  30. + [ AC_CHECK_DECL(pthread_setaffinity_np,
  31. + [AC_DEFINE([HAVE_PTHREAD_SETAFFINITY],1, [Set PTHREAD_SETAFFINITY])], [ AC_MSG_ERROR([Neither pthread_setaffinity_np nor pthread_attr_setaffinity_np found])],[[#include <pthread.h>]])
  32. + ], [[#include <pthread.h>]])
  33. +
  34. AS_IF(
  35. [ test "x$with_nistbeacon" != "xno"],
  36. [