summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2017-05-10 09:47:12 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2017-05-10 10:03:45 -0400
commita7d6eb2afaedad1d105b21ef30d1216fb35ae675 (patch)
tree8f1ea9a2338f96995f6a74ffeefa8c3b13ee3b0b
parentdcc36f6e0ab3a4aa5837b6ad3d7c3cd212b74854 (diff)
downloadgst-libav-a7d6eb2afaedad1d105b21ef30d1216fb35ae675.tar.gz
Simplify and fix the static linking
Some libtool will endup removing the shared build when running a static build. That had unwanted side effect. Rather then fighting libtool to get to build each static and shared seperatly, let libtool build with the LIBAV_DEPS added to LIBADD (list of libav*.a) and finally remove the extra .a from the archive and fix the .la to what cerbero will expect.
-rw-r--r--ext/libav/Makefile.am29
1 files changed, 10 insertions, 19 deletions
diff --git a/ext/libav/Makefile.am b/ext/libav/Makefile.am
index 2eeed00..36d3aea 100644
--- a/ext/libav/Makefile.am
+++ b/ext/libav/Makefile.am
@@ -30,16 +30,14 @@ libgstlibav_la_SOURCES = gstav.c \
# gstavscale.c
libgstlibav_la_CFLAGS = $(LIBAV_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
+libgstlibav_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
+libgstlibav_la_LIBADD =
if HAVE_LIBAV_UNINSTALLED
- libgstlibav_la_LIBTOOLFLAGS = --tag=disable-static
- libgstlibav_la_LIBADD =
-if !GST_PLUGIN_BUILD_STATIC
- libgstlibav_la_LIBADD += $(LIBAV_LIBS)
-endif
+libgstlibav_la_LIBADD += $(LIBAV_DEPS)
+libgstlibav_la_DEPENDENCIES = $(LIBAV_DEPS)
else
- libgstlibav_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
- libgstlibav_la_LIBADD = $(LIBAV_LIBS)
+libgstlibav_la_LIBADD += $(LIBAV_LIBS)
endif
libgstlibav_la_LIBADD += $(GST_PLUGINS_BASE_LIBS) \
@@ -49,22 +47,15 @@ libgstlibav_la_LIBADD += $(GST_PLUGINS_BASE_LIBS) \
libgstlibav_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DARWIN_LDFLAGS)
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_CCLD)$(libgstlibav_la_LINK) -rpath $(plugindir) $(libgstlibav_la_OBJECTS) $(libgstlibav_la_LIBADD) $(LIBS)
+ $(AM_V_at)cp $@ $@.tmp
$(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
+ $(AM_V_at)$(AR) -d .libs/libgstlibav.a $(foreach dep,$(LIBAV_DEPS), $(notdir $(dep)))
+ $(AM_V_at)$(RANLIB) .libs/libgstlibav.a
+ $(AM_V_GEN)sed -e "s|^\(dependency_libs='\)|\1 $(LIBAV_LIBS)|" $@.tmp > $@ && rm $@.tmp
endif
-
endif