Update buidlroot to version 2016.08.1
This commit is contained in:
229
bsp/buildroot/package/opencv/0001-atomic.patch
Normal file
229
bsp/buildroot/package/opencv/0001-atomic.patch
Normal file
@@ -0,0 +1,229 @@
|
||||
Bug#714923: opencv FTBFS on sparc64
|
||||
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=714923
|
||||
|
||||
opencv uses functions from <ext/atomicity.h>, but it wrongly assumes
|
||||
this functions apply to an int type. While it is true for some
|
||||
architectures, some architectures are using a long type there. The
|
||||
correct type to use is _Atomic_word.
|
||||
|
||||
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
|
||||
|
||||
diff -Nur opencv-2.4.12.3.orig/modules/core/include/opencv2/core/core.hpp opencv-2.4.12.3/modules/core/include/opencv2/core/core.hpp
|
||||
--- opencv-2.4.12.3.orig/modules/core/include/opencv2/core/core.hpp 2015-10-26 08:56:34.000000000 +0100
|
||||
+++ opencv-2.4.12.3/modules/core/include/opencv2/core/core.hpp 2016-04-03 00:10:50.455774144 +0200
|
||||
@@ -1290,7 +1290,7 @@
|
||||
operator const _Tp*() const;
|
||||
|
||||
_Tp* obj; //< the object pointer.
|
||||
- int* refcount; //< the associated reference counter
|
||||
+ _Atomic_word* refcount; //< the associated reference counter
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
@@ -1490,9 +1490,9 @@
|
||||
public:
|
||||
MatAllocator() {}
|
||||
virtual ~MatAllocator() {}
|
||||
- virtual void allocate(int dims, const int* sizes, int type, int*& refcount,
|
||||
+ virtual void allocate(int dims, const int* sizes, int type, _Atomic_word*& refcount,
|
||||
uchar*& datastart, uchar*& data, size_t* step) = 0;
|
||||
- virtual void deallocate(int* refcount, uchar* datastart, uchar* data) = 0;
|
||||
+ virtual void deallocate(_Atomic_word* refcount, uchar* datastart, uchar* data) = 0;
|
||||
};
|
||||
|
||||
/*!
|
||||
@@ -1985,7 +1985,7 @@
|
||||
|
||||
//! pointer to the reference counter;
|
||||
// when matrix points to user-allocated data, the pointer is NULL
|
||||
- int* refcount;
|
||||
+ _Atomic_word* refcount;
|
||||
|
||||
//! helper fields used in locateROI and adjustROI
|
||||
uchar* datastart;
|
||||
@@ -3408,7 +3408,7 @@
|
||||
{
|
||||
Hdr(int _dims, const int* _sizes, int _type);
|
||||
void clear();
|
||||
- int refcount;
|
||||
+ _Atomic_word refcount;
|
||||
int dims;
|
||||
int valueOffset;
|
||||
size_t nodeSize;
|
||||
diff -Nur opencv-2.4.12.3.orig/modules/core/include/opencv2/core/gpumat.hpp opencv-2.4.12.3/modules/core/include/opencv2/core/gpumat.hpp
|
||||
--- opencv-2.4.12.3.orig/modules/core/include/opencv2/core/gpumat.hpp 2015-10-26 08:56:34.000000000 +0100
|
||||
+++ opencv-2.4.12.3/modules/core/include/opencv2/core/gpumat.hpp 2016-04-02 23:08:58.116874218 +0200
|
||||
@@ -301,7 +301,7 @@
|
||||
|
||||
//! pointer to the reference counter;
|
||||
// when GpuMatrix points to user-allocated data, the pointer is NULL
|
||||
- int* refcount;
|
||||
+ _Atomic_word* refcount;
|
||||
|
||||
//! helper fields used in locateROI and adjustROI
|
||||
uchar* datastart;
|
||||
diff -Nur opencv-2.4.12.3.orig/modules/core/include/opencv2/core/operations.hpp opencv-2.4.12.3/modules/core/include/opencv2/core/operations.hpp
|
||||
--- opencv-2.4.12.3.orig/modules/core/include/opencv2/core/operations.hpp 2015-10-26 08:56:34.000000000 +0100
|
||||
+++ opencv-2.4.12.3/modules/core/include/opencv2/core/operations.hpp 2016-04-02 23:12:59.148385306 +0200
|
||||
@@ -2589,7 +2589,7 @@
|
||||
{
|
||||
if(obj)
|
||||
{
|
||||
- refcount = (int*)fastMalloc(sizeof(*refcount));
|
||||
+ refcount = (_Atomic_word*)fastMalloc(sizeof(*refcount));
|
||||
*refcount = 1;
|
||||
}
|
||||
else
|
||||
@@ -2628,7 +2628,7 @@
|
||||
{
|
||||
if (this != &_ptr)
|
||||
{
|
||||
- int* _refcount = _ptr.refcount;
|
||||
+ _Atomic_word* _refcount = _ptr.refcount;
|
||||
if( _refcount )
|
||||
CV_XADD(_refcount, 1);
|
||||
release();
|
||||
diff -Nur opencv-2.4.12.3.orig/modules/core/src/gpumat.cpp opencv-2.4.12.3/modules/core/src/gpumat.cpp
|
||||
--- opencv-2.4.12.3.orig/modules/core/src/gpumat.cpp 2015-10-26 08:56:34.000000000 +0100
|
||||
+++ opencv-2.4.12.3/modules/core/src/gpumat.cpp 2016-04-02 23:14:38.894804300 +0200
|
||||
@@ -716,7 +716,7 @@
|
||||
datastart = data = static_cast<uchar*>(devPtr);
|
||||
dataend = data + nettosize;
|
||||
|
||||
- refcount = static_cast<int*>(fastMalloc(sizeof(*refcount)));
|
||||
+ refcount = static_cast<_Atomic_word*>(fastMalloc(sizeof(*refcount)));
|
||||
*refcount = 1;
|
||||
}
|
||||
}
|
||||
diff -Nur opencv-2.4.12.3.orig/modules/core/src/matrix.cpp opencv-2.4.12.3/modules/core/src/matrix.cpp
|
||||
--- opencv-2.4.12.3.orig/modules/core/src/matrix.cpp 2015-10-26 08:56:34.000000000 +0100
|
||||
+++ opencv-2.4.12.3/modules/core/src/matrix.cpp 2016-04-02 23:59:53.405491031 +0200
|
||||
@@ -213,7 +213,7 @@
|
||||
{
|
||||
size_t totalsize = alignSize(step.p[0]*size.p[0], (int)sizeof(*refcount));
|
||||
data = datastart = (uchar*)fastMalloc(totalsize + (int)sizeof(*refcount));
|
||||
- refcount = (int*)(data + totalsize);
|
||||
+ refcount = (_Atomic_word*)(data + totalsize);
|
||||
*refcount = 1;
|
||||
}
|
||||
else
|
||||
@@ -228,7 +228,7 @@
|
||||
allocator = 0;
|
||||
size_t totalSize = alignSize(step.p[0]*size.p[0], (int)sizeof(*refcount));
|
||||
data = datastart = (uchar*)fastMalloc(totalSize + (int)sizeof(*refcount));
|
||||
- refcount = (int*)(data + totalSize);
|
||||
+ refcount = (_Atomic_word*)(data + totalSize);
|
||||
*refcount = 1;
|
||||
}
|
||||
#else
|
||||
diff -Nur opencv-2.4.12.3.orig/modules/core/src/system.cpp opencv-2.4.12.3/modules/core/src/system.cpp
|
||||
--- opencv-2.4.12.3.orig/modules/core/src/system.cpp 2015-10-26 08:56:34.000000000 +0100
|
||||
+++ opencv-2.4.12.3/modules/core/src/system.cpp 2016-04-02 23:33:19.298905578 +0200
|
||||
@@ -892,7 +892,7 @@
|
||||
void unlock() { LeaveCriticalSection(&cs); }
|
||||
|
||||
CRITICAL_SECTION cs;
|
||||
- int refcount;
|
||||
+ _Atomic_word refcount;
|
||||
};
|
||||
|
||||
#ifndef __GNUC__
|
||||
@@ -920,7 +920,7 @@
|
||||
void unlock() { OSSpinLockUnlock(&sl); }
|
||||
|
||||
OSSpinLock sl;
|
||||
- int refcount;
|
||||
+ _Atomic_word refcount;
|
||||
};
|
||||
|
||||
#elif defined __linux__ && !defined ANDROID && !defined __LINUXTHREADS_OLD__
|
||||
@@ -935,7 +935,7 @@
|
||||
void unlock() { pthread_spin_unlock(&sl); }
|
||||
|
||||
pthread_spinlock_t sl;
|
||||
- int refcount;
|
||||
+ _Atomic_word refcount;
|
||||
};
|
||||
|
||||
#else
|
||||
@@ -950,7 +950,7 @@
|
||||
void unlock() { pthread_mutex_unlock(&sl); }
|
||||
|
||||
pthread_mutex_t sl;
|
||||
- int refcount;
|
||||
+ _Atomic_word refcount;
|
||||
};
|
||||
|
||||
#endif
|
||||
diff -Nur opencv-2.4.12.3.orig/modules/gpu/include/opencv2/gpu/gpu.hpp opencv-2.4.12.3/modules/gpu/include/opencv2/gpu/gpu.hpp
|
||||
--- opencv-2.4.12.3.orig/modules/gpu/include/opencv2/gpu/gpu.hpp 2015-10-26 08:56:34.000000000 +0100
|
||||
+++ opencv-2.4.12.3/modules/gpu/include/opencv2/gpu/gpu.hpp 2016-04-02 23:16:19.737293785 +0200
|
||||
@@ -125,7 +125,7 @@
|
||||
size_t step;
|
||||
|
||||
uchar* data;
|
||||
- int* refcount;
|
||||
+ _Atomic_word* refcount;
|
||||
|
||||
uchar* datastart;
|
||||
uchar* dataend;
|
||||
diff -Nur opencv-2.4.12.3.orig/modules/ocl/include/opencv2/ocl/ocl.hpp opencv-2.4.12.3/modules/ocl/include/opencv2/ocl/ocl.hpp
|
||||
--- opencv-2.4.12.3.orig/modules/ocl/include/opencv2/ocl/ocl.hpp 2015-10-26 08:56:34.000000000 +0100
|
||||
+++ opencv-2.4.12.3/modules/ocl/include/opencv2/ocl/ocl.hpp 2016-04-02 23:18:55.715331443 +0200
|
||||
@@ -404,7 +404,7 @@
|
||||
|
||||
//! pointer to the reference counter;
|
||||
// when oclMatrix points to user-allocated data, the pointer is NULL
|
||||
- int *refcount;
|
||||
+ _Atomic_word *refcount;
|
||||
|
||||
//! helper fields used in locateROI and adjustROI
|
||||
//datastart and dataend are not used in current version
|
||||
diff -Nur opencv-2.4.12.3.orig/modules/ocl/src/matrix_operations.cpp opencv-2.4.12.3/modules/ocl/src/matrix_operations.cpp
|
||||
--- opencv-2.4.12.3.orig/modules/ocl/src/matrix_operations.cpp 2015-10-26 08:56:34.000000000 +0100
|
||||
+++ opencv-2.4.12.3/modules/ocl/src/matrix_operations.cpp 2016-04-02 23:19:23.633128033 +0200
|
||||
@@ -591,7 +591,7 @@
|
||||
datastart = data = (uchar *)dev_ptr;
|
||||
dataend = data + nettosize;
|
||||
|
||||
- refcount = (int *)fastMalloc(sizeof(*refcount));
|
||||
+ refcount = (_Atomic_word *)fastMalloc(sizeof(*refcount));
|
||||
*refcount = 1;
|
||||
}
|
||||
}
|
||||
diff -Nur opencv-2.4.12.3.orig/modules/python/src2/cv2.cpp opencv-2.4.12.3/modules/python/src2/cv2.cpp
|
||||
--- opencv-2.4.12.3.orig/modules/python/src2/cv2.cpp 2015-10-26 08:56:34.000000000 +0100
|
||||
+++ opencv-2.4.12.3/modules/python/src2/cv2.cpp 2016-04-02 23:18:34.897991791 +0200
|
||||
@@ -157,12 +157,12 @@
|
||||
static size_t REFCOUNT_OFFSET = (size_t)&(((PyObject*)0)->ob_refcnt) +
|
||||
(0x12345678 != *(const size_t*)"\x78\x56\x34\x12\0\0\0\0\0")*sizeof(int);
|
||||
|
||||
-static inline PyObject* pyObjectFromRefcount(const int* refcount)
|
||||
+static inline PyObject* pyObjectFromRefcount(const _Atomic_word* refcount)
|
||||
{
|
||||
return (PyObject*)((size_t)refcount - REFCOUNT_OFFSET);
|
||||
}
|
||||
|
||||
-static inline int* refcountFromPyObject(const PyObject* obj)
|
||||
+static inline _Atomic_word* refcountFromPyObject(const PyObject* obj)
|
||||
{
|
||||
return (int*)((size_t)obj + REFCOUNT_OFFSET);
|
||||
}
|
||||
@@ -173,7 +173,7 @@
|
||||
NumpyAllocator() {}
|
||||
~NumpyAllocator() {}
|
||||
|
||||
- void allocate(int dims, const int* sizes, int type, int*& refcount,
|
||||
+ void allocate(int dims, const int* sizes, int type, _Atomic_word*& refcount,
|
||||
uchar*& datastart, uchar*& data, size_t* step)
|
||||
{
|
||||
PyEnsureGIL gil;
|
||||
@@ -206,7 +206,7 @@
|
||||
datastart = data = (uchar*)PyArray_DATA((PyArrayObject*) o);
|
||||
}
|
||||
|
||||
- void deallocate(int* refcount, uchar*, uchar*)
|
||||
+ void deallocate(_Atomic_word* refcount, uchar*, uchar*)
|
||||
{
|
||||
PyEnsureGIL gil;
|
||||
if( !refcount )
|
||||
@@ -1,49 +0,0 @@
|
||||
From ea50be0529c248961e1b66293f8a9e4b807294a6 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Martin <s.martin49@gmail.com>
|
||||
Date: Sun, 12 Oct 2014 10:17:23 +0200
|
||||
Subject: [PATCH] core: fix x86 PIC code compilation
|
||||
|
||||
This bug was triggered by Buildroot autobuilders [1,2], causing this
|
||||
kind of failures [3,4]:
|
||||
|
||||
[ 14%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o
|
||||
/home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp: In function '(static initializers for /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp)':
|
||||
/home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp:280:10: error: inconsistent operand constraints in an 'asm'
|
||||
make[3]: *** [modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o] Error 1
|
||||
|
||||
[1] http://buildroot.org/
|
||||
[2] http://autobuild.buildroot.org/
|
||||
[3] http://autobuild.buildroot.org/?reason=opencv-2.4.10
|
||||
[4] http://autobuild.buildroot.org/results/483/4838285b25d6293a5cf0bb9eadd5040a7c75d766/build-end.log
|
||||
|
||||
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
|
||||
---
|
||||
modules/core/src/system.cpp | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp
|
||||
index 5a970d5..e9ffdc7 100644
|
||||
--- a/modules/core/src/system.cpp
|
||||
+++ b/modules/core/src/system.cpp
|
||||
@@ -267,14 +267,17 @@ struct HWFeatures
|
||||
: "cc"
|
||||
);
|
||||
#else
|
||||
+ // We need to preserve ebx since we are compiling PIC code.
|
||||
+ // This means we cannot use "=b" for the 2nd output register.
|
||||
asm volatile
|
||||
(
|
||||
"pushl %%ebx\n\t"
|
||||
"movl $7,%%eax\n\t"
|
||||
"movl $0,%%ecx\n\t"
|
||||
"cpuid\n\t"
|
||||
+ "movl %%ebx,%1\n\t"
|
||||
"popl %%ebx\n\t"
|
||||
- : "=a"(cpuid_data[0]), "=b"(cpuid_data[1]), "=c"(cpuid_data[2]), "=d"(cpuid_data[3])
|
||||
+ : "=a"(cpuid_data[0]), "=r"(cpuid_data[1]), "=c"(cpuid_data[2]), "=d"(cpuid_data[3])
|
||||
:
|
||||
: "cc"
|
||||
);
|
||||
--
|
||||
2.1.2
|
||||
|
||||
31
bsp/buildroot/package/opencv/0002-avoid-sysctl_h.patch
Normal file
31
bsp/buildroot/package/opencv/0002-avoid-sysctl_h.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
From upstream master branch:
|
||||
https://github.com/Itseez/opencv/blob/master/modules/core/src/
|
||||
|
||||
Do not include sysctl.h targeting Linux systems.
|
||||
|
||||
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
|
||||
|
||||
diff -Nur opencv-2.4.12.3.orig/modules/core/src/parallel.cpp opencv-2.4.12.3/modules/core/src/parallel.cpp
|
||||
--- opencv-2.4.12.3.orig/modules/core/src/parallel.cpp 2015-10-26 08:56:34.000000000 +0100
|
||||
+++ opencv-2.4.12.3/modules/core/src/parallel.cpp 2016-04-05 12:59:37.750143762 +0200
|
||||
@@ -56,7 +56,7 @@
|
||||
#include <sys/types.h>
|
||||
#if defined ANDROID
|
||||
#include <sys/sysconf.h>
|
||||
- #else
|
||||
+ #elif defined __APPLE__
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
#endif
|
||||
diff -Nur opencv-2.4.12.3.orig/modules/core/src/system.cpp opencv-2.4.12.3/modules/core/src/system.cpp
|
||||
--- opencv-2.4.12.3.orig/modules/core/src/system.cpp 2015-10-26 08:56:34.000000000 +0100
|
||||
+++ opencv-2.4.12.3/modules/core/src/system.cpp 2016-04-05 13:05:22.468323717 +0200
|
||||
@@ -163,7 +163,7 @@
|
||||
#include <sys/types.h>
|
||||
#if defined ANDROID
|
||||
#include <sys/sysconf.h>
|
||||
-#else
|
||||
+#elif defined __APPLE__
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,40 +0,0 @@
|
||||
superres: Fix return value VideoFrameSource_GPU
|
||||
|
||||
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
|
||||
|
||||
From 2e393ab83362743ba1825ad4b31d4a2925c606b4 Mon Sep 17 00:00:00 2001
|
||||
From: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
|
||||
Date: Mon, 27 Oct 2014 13:39:35 +0000
|
||||
Subject: [PATCH] superres: Fix return value VideoFrameSource_GPU
|
||||
|
||||
superres module fails to compile with the following error messages:
|
||||
|
||||
[100%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/super_resolution.cpp.o
|
||||
/opencv-2.4.10/modules/superres/src/frame_source.cpp: In function 'cv::Ptr<cv::superres::FrameSource> cv::superres::createFrameSource_Video_GPU(const string&)':
|
||||
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: expected type-specifier before 'VideoFrameSource'
|
||||
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: could not convert '(int*)operator new(4ul)' from 'int*' to 'cv::Ptr<cv::superres::FrameSource>'
|
||||
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: expected ';' before 'VideoFrameSource'
|
||||
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:41: error: 'VideoFrameSource' was not declared in this scope
|
||||
/opencv-2.4.10/modules/superres/src/frame_source.cpp:264:1: error: control reaches end of non-void function [-Werror=return-type]
|
||||
cc1plus: some warnings being treated as errors
|
||||
make[3]: *** [modules/superres/CMakeFiles/opencv_superres.dir/src/frame_source.cpp.o] Error 1
|
||||
make[3]: *** Waiting for unfinished jobs....
|
||||
|
||||
This is caused because the return value of the createFrameSource_Video_GPU function should be a VideoFrameSource_GPU object.
|
||||
---
|
||||
modules/superres/src/frame_source.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules/superres/src/frame_source.cpp b/modules/superres/src/frame_source.cpp
|
||||
index 5f59a98..c5b2e76 100644
|
||||
--- a/modules/superres/src/frame_source.cpp
|
||||
+++ b/modules/superres/src/frame_source.cpp
|
||||
@@ -260,7 +260,7 @@ namespace
|
||||
|
||||
Ptr<FrameSource> cv::superres::createFrameSource_Video_GPU(const string& fileName)
|
||||
{
|
||||
- return new VideoFrameSource(fileName);
|
||||
+ return new VideoFrameSource_GPU(fileName);
|
||||
}
|
||||
|
||||
#endif // HAVE_OPENCV_GPU
|
||||
@@ -1,156 +0,0 @@
|
||||
From eceada586bbf18fc267e437522ec4f1f23ddc656 Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Martin <s.martin49@gmail.com>
|
||||
Date: Fri, 3 Oct 2014 00:32:40 +0200
|
||||
Subject: [PATCH] cmake/OpenCVGenPkgconfig.cmake: rework opencv.pc generation
|
||||
|
||||
Using absolute path to locate the components in the "Libs:" field of the
|
||||
*.pc can badly break cross-compilation, especially when building
|
||||
statically linked objects.
|
||||
|
||||
Indeed, pkg-config automatically replaces the '-I...' and '-L...' paths
|
||||
when the PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_LIBDIR environment
|
||||
variables are set [1]. This feature is very helpful and common in
|
||||
cross-compilation framework like Buildroot [2,3].
|
||||
|
||||
When there are absolute paths in the *.pc files, pkg-config won't be
|
||||
able to do the path substitions for these paths when the afromentioned
|
||||
environment variables are set.
|
||||
In such case, since the prefix is the target one, not the sysroot one,
|
||||
these libraries' abolute paths will point to:
|
||||
- in the best case: a non-existing file (i.e. these files do not exists
|
||||
on the host system;
|
||||
- at worst: the host system's libraries. This will make the linking
|
||||
failed because these host system's libraries will most likely not be
|
||||
build for the target architecture [4].
|
||||
|
||||
So, this patch replace the components' absolute paths by the form:
|
||||
-L<libdir> -l<libname>
|
||||
|
||||
This way, the linker will be able to resolve each dependency path,
|
||||
whatever the kind of objects/build (shared object or static build) it
|
||||
is dealing with.
|
||||
|
||||
Note that for static link, the library order does matter [5]. The order
|
||||
of the opencv components has been carefully chosen to comply with this
|
||||
requirement.
|
||||
|
||||
Fixes #3931
|
||||
|
||||
[1] http://linux.die.net/man/1/pkg-config
|
||||
[2] http://buildroot.org/
|
||||
[3] http://git.buildroot.net/buildroot/tree/package/pkgconf/pkg-config.in
|
||||
[4] http://autobuild.buildroot.net/results/e8a/e8a859276db34aff87ef181b0cce98916b0afc90/build-end.log
|
||||
[5] http://stackoverflow.com/questions/45135/linker-order-gcc
|
||||
|
||||
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
|
||||
|
||||
---
|
||||
Note: this patch properly applies on top of the master branch, though it
|
||||
has been written on top of the 2.4 branch.
|
||||
---
|
||||
cmake/OpenCVGenPkgconfig.cmake | 64 +++++++++++++++++++++++++++---------------
|
||||
1 file changed, 42 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/cmake/OpenCVGenPkgconfig.cmake b/cmake/OpenCVGenPkgconfig.cmake
|
||||
index fa57db9..183c56d 100644
|
||||
--- a/cmake/OpenCVGenPkgconfig.cmake
|
||||
+++ b/cmake/OpenCVGenPkgconfig.cmake
|
||||
@@ -8,10 +8,6 @@
|
||||
#
|
||||
# ${BIN_DIR}/unix-install/opencv.pc -> For use *with* "make install"
|
||||
# -------------------------------------------------------------------------------------------
|
||||
-set(prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
-set(exec_prefix "\${prefix}")
|
||||
-set(libdir "") #TODO: need link paths for OpenCV_EXTRA_COMPONENTS
|
||||
-set(includedir "\${prefix}/${OPENCV_INCLUDE_INSTALL_PATH}")
|
||||
|
||||
if(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
set(ocv_optkind OPT)
|
||||
@@ -35,42 +31,66 @@ ocv_list_reverse(OpenCV_LIB_COMPONENTS)
|
||||
ocv_list_reverse(OpenCV_EXTRA_COMPONENTS)
|
||||
|
||||
#build the list of components
|
||||
-set(OpenCV_LIB_COMPONENTS_ "")
|
||||
-foreach(CVLib ${OpenCV_LIB_COMPONENTS})
|
||||
- get_target_property(libpath ${CVLib} LOCATION_${CMAKE_BUILD_TYPE})
|
||||
- get_filename_component(libname "${libpath}" NAME)
|
||||
|
||||
- if(INSTALL_TO_MANGLED_PATHS)
|
||||
- set(libname "${libname}.${OPENCV_VERSION}")
|
||||
- endif()
|
||||
+# Note:
|
||||
+# when linking against static libraries, if libfoo depends on libbar, then
|
||||
+# libfoo must come first in the linker flags.
|
||||
+
|
||||
+# world is a special target whose library should come first, especially for
|
||||
+# static link.
|
||||
+if(OpenCV_LIB_COMPONENTS MATCHES "opencv_world")
|
||||
+ list(REMOVE_ITEM OpenCV_LIB_COMPONENTS "opencv_world")
|
||||
+ list(INSERT OpenCV_LIB_COMPONENTS 0 "opencv_world")
|
||||
+endif()
|
||||
+
|
||||
+set(OpenCV_LIB_COMPONENTS_)
|
||||
+foreach(CVLib ${OpenCV_LIB_COMPONENTS})
|
||||
|
||||
- #need better solution....
|
||||
- if(libpath MATCHES "3rdparty")
|
||||
- set(installDir "share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH}")
|
||||
+ get_target_property(libloc ${CVLib} LOCATION_${CMAKE_BUILD_TYPE})
|
||||
+ if(libloc MATCHES "3rdparty")
|
||||
+ set(libpath "\${exec_prefix}/share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH}")
|
||||
else()
|
||||
- set(installDir "${OPENCV_LIB_INSTALL_PATH}")
|
||||
+ set(libpath "\${exec_prefix}/${OPENCV_LIB_INSTALL_PATH}")
|
||||
endif()
|
||||
+ list(APPEND OpenCV_LIB_COMPONENTS_ "-L${libpath}")
|
||||
+
|
||||
+ get_filename_component(libname ${CVLib} NAME_WE)
|
||||
+ string(REGEX REPLACE "^lib" "" libname "${libname}")
|
||||
+ list(APPEND OpenCV_LIB_COMPONENTS_ "-l${libname}")
|
||||
|
||||
- set(OpenCV_LIB_COMPONENTS_ "${OpenCV_LIB_COMPONENTS_} \${exec_prefix}/${installDir}/${libname}")
|
||||
endforeach()
|
||||
|
||||
# add extra dependencies required for OpenCV
|
||||
-set(OpenCV_LIB_COMPONENTS ${OpenCV_LIB_COMPONENTS_})
|
||||
if(OpenCV_EXTRA_COMPONENTS)
|
||||
foreach(extra_component ${OpenCV_EXTRA_COMPONENTS})
|
||||
|
||||
- if(extra_component MATCHES "^-[lL]" OR extra_component MATCHES "[\\/]")
|
||||
- set(maybe_l_prefix "")
|
||||
+ if(extra_component MATCHES "^-[lL]")
|
||||
+ set(libprefix "")
|
||||
+ set(libname "${extra_component}")
|
||||
+ elseif(extra_component MATCHES "[\\/]")
|
||||
+ get_filename_component(libdir "${extra_component}" PATH)
|
||||
+ list(APPEND OpenCV_LIB_COMPONENTS_ "-L${libdir}")
|
||||
+ get_filename_component(libname "${extra_component}" NAME_WE)
|
||||
+ string(REGEX REPLACE "^lib" "" libname "${libname}")
|
||||
+ set(libprefix "-l")
|
||||
else()
|
||||
- set(maybe_l_prefix "-l")
|
||||
+ set(libprefix "-l")
|
||||
+ set(libname "${extra_component}")
|
||||
endif()
|
||||
-
|
||||
- set(OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS} ${maybe_l_prefix}${extra_component}")
|
||||
+ list(APPEND OpenCV_LIB_COMPONENTS_ "${libprefix}${libname}")
|
||||
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
+list(REMOVE_DUPLICATES OpenCV_LIB_COMPONENTS_)
|
||||
+string(REPLACE ";" " " OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS_}")
|
||||
+
|
||||
#generate the .pc file
|
||||
+set(prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
+set(exec_prefix "\${prefix}")
|
||||
+set(libdir "\${exec_prefix}/${OPENCV_LIB_INSTALL_PATH}")
|
||||
+set(includedir "\${prefix}/${OPENCV_INCLUDE_INSTALL_PATH}")
|
||||
+
|
||||
if(INSTALL_TO_MANGLED_PATHS)
|
||||
set(OPENCV_PC_FILE_NAME "opencv-${OPENCV_VERSION}.pc")
|
||||
else()
|
||||
--
|
||||
2.4.1
|
||||
|
||||
@@ -17,70 +17,105 @@ comment "OpenCV modules"
|
||||
config BR2_PACKAGE_OPENCV_LIB_CALIB3D
|
||||
bool "calib3d"
|
||||
default y
|
||||
select BR2_PACKAGE_OPENCV_LIB_FEATURES2D
|
||||
select BR2_PACKAGE_OPENCV_LIB_IMGPROC
|
||||
help
|
||||
Include opencv_calib3d module into the OpenCV build.
|
||||
|
||||
config BR2_PACKAGE_OPENCV_LIB_CONTRIB
|
||||
bool "contrib"
|
||||
default y
|
||||
select BR2_PACKAGE_OPENCV_LIB_CALIB3D
|
||||
select BR2_PACKAGE_OPENCV_LIB_FEATURES2D
|
||||
select BR2_PACKAGE_OPENCV_LIB_IMGPROC
|
||||
select BR2_PACKAGE_OPENCV_LIB_ML
|
||||
select BR2_PACKAGE_OPENCV_LIB_OBJDETECT
|
||||
select BR2_PACKAGE_OPENCV_LIB_VIDEO
|
||||
help
|
||||
Include opencv_contrib module into the OpenCV build.
|
||||
|
||||
config BR2_PACKAGE_OPENCV_LIB_FEATURES2D
|
||||
bool "features2d"
|
||||
default y
|
||||
select BR2_PACKAGE_OPENCV_LIB_FLANN
|
||||
select BR2_PACKAGE_OPENCV_LIB_IMGPROC
|
||||
help
|
||||
Include opencv_features2d module into the OpenCV build.
|
||||
|
||||
config BR2_PACKAGE_OPENCV_LIB_FLANN
|
||||
bool "flann"
|
||||
default y
|
||||
# opencv_core dependency is already enabled
|
||||
help
|
||||
Include opencv_flann module into the OpenCV build.
|
||||
|
||||
config BR2_PACKAGE_OPENCV_LIB_GPU
|
||||
bool "gpu"
|
||||
depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19405 # opencv libphoto
|
||||
select BR2_PACKAGE_OPENCV_LIB_CALIB3D
|
||||
select BR2_PACKAGE_OPENCV_LIB_IMGPROC
|
||||
select BR2_PACKAGE_OPENCV_LIB_LEGACY
|
||||
select BR2_PACKAGE_OPENCV_LIB_OBJDETECT
|
||||
select BR2_PACKAGE_OPENCV_LIB_PHOTO
|
||||
select BR2_PACKAGE_OPENCV_LIB_VIDEO
|
||||
depends on !BR2_STATIC_LIBS
|
||||
help
|
||||
Include opencv_gpu module into the OpenCV build.
|
||||
|
||||
comment "gpu module needs a toolchain w/ dynamic libraries"
|
||||
depends on BR2_STATIC_LIBS
|
||||
|
||||
config BR2_PACKAGE_OPENCV_LIB_HIGHGUI
|
||||
bool "highgui"
|
||||
default y
|
||||
select BR2_PACKAGE_OPENCV_LIB_IMGPROC
|
||||
help
|
||||
Include opencv_highgui module into the OpenCV build.
|
||||
|
||||
config BR2_PACKAGE_OPENCV_LIB_IMGPROC
|
||||
bool "imgproc"
|
||||
default y
|
||||
# opencv_core dependency is already enabled
|
||||
help
|
||||
Include opencv_imgproc module into the OpenCV build.
|
||||
|
||||
config BR2_PACKAGE_OPENCV_LIB_LEGACY
|
||||
bool "legacy"
|
||||
default y
|
||||
select BR2_PACKAGE_OPENCV_LIB_CALIB3D
|
||||
select BR2_PACKAGE_OPENCV_LIB_ML
|
||||
select BR2_PACKAGE_OPENCV_LIB_VIDEO
|
||||
help
|
||||
Include opencv_legacy module into the OpenCV build.
|
||||
|
||||
config BR2_PACKAGE_OPENCV_LIB_ML
|
||||
bool "ml (machine learning)"
|
||||
default y
|
||||
# opencv_core dependency is already enabled
|
||||
help
|
||||
Include opencv_ml module into the OpenCV build.
|
||||
|
||||
config BR2_PACKAGE_OPENCV_LIB_NONFREE
|
||||
bool "nonfree"
|
||||
select BR2_PACKAGE_OPENCV_LIB_CALIB3D
|
||||
select BR2_PACKAGE_OPENCV_LIB_FEATURES2D
|
||||
select BR2_PACKAGE_OPENCV_LIB_IMGPROC
|
||||
help
|
||||
Include opencv_nonfree module into the OpenCV build.
|
||||
|
||||
config BR2_PACKAGE_OPENCV_LIB_OBJDETECT
|
||||
bool "objdetect"
|
||||
default y
|
||||
# opencv_core dependency is already enabled
|
||||
select BR2_PACKAGE_OPENCV_LIB_IMGPROC
|
||||
help
|
||||
Include opencv_objdetect module into the OpenCV build.
|
||||
|
||||
config BR2_PACKAGE_OPENCV_LIB_PHOTO
|
||||
bool "photo"
|
||||
default y
|
||||
depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19405 # Binutils 2.25 nios2 issue
|
||||
select BR2_PACKAGE_OPENCV_LIB_IMGPROC
|
||||
help
|
||||
Include opencv_photo module into the OpenCV build.
|
||||
|
||||
@@ -89,50 +124,77 @@ comment "opencv_python module requires numpy which is not yet available."
|
||||
config BR2_PACKAGE_OPENCV_LIB_STITCHING
|
||||
bool "stitching"
|
||||
default y
|
||||
select BR2_PACKAGE_OPENCV_LIB_CALIB3D
|
||||
select BR2_PACKAGE_OPENCV_LIB_FEATURES2D
|
||||
select BR2_PACKAGE_OPENCV_LIB_IMGPROC
|
||||
select BR2_PACKAGE_OPENCV_LIB_OBJDETECT
|
||||
help
|
||||
Include opencv_stitching module into the OpenCV build.
|
||||
|
||||
config BR2_PACKAGE_OPENCV_LIB_SUPERRES
|
||||
bool "superres"
|
||||
default y
|
||||
select BR2_PACKAGE_OPENCV_LIB_IMGPROC
|
||||
select BR2_PACKAGE_OPENCV_LIB_VIDEO
|
||||
help
|
||||
Include opencv_superres "super resolution" - module into the OpenCV
|
||||
build.
|
||||
|
||||
config BR2_PACKAGE_OPENCV_LIB_TS
|
||||
bool "ts (touchscreen)"
|
||||
select BR2_PACKAGE_OPENCV_LIB_HIGHGUI
|
||||
default y
|
||||
# opencv_core dependency is already enabled
|
||||
select BR2_PACKAGE_OPENCV_LIB_CALIB3D
|
||||
select BR2_PACKAGE_OPENCV_LIB_FEATURES2D
|
||||
select BR2_PACKAGE_OPENCV_LIB_HIGHGUI
|
||||
select BR2_PACKAGE_OPENCV_LIB_IMGPROC
|
||||
select BR2_PACKAGE_OPENCV_LIB_VIDEO
|
||||
help
|
||||
Include opencv_ts module into the OpenCV build.
|
||||
|
||||
config BR2_PACKAGE_OPENCV_LIB_VIDEO
|
||||
bool "video"
|
||||
default y
|
||||
select BR2_PACKAGE_OPENCV_LIB_IMGPROC
|
||||
help
|
||||
Include opencv_video module into the OpenCV build.
|
||||
|
||||
config BR2_PACKAGE_OPENCV_LIB_VIDEOSTAB
|
||||
bool "videostab"
|
||||
default y
|
||||
depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19405 # opencv libphoto
|
||||
select BR2_PACKAGE_OPENCV_LIB_CALIB3D
|
||||
select BR2_PACKAGE_OPENCV_LIB_FEATURES2D
|
||||
select BR2_PACKAGE_OPENCV_LIB_HIGHGUI
|
||||
select BR2_PACKAGE_OPENCV_LIB_IMGPROC
|
||||
select BR2_PACKAGE_OPENCV_LIB_PHOTO
|
||||
select BR2_PACKAGE_OPENCV_LIB_VIDEO
|
||||
help
|
||||
Include opencv_videostab module into the OpenCV build.
|
||||
|
||||
if !BR2_STATIC_LIBS
|
||||
|
||||
comment "Test sets"
|
||||
|
||||
config BR2_PACKAGE_OPENCV_BUILD_TESTS
|
||||
bool "build tests"
|
||||
|
||||
config BR2_PACKAGE_OPENCV_BUILD_PERF_TESTS
|
||||
bool "build performance tests"
|
||||
|
||||
endif
|
||||
|
||||
comment "Tests sets need a toolchain w/ dynamic libraries"
|
||||
depends on BR2_STATIC_LIBS
|
||||
|
||||
comment "3rd party support"
|
||||
|
||||
config BR2_PACKAGE_OPENCV_WITH_FFMPEG
|
||||
bool "ffmpeg support"
|
||||
depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
|
||||
select BR2_PACKAGE_BZIP2
|
||||
select BR2_PACKAGE_FFMPEG
|
||||
select BR2_PACKAGE_FFMPEG_SWSCALE
|
||||
depends on !BR2_nios2 # ffmpeg
|
||||
help
|
||||
Use ffmpeg from the target system.
|
||||
|
||||
@@ -210,6 +272,7 @@ config BR2_PACKAGE_OPENCV_WITH_QT
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
depends on BR2_USE_MMU # qt
|
||||
depends on BR2_PACKAGE_OPENCV_LIB_HIGHGUI
|
||||
depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19405 # Qt GUI module
|
||||
select BR2_PACKAGE_QT
|
||||
select BR2_PACKAGE_QT_STL
|
||||
select BR2_PACKAGE_QT_GUI_MODULE
|
||||
@@ -217,6 +280,9 @@ config BR2_PACKAGE_OPENCV_WITH_QT
|
||||
help
|
||||
Use Qt with QtTest module and STL support
|
||||
|
||||
comment "qt backend support needs a toolchain not affected by Binutils bug 19405"
|
||||
depends on BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19405
|
||||
|
||||
config BR2_PACKAGE_OPENCV_WITH_TIFF
|
||||
bool "tiff support"
|
||||
select BR2_PACKAGE_TIFF
|
||||
|
||||
2
bsp/buildroot/package/opencv/opencv.hash
Normal file
2
bsp/buildroot/package/opencv/opencv.hash
Normal file
@@ -0,0 +1,2 @@
|
||||
# Locally calculated
|
||||
sha256 94ebcca61c30034d5fb16feab8ec12c8a868f5162d20a9f0396f0f5f6d8bbbff opencv-2.4.13.tar.gz
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
OPENCV_VERSION = 2.4.10
|
||||
OPENCV_VERSION = 2.4.13
|
||||
OPENCV_SITE = $(call github,itseez,opencv,$(OPENCV_VERSION))
|
||||
OPENCV_INSTALL_STAGING = YES
|
||||
OPENCV_LICENSE = BSD-3c
|
||||
|
||||
Reference in New Issue
Block a user