mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-08 16:35:40 +00:00
libav: Allow build both static dynamic plugins
When building plugins with internal FFMPEG, we use different link flags depending if it is static or shared. As we want to build both static and dynamic plugins at once, rewrite the rules so we can pass the right flags. https://bugzilla.gnome.org/show_bug.cgi?id=779344
This commit is contained in:
parent
57c7a1fae2
commit
dcc36f6e0a
1 changed files with 28 additions and 2 deletions
|
@ -30,15 +30,41 @@ libgstlibav_la_SOURCES = gstav.c \
|
|||
# gstavscale.c
|
||||
|
||||
libgstlibav_la_CFLAGS = $(LIBAV_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
|
||||
libgstlibav_la_LIBADD = $(LIBAV_LIBS) $(GST_PLUGINS_BASE_LIBS) \
|
||||
|
||||
if HAVE_LIBAV_UNINSTALLED
|
||||
libgstlibav_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
libgstlibav_la_LIBADD =
|
||||
if !GST_PLUGIN_BUILD_STATIC
|
||||
libgstlibav_la_LIBADD += $(LIBAV_LIBS)
|
||||
endif
|
||||
else
|
||||
libgstlibav_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
|
||||
libgstlibav_la_LIBADD = $(LIBAV_LIBS)
|
||||
endif
|
||||
|
||||
libgstlibav_la_LIBADD += $(GST_PLUGINS_BASE_LIBS) \
|
||||
-lgstaudio-$(GST_API_VERSION) -lgstvideo-$(GST_API_VERSION) \
|
||||
-lgstpbutils-$(GST_API_VERSION) $(GST_BASE_LIBS) \
|
||||
$(LIBM) $(WIN32_LIBS) -lz $(BZ2_LIBS) $(LZMA_LIBS)
|
||||
libgstlibav_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DARWIN_LDFLAGS)
|
||||
libgstlibav_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
|
||||
|
||||
if HAVE_LIBAV_UNINSTALLED
|
||||
libgstlibav_la_DEPENDENCIES = $(LIBAV_DEPS)
|
||||
|
||||
if GST_PLUGIN_BUILD_STATIC
|
||||
libgstlibav_la_LINK_static = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
||||
--tag=disable-shared $(LIBTOOLFLAGS) --mode=link \
|
||||
$(CCLD) $(libgstlibav_la_CFLAGS) $(CFLAGS) \
|
||||
$(libgstlibav_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
libgstlibav.la: $(libgstlibav_la_OBJECTS) $(libgstlibav_la_DEPENDENCIES) $(EXTRA_libgstlibav_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(libgstlibav_la_LINK) -rpath $(plugindir) $(libgstlibav_la_OBJECTS) $(LIBAV_DEPS) $(libgstlibav_la_LIBADD) $(LIBS)
|
||||
$(AM_V_at)rm $@
|
||||
$(AM_V_CCLD)$(libgstlibav_la_LINK_static) -rpath $(plugindir) $(libgstlibav_la_OBJECTS) $(libgstlibav_la_LIBADD) $(LIBS)
|
||||
$(AM_V_at)mv $@ $@.tmp
|
||||
$(AM_V_GEN) sed -e "s|^\(dependency_libs='\)|\1 $(LIBAV_LIBS)|" $@.tmp > $@ && rm $@.tmp
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue