From f6c31d1cb69a3ce907bc0513cfcb5025f5b97345 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 29 Aug 2016 11:08:16 -0300 Subject: [PATCH] build: Do not link plugin against lzma and bz2 if using system install And bump version to 1.9.2 --- config.h.meson | 3 --- configure.ac | 51 +++++++++++++++++++++++++++------------------------ ext/libav/meson.build | 2 +- meson.build | 18 ++---------------- 4 files changed, 30 insertions(+), 44 deletions(-) diff --git a/config.h.meson b/config.h.meson index 5d0b638..196dcce 100644 --- a/config.h.meson +++ b/config.h.meson @@ -1,6 +1,3 @@ -#mesondefine HAVE_LZMA -#mesondefine HAVE_BZ2 #mesondefine LIBAV_SOURCE #mesondefine PACKAGE_VERSION #mesondefine PACKAGE - diff --git a/configure.ac b/configure.ac index edd4eee..6ba4cf4 100644 --- a/configure.ac +++ b/configure.ac @@ -244,30 +244,6 @@ case $host_os in esac AC_SUBST(DARWIN_LDFLAGS) -dnl *** Check for bz2 -save_LIBS=$LIBS -LIBS="$LIBS -lbz2" -AC_MSG_CHECKING([for BZ2_bzlibVersion in -lbz2]) -AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[const char *version = BZ2_bzlibVersion ();]])],[HAVE_BZ2=yes],[HAVE_BZ2=no]) -AC_MSG_RESULT($HAVE_BZ2) -LIBS=$save_LIBS -AM_CONDITIONAL(HAVE_BZ2, test "x$HAVE_BZ2" = "xyes") -if test "x$HAVE_BZ2" = "xno"; then - AC_WARN([libbz2 not found, matroska demuxer will not be able to read bz2 tracks]) -fi - -dnl *** Check for lzma -save_LIBS=$LIBS -LIBS="$LIBS -llzma" -AC_MSG_CHECKING([for lzma_version_string in -llzma]) -AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[const char *version = lzma_version_string ();]])],[HAVE_LZMA=yes],[HAVE_LZMA=no]) -AC_MSG_RESULT($HAVE_LZMA) -LIBS=$save_LIBS -AM_CONDITIONAL(HAVE_LZMA, test "x$HAVE_LZMA" = "xyes") -if test "x$HAVE_LZMA" = "xno"; then - AC_WARN([lzma not found, tiff reader will not be able to read lzma files]) -fi - AC_ARG_ENABLE(gpl, [AC_HELP_STRING([--enable-gpl], [build a GPL licensed gst-libav])]) AM_CONDITIONAL(GST_LIBAV_ENABLE_GPL, test "x$enable_gpl" = "xyes") @@ -282,6 +258,8 @@ HAVE_LIBAV_UNINSTALLED=1 AC_ARG_WITH(system-libav, [AC_HELP_STRING([--with-system-libav], [use system Libav libraries])]) +HAVE_LZMA = "no" +HAVE_BZ2 = "no" if test "x$with_system_libav" = "xyes"; then PKG_CHECK_MODULES(LIBAV, libavfilter libavformat libavcodec libavutil) PKG_CHECK_MODULES(SWSCALE, libswscale libavutil) @@ -309,6 +287,28 @@ if test "x$with_system_libav" = "xyes"; then else AC_MSG_NOTICE([Using local Libav snapshot]) + dnl *** Check for bz2 + save_LIBS=$LIBS + LIBS="$LIBS -lbz2" + AC_MSG_CHECKING([for BZ2_bzlibVersion in -lbz2]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[const char *version = BZ2_bzlibVersion ();]])],[HAVE_BZ2=yes],[HAVE_BZ2=no]) + AC_MSG_RESULT($HAVE_BZ2) + LIBS=$save_LIBS + if test "x$HAVE_BZ2" = "xno"; then + AC_WARN([libbz2 not found, matroska demuxer will not be able to read bz2 tracks]) + fi + + dnl *** Check for lzma + save_LIBS=$LIBS + LIBS="$LIBS -llzma" + AC_MSG_CHECKING([for lzma_version_string in -llzma]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[const char *version = lzma_version_string ();]])],[HAVE_LZMA=yes],[HAVE_LZMA=no]) + AC_MSG_RESULT($HAVE_LZMA) + LIBS=$save_LIBS + if test "x$HAVE_LZMA" = "xno"; then + AC_WARN([lzma not found, tiff reader will not be able to read lzma files]) + fi + dnl libgstlibav.la: include dirs LIBAV_CFLAGS="-I \$(top_srcdir)/gst-libs/ext/libav \ -I \$(top_builddir)/gst-libs/ext/libav \ @@ -466,6 +466,9 @@ else AC_MSG_NOTICE([Using included Libav code]) fi +AM_CONDITIONAL(HAVE_BZ2, test "x$HAVE_BZ2" = "xyes") +AM_CONDITIONAL(HAVE_LZMA, test "x$HAVE_LZMA" = "xyes") + AC_SUBST(LIBAV_CFLAGS) AC_SUBST(LIBAV_DEPS) AC_SUBST(LIBAV_LIBS) diff --git a/ext/libav/meson.build b/ext/libav/meson.build index 7855d73..b84c67b 100644 --- a/ext/libav/meson.build +++ b/ext/libav/meson.build @@ -18,7 +18,7 @@ gstlibav = library('gstlibav', c_args : gst_libav_args, include_directories : [configinc], dependencies : libav_deps + [gst_dep, gstbase_dep, gstvideo_dep, - gstaudio_dep, gstpbutils_dep, libm, bz2lib], + gstaudio_dep, gstpbutils_dep], install : true, install_dir : plugins_install_dir, ) diff --git a/meson.build b/meson.build index 08d865a..2d335b6 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('gst-libav', 'c', 'cpp', - version : '1.9.1.1', + version : '1.9.2.1', meson_version : '>= 0.33.0', default_options : [ 'warning_level=1', 'c_std=gnu99', @@ -26,7 +26,7 @@ check_ffmpeg_src = '''#include #error libav provider should be FFmpeg #endif''' -if not cc.compiles(check_ffmpeg_src, name : 'whether libav is provided by FFmpeg') +if not cc.compiles(check_ffmpeg_src, name : 'libav is provided by FFmpeg') error('Uncompatible libavcodec found') endif @@ -49,20 +49,6 @@ gstpbutils_dep = dependency('gstreamer-pbutils-1.0', version : gst_req, fallback : ['gst-plugins-base', 'pbutils_dep']) libm = cc.find_library('m', required : false) -bz2lib = cc.find_library('bz2', required : false) -if bz2lib.found() - cdata.set('HAVE_BZ2', 1) -else - message('WARN: libbz2 not found, matroska demuxer will not be able to read bz2 tracks') -endif - -lzmalib = cc.find_library('lzma', required : false) -if lzmalib.found() - cdata.set('HAVE_LZMA', 1) -else - message('WARN: lzma not found, tiff reader will not be able to read lzma files') -endif - configure_file(input : 'config.h.meson', output : 'config.h', configuration : cdata) -- 2.7.4