package/opencv3: use BR2_TOOLCHAIN_HAS_LIBATOMIC
authorBernd Kuhls <bernd.kuhls@t-online.de>
Mon, 5 Sep 2016 21:00:56 +0000 (23:00 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 6 Sep 2016 19:36:07 +0000 (21:36 +0200)
It uses __atomic_fetch_add_4 so libatomic must be pulled in if
necessary. Fixes
http://autobuild.buildroot.net/results/652/6521223b426c3cb4dfefab27bc6021900db6910e/

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/opencv3/Config.in
package/opencv3/opencv3.mk

index 2f4aa7aca86fd9dc014194af75f0a8583e8619e2..4c00bf1b949ef7d67672c1d266c3008e072b55e4 100644 (file)
@@ -1,6 +1,7 @@
 menuconfig BR2_PACKAGE_OPENCV3
        bool "opencv3"
        select BR2_PACKAGE_ZLIB
+       depends on BR2_TOOLCHAIN_HAS_ATOMIC
        depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
        depends on BR2_INSTALL_LIBSTDCPP
        depends on BR2_USE_WCHAR
@@ -335,6 +336,7 @@ config BR2_PACKAGE_OPENCV3_INSTALL_DATA
 endif # BR2_PACKAGE_OPENCV3
 
 comment "opencv3 needs a toolchain w/ C++, NPTL, wchar, dynamic library"
+       depends on BR2_TOOLCHAIN_HAS_ATOMIC
        depends on !BR2_INSTALL_LIBSTDCPP || \
                !BR2_USE_WCHAR || \
                !BR2_TOOLCHAIN_HAS_THREADS_NPTL || \
index 91cdfe6428b935f59e841232a111510c4771c3fa..2529de9f4ba2d1a941de6abc9a49a573ed99f7db 100644 (file)
@@ -10,6 +10,11 @@ OPENCV3_INSTALL_STAGING = YES
 OPENCV3_LICENSE = BSD-3c
 OPENCV3_LICENSE_FILES = LICENSE
 
+# Uses __atomic_fetch_add_4
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+OPENCV3_CONF_OPTS += -DCMAKE_CXX_FLAGS="-latomic"
+endif
+
 # OpenCV component options
 OPENCV3_CONF_OPTS += \
        -DBUILD_DOCS=OFF \