comment "gqrx needs a toolchain w/ C++, threads, wchar, dynamic library"
depends on BR2_USE_MMU # gnuradio
depends on !BR2_PACKAGE_PYTHON3 # gnuradio
+ depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_TOOLCHAIN_HAS_ATOMIC
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \
!BR2_USE_WCHAR || !BR2_STATIC_LIBS
depends on BR2_INSTALL_LIBSTDCPP # boost
depends on BR2_TOOLCHAIN_HAS_THREADS # boost
depends on BR2_USE_WCHAR # boost
+ depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_TOOLCHAIN_HAS_ATOMIC
depends on BR2_PACKAGE_QT5
depends on !BR2_PACKAGE_PYTHON3
select BR2_PACKAGE_BOOST
GQRX_CONF_OPTS = -DLINUX_AUDIO_BACKEND=Gr-audio
+# gqrx can use __atomic builtins, so we need to link with
+# libatomic when available
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+GQRX_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
+endif
+
$(eval $(cmake-package))