From f4263532991aaf779accaa9946553ff0563e16d5 Mon Sep 17 00:00:00 2001
From: Konstantin Osipov <kostja@tarantool.org>
Date: Sat, 12 Oct 2013 12:08:36 +0400
Subject: [PATCH] Don't use check_prototype_definition(), it's not in CMake
 2.6.

---
 CMakeLists.txt | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f2e223f01..41d94485dc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,7 +16,6 @@ include(CheckCSourceCompiles)
 include(CheckCXXSourceCompiles)
 include(TestBigEndian)
 include(CheckFunctionExists)
-include(CheckPrototypeDefinition)
 include(FindOptionalPackage)
 
 find_program(ECHO echo)
@@ -80,8 +79,11 @@ check_function_exists(memmem HAVE_MEMMEM)
 check_function_exists(memrchr HAVE_MEMRCHR)
 check_function_exists(sendfile HAVE_SENDFILE)
 if (HAVE_SENDFILE)
-    check_prototype_definition(sendfile "ssize_t sendfile(int out_fd, int in_fd, off_t * offset, size_t count)" "0" "sys/sendfile.h" HAVE_SENDFILE_LINUX)
-    check_prototype_definition(sendfile "int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags)" "0" "" HAVE_SENDFILE_BSD)
+    if (TARGET_OS_LINUX)
+        set(HAVE_SENDFILE_LINUX 1)
+    else(HAVE_SENDFILE)
+        set(HAVE_SENDFILE_BSD 1)
+    endif()
 endif()
 check_function_exists(open_memstream HAVE_OPEN_MEMSTREAM)
 
-- 
GitLab