Commit 2a576f71 authored by Bernd Kuhls's avatar Bernd Kuhls Committed by Sergey Vojtovich

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.
Signed-off-by: default avatarBernd Kuhls <bernd.kuhls@t-online.de>
parent d8974ebd
...@@ -1107,11 +1107,11 @@ SET(CMAKE_EXTRA_INCLUDE_FILES) ...@@ -1107,11 +1107,11 @@ SET(CMAKE_EXTRA_INCLUDE_FILES)
CHECK_STRUCT_HAS_MEMBER("struct dirent" d_ino "dirent.h" STRUCT_DIRENT_HAS_D_INO) CHECK_STRUCT_HAS_MEMBER("struct dirent" d_ino "dirent.h" STRUCT_DIRENT_HAS_D_INO)
CHECK_STRUCT_HAS_MEMBER("struct dirent" d_namlen "dirent.h" STRUCT_DIRENT_HAS_D_NAMLEN) CHECK_STRUCT_HAS_MEMBER("struct dirent" d_namlen "dirent.h" STRUCT_DIRENT_HAS_D_NAMLEN)
SET(SPRINTF_RETURNS_INT 1) SET(SPRINTF_RETURNS_INT 1)
CHECK_INCLUDE_FILE(ucontext.h HAVE_UCONTEXT_H) CHECK_INCLUDE_FILE(ucontext.h HAVE_FILE_UCONTEXT_H)
IF(NOT HAVE_UCONTEXT_H) IF(NOT HAVE_FILE_UCONTEXT_H)
CHECK_INCLUDE_FILE(sys/ucontext.h HAVE_UCONTEXT_H) CHECK_INCLUDE_FILE(sys/ucontext.h HAVE_FILE_UCONTEXT_H)
ENDIF() ENDIF()
IF(HAVE_UCONTEXT_H) IF(HAVE_FILE_UCONTEXT_H)
CHECK_FUNCTION_EXISTS(makecontext HAVE_UCONTEXT_H) CHECK_FUNCTION_EXISTS(makecontext HAVE_UCONTEXT_H)
ENDIF() ENDIF()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment