[vlc-devel] [PATCH] configure: link with the atomic library when compiling for Raspberry

Steve Lhomme robux4 at ycbcr.xyz
Thu Jan 30 09:07:02 CET 2020


We don't have a way to detect the target is a Raspberry so we enable it manually.

Only the libvlccore seems to need it for proper linkings. Modules don't need it.
---
 configure.ac    | 4 ++++
 src/Makefile.am | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 69b09dfe3ac..45f95f64299 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3655,6 +3655,7 @@ AM_CONDITIONAL([HAVE_KVA], [test "${have_kva}" = "yes"])
 dnl
 dnl MMAL plugin
 dnl
+LIBATOMIC=""
 AC_ARG_ENABLE([mmal],
   AS_HELP_STRING([--enable-mmal],
     [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
@@ -3665,6 +3666,8 @@ if test "${enable_mmal}" != "no"; then
   AC_CHECK_HEADERS([interface/mmal/mmal.h],
     [ AC_CHECK_LIB([bcm_host], [vc_tv_unregister_callback_full], [
         have_mmal="yes"
+        dnl we build for Raspberry which needs the latomic flag
+        LIBATOMIC="-latomic"
         VLC_ADD_PLUGIN([mmal])
         VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
         VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
@@ -3680,6 +3683,7 @@ if test "${enable_mmal}" != "no"; then
   VLC_RESTORE_FLAGS
 fi
 AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
+AC_SUBST([LIBATOMIC])
 
 dnl
 dnl  Audio plugins
diff --git a/src/Makefile.am b/src/Makefile.am
index b6c59968370..4bf36cf3e85 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -393,7 +393,7 @@ libvlccore_la_SOURCES = \
 libvlccore_la_LIBADD = $(LIBS_libvlccore) \
 	../compat/libcompat.la \
 	$(LTLIBINTL) $(LTLIBICONV) \
-	$(IDN_LIBS) $(SOCKET_LIBS) $(LIBRT) $(LIBDL) $(LIBM)
+	$(IDN_LIBS) $(SOCKET_LIBS) $(LIBRT) $(LIBDL) $(LIBM) $(LIBATOMIC)
 
 if HAVE_WIN32
 libvlccore_la_SOURCES += \
-- 
2.17.1



More information about the vlc-devel mailing list