0002-cmake-fix-ucontext-detection.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 3c8d309616295045745e778000c0185eec4b21d9 Mon Sep 17 00:00:00 2001
  2. From: Bernd Kuhls <bernd.kuhls@t-online.de>
  3. Date: Sun, 7 Oct 2018 14:25:59 +0200
  4. Subject: [PATCH] cmake: fix ucontext detection
  5. On some archs uclibc does not provide the ucontext structure despite
  6. providing ucontext.h, for details see
  7. https://git.buildroot.net/buildroot/commit/?id=f1cbfeea95e6287c7a666aafc182ffa318eff262
  8. This patch improves the detection of ucontext by making sure that
  9. HAVE_UCONTEXT_H is only set when makecontext() was found.
  10. Patch sent upstream: https://github.com/MariaDB/server/pull/878
  11. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  12. ---
  13. configure.cmake | 10 +++++-----
  14. 1 file changed, 5 insertions(+), 5 deletions(-)
  15. diff --git a/configure.cmake b/configure.cmake
  16. index d840dd4e565..a5df355ac42 100644
  17. --- a/configure.cmake
  18. +++ b/configure.cmake
  19. @@ -986,12 +986,12 @@ CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in6" sin6_len
  20. SET(CMAKE_EXTRA_INCLUDE_FILES)
  21. -CHECK_INCLUDE_FILE(ucontext.h HAVE_UCONTEXT_H)
  22. -IF(NOT HAVE_UCONTEXT_H)
  23. - CHECK_INCLUDE_FILE(sys/ucontext.h HAVE_UCONTEXT_H)
  24. +CHECK_INCLUDE_FILE(ucontext.h HAVE_FILE_UCONTEXT_H)
  25. +IF(NOT HAVE_FILE_UCONTEXT_H)
  26. + CHECK_INCLUDE_FILE(sys/ucontext.h HAVE_FILE_UCONTEXT_H)
  27. ENDIF()
  28. -IF(HAVE_UCONTEXT_H)
  29. - CHECK_FUNCTION_EXISTS(makecontext HAVE_UCONTEXT_H)
  30. +IF(HAVE_FILE_UCONTEXT_H)
  31. + CHECK_FUNCTION_EXISTS(makecontext HAVE_UCONTEXT_H)
  32. ENDIF()
  33. CHECK_STRUCT_HAS_MEMBER("struct timespec" tv_sec "time.h" STRUCT_TIMESPEC_HAS_TV_SEC)
  34. --
  35. 2.19.0