libav: fix static linking

This commit is contained in:
Andoni Morales Alastruey 2012-09-13 11:10:05 +00:00 committed by Sebastian Dröge
parent 1caa7d6161
commit d3b125913f
3 changed files with 26 additions and 8 deletions

View file

@ -292,19 +292,35 @@ else
-I \$(top_builddir)/gst-libs/ext/libav \
-Wno-deprecated-declarations"
dnl libgstlibav.la: libs to statically link to
LIBAV_LIBS="\$(top_builddir)/gst-libs/ext/libav/libavformat/libavformat.a \
\$(top_builddir)/gst-libs/ext/libav/libavcodec/libavcodec.a \
\$(top_builddir)/gst-libs/ext/libav/libavutil/libavutil.a"
LIBAV_DEPS="\$(top_builddir)/gst-libs/ext/libav/libavformat/libavformat.a \
\$(top_builddir)/gst-libs/ext/libav/libavcodec/libavcodec.a \
\$(top_builddir)/gst-libs/ext/libav/libavutil/libavutil.a"
if test "x$enable_static_plugins" = xyes; then
dnl with static linking we can't use the .a archive directly as they would
dnl be included in the final libgstlibav.a as a file and won't be usable.
dnl libav*.a must be copied to the final destination too
LIBAV_LIBS="-lavformat -lavcodec -lavutil"
else
dnl libgstlibav.la: libs to statically link to
LIBAV_LIBS="$LIBAV_DEPS"
fi
dnl
SWSCALE_CFLAGS="-I \$(top_srcdir)/gst-libs/ext/libav \
-I \$(top_builddir)/gst-libs/ext/libav \
-Wno-deprecated-declarations"
dnl libgstswscale.la: libs to statically link to
SWSCALE_LIBS="\$(top_builddir)/gst-libs/ext/libav/libswscale/libswscale.a \
SWSCALE_DEPS="\$(top_builddir)/gst-libs/ext/libav/libswscale/libswscale.a \
\$(top_builddir)/gst-libs/ext/libav/libavutil/libavutil.a"
if test "x$enable_static_plugins" = xyes; then
dnl with static linking we can't use the .a archive directly as they would
dnl be included in the final libgstswscale.a as a file and won't be usable.
dnl libav*.a must be copied to the final destination too
LIBAV_LIBS="-lswscale -lavutil"
else
dnl libgstswscale.la: libs to statically link to
SWSCALE_LIBS="$SWSCALE_DEPS"
fi
LIBAV_SUBDIRS=gst-libs
AC_DEFINE(HAVE_AVI_H)
@ -425,9 +441,11 @@ else
fi
AC_SUBST(LIBAV_CFLAGS)
AC_SUBST(LIBAV_DEPS)
AC_SUBST(LIBAV_LIBS)
AC_SUBST(LIBAV_SUBDIRS)
AC_SUBST(SWSCALE_CFLAGS)
AC_SUBST(SWSCALE_DEPS)
AC_SUBST(SWSCALE_LIBS)
AC_SUBST(WIN32_LIBS)

View file

@ -32,7 +32,7 @@ libgstlibav_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DARWIN_LDFLAGS)
libgstlibav_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
if HAVE_LIBAV_UNINSTALLED
libgstlibav_la_DEPENDENCIES = $(LIBAV_LIBS)
libgstlibav_la_DEPENDENCIES = $(LIBAV_DEPS)
endif

View file

@ -11,5 +11,5 @@ libgstavscale_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DARWIN_LDFLAGS)
libgstavscale_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
if HAVE_LIBAV_UNINSTALLED
libgstavscale_la_DEPENDENCIES = $(SWSCALE_LIBS)
libgstavscale_la_DEPENDENCIES = $(SWSCALE_DEPS)
endif