summaryrefslogtreecommitdiff
path: root/debian/patches/fix_without_sysctl.patch
blob: e16b4f167af613519139f824f388e208e38e4a62 (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
45
46
47
48
49
50
51
52
53
54
55
Description: Don't use sysctl on unsupported targets
Author: Thorsten Glaser <tg@mirbsd.de>
Forwarded: not yet
Debian-Bug: 792264
Last-Update: <2016-02-08>

--- opencv-2.4.9.1+dfsg.orig/CMakeLists.txt
+++ opencv-2.4.9.1+dfsg/CMakeLists.txt
@@ -441,6 +441,8 @@ if(UNIX)
   else()
     set(HAVE_LIBPTHREAD YES)
   endif()
+
+  CHECK_INCLUDE_FILE(sys/sysctl.h HAVE_SYS_SYSCTL_H)
 endif()
 
 include(cmake/OpenCVPCHSupport.cmake)
--- opencv-2.4.9.1+dfsg.orig/modules/core/src/parallel.cpp
+++ opencv-2.4.9.1+dfsg/modules/core/src/parallel.cpp
@@ -57,7 +57,9 @@
     #if defined ANDROID
         #include <sys/sysconf.h>
     #elif !defined __GNU__
+      #ifdef HAVE_SYS_SYSCTL_H
         #include <sys/sysctl.h>
+      #endif
     #endif
 #endif
 
--- opencv-2.4.9.1+dfsg.orig/modules/core/src/system.cpp
+++ opencv-2.4.9.1+dfsg/modules/core/src/system.cpp
@@ -164,9 +164,11 @@ std::wstring GetTempFileNameWinRT(std::w
 #if defined ANDROID
 #include <sys/sysconf.h>
 #elif !defined __GNU__
+#ifdef HAVE_SYS_SYSCTL_H
 #include <sys/sysctl.h>
 #endif
 #endif
+#endif
 
 #ifdef ANDROID
 # include <android/log.h>
--- opencv-2.4.9.1+dfsg.orig/modules/highgui/src/cap_ffmpeg_impl.hpp
+++ opencv-2.4.9.1+dfsg/modules/highgui/src/cap_ffmpeg_impl.hpp
@@ -149,7 +149,9 @@ extern "C" {
     #include <unistd.h>
     #include <stdio.h>
     #include <sys/types.h>
+    #ifdef HAVE_SYS_SYSCTL_H
     #include <sys/sysctl.h>
+    #endif
 #endif
 
 #ifndef MIN