summaryrefslogtreecommitdiffstats
path: root/package/mariadb/0002-cmake-fix-ucontext-detection.patch
blob: fff43e821e33369306090dcbf4f782595e8b9910 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 3c8d309616295045745e778000c0185eec4b21d9 Mon Sep 17 00:00:00 2001
From: Bernd Kuhls <bernd.kuhls@t-online.de>
Date: Sun, 7 Oct 2018 14:25:59 +0200
Subject: [PATCH] cmake: fix ucontext detection

On some archs uclibc does not provide the ucontext structure despite
providing ucontext.h, for details see
https://git.buildroot.net/buildroot/commit/?id=f1cbfeea95e6287c7a666aafc182ffa318eff262

This patch improves the detection of ucontext by making sure that
HAVE_UCONTEXT_H is only set when makecontext() was found.

Patch sent upstream: https://github.com/MariaDB/server/pull/878

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 configure.cmake | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/configure.cmake b/configure.cmake
index d840dd4e565..a5df355ac42 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -986,12 +986,12 @@ CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in6" sin6_len
 
 SET(CMAKE_EXTRA_INCLUDE_FILES) 
 
-CHECK_INCLUDE_FILE(ucontext.h HAVE_UCONTEXT_H)
-IF(NOT HAVE_UCONTEXT_H)
-  CHECK_INCLUDE_FILE(sys/ucontext.h HAVE_UCONTEXT_H)
+CHECK_INCLUDE_FILE(ucontext.h HAVE_FILE_UCONTEXT_H)
+IF(NOT HAVE_FILE_UCONTEXT_H)
+  CHECK_INCLUDE_FILE(sys/ucontext.h HAVE_FILE_UCONTEXT_H)
 ENDIF()
-IF(HAVE_UCONTEXT_H)
-  CHECK_FUNCTION_EXISTS(makecontext HAVE_UCONTEXT_H)
+IF(HAVE_FILE_UCONTEXT_H)
+  CHECK_FUNCTION_EXISTS(makecontext HAVE_UCONTEXT_H)
 ENDIF()
 
 CHECK_STRUCT_HAS_MEMBER("struct timespec" tv_sec "time.h" STRUCT_TIMESPEC_HAS_TV_SEC)
-- 
2.19.0

OpenPOWER on IntegriCloud