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

Sebastian Ramacher sebastian+lists at ramacher.at
Thu Jan 30 11:12:23 CET 2020


On 2020-01-30 09:07:02, Steve Lhomme wrote:
> 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"

As Remi already mentioned, this is not Rasbperry Pi specific. I'd
suggest to add a check if linking with -latomic is required instead of
hardcoding the architectures where it's needed.

Best

>          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
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

-- 
Sebastian Ramacher


More information about the vlc-devel mailing list