mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-09 08:55:33 +00:00
Generate .la for internal libav libraries
This should help libtool in getting the internal linking right. Effectively, libtool can sometime get the link order wrong when presented with a mix of .la and -l arguments. These .la file are also required by the android build system and were previously created by cerbero.
This commit is contained in:
parent
de60c46e30
commit
1038ae2327
3 changed files with 108 additions and 32 deletions
14
configure.ac
14
configure.ac
|
@ -314,17 +314,17 @@ else
|
||||||
-I \$(top_builddir)/gst-libs/ext/libav \
|
-I \$(top_builddir)/gst-libs/ext/libav \
|
||||||
-Wno-deprecated-declarations"
|
-Wno-deprecated-declarations"
|
||||||
|
|
||||||
LIBAV_DEPS="\$(top_builddir)/gst-libs/ext/libav/libavformat/libavformat.a \
|
LIBAV_DEPS="\$(top_builddir)/gst-libs/ext/libav/libavfilter/libavfilter.a \
|
||||||
|
\$(top_builddir)/gst-libs/ext/libav/libavformat/libavformat.a \
|
||||||
\$(top_builddir)/gst-libs/ext/libav/libavcodec/libavcodec.a \
|
\$(top_builddir)/gst-libs/ext/libav/libavcodec/libavcodec.a \
|
||||||
\$(top_builddir)/gst-libs/ext/libav/libavfilter/libavfilter.a \
|
|
||||||
\$(top_builddir)/gst-libs/ext/libav/libswresample/libswresample.a \
|
\$(top_builddir)/gst-libs/ext/libav/libswresample/libswresample.a \
|
||||||
\$(top_builddir)/gst-libs/ext/libav/libavutil/libavutil.a"
|
\$(top_builddir)/gst-libs/ext/libav/libavutil/libavutil.a"
|
||||||
|
|
||||||
LIBAV_LIBS="-L\$(top_builddir)/gst-libs/ext/libav/libavformat -lavformat \
|
LIBAV_LIBS="$ac_pwd/gst-libs/ext/libavfilter.la \
|
||||||
-L\$(top_builddir)/gst-libs/ext/libav/libavcodec -lavcodec \
|
$ac_pwd/gst-libs/ext/libavformat.la \
|
||||||
-L\$(top_builddir)/gst-libs/ext/libav/libswresample -lswresample \
|
$ac_pwd/gst-libs/ext/libavcodec.la \
|
||||||
-L\$(top_builddir)/gst-libs/ext/libav/libavutil -lavutil \
|
$ac_pwd/gst-libs/ext/libswresample.la \
|
||||||
-L\$(top_builddir)/gst-libs/ext/libav/libavfilter -lavfilter"
|
$ac_pwd/gst-libs/ext/libavutil.la"
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
SWSCALE_CFLAGS="-I \$(top_srcdir)/gst-libs/ext/libav \
|
SWSCALE_CFLAGS="-I \$(top_srcdir)/gst-libs/ext/libav \
|
||||||
|
|
|
@ -1,17 +1,5 @@
|
||||||
plugin_LTLIBRARIES = libgstlibav.la
|
plugin_LTLIBRARIES = libgstlibav.la
|
||||||
|
|
||||||
if HAVE_BZ2
|
|
||||||
BZ2_LIBS = -lbz2
|
|
||||||
else
|
|
||||||
BZ2_LIBS =
|
|
||||||
endif
|
|
||||||
|
|
||||||
if HAVE_LZMA
|
|
||||||
LZMA_LIBS = -llzma
|
|
||||||
else
|
|
||||||
LZMA_LIBS =
|
|
||||||
endif
|
|
||||||
|
|
||||||
libgstlibav_la_SOURCES = gstav.c \
|
libgstlibav_la_SOURCES = gstav.c \
|
||||||
gstavprotocol.c \
|
gstavprotocol.c \
|
||||||
gstavcodecmap.c \
|
gstavcodecmap.c \
|
||||||
|
@ -34,23 +22,17 @@ libgstlibav_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
|
||||||
libgstlibav_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \
|
libgstlibav_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \
|
||||||
-lgstaudio-$(GST_API_VERSION) -lgstvideo-$(GST_API_VERSION) \
|
-lgstaudio-$(GST_API_VERSION) -lgstvideo-$(GST_API_VERSION) \
|
||||||
-lgstpbutils-$(GST_API_VERSION) $(GST_BASE_LIBS) \
|
-lgstpbutils-$(GST_API_VERSION) $(GST_BASE_LIBS) \
|
||||||
$(LIBAV_LIBS) $(LIBM) $(WIN32_LIBS) -lz $(BZ2_LIBS) $(LZMA_LIBS)
|
$(LIBAV_LIBS) $(WIN32_LIBS)
|
||||||
libgstlibav_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DARWIN_LDFLAGS)
|
libgstlibav_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DARWIN_LDFLAGS)
|
||||||
|
|
||||||
if HAVE_LIBAV_UNINSTALLED
|
if HAVE_LIBAV_UNINSTALLED
|
||||||
libgstlibav_la_DEPENDENCIES = $(LIBAV_DEPS)
|
libgstlibav_la_DEPENDENCIES = $(LIBAV_DEPS)
|
||||||
|
|
||||||
if GST_PLUGIN_BUILD_STATIC
|
# FIXME: For some reason libtool ignores libavfilter.la, add it
|
||||||
depsdir = $(libdir)
|
install-data-hook:
|
||||||
deps_DATA = $(LIBAV_DEPS)
|
$(AM_V_at)cd $(DESTDIR)$(plugindir) \
|
||||||
|
&& sed -e "s|\($(libdir)/libavformat.la\)|$(libdir)/libavfilter.la \1|" \
|
||||||
libgstlibav_la = $(DESTDIR)$(plugindir)/libgstlibav.la
|
libgstlibav.la > libgstlibav.la.tmp && cp libgstlibav.la.tmp libgstlibav.la && rm libgstlibav.la.tmp
|
||||||
|
|
||||||
install-data-hook:
|
|
||||||
$(AM_V_at)cp $(libgstlibav_la) $(libgstlibav_la).tmp
|
|
||||||
$(AM_V_GEN)sed -e "s|-L$(top_builddir)/gst-libs/ext/libav/lib[a-z]* ||g" \
|
|
||||||
$(libgstlibav_la).tmp > $(libgstlibav_la) && rm $(libgstlibav_la).tmp
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,106 @@ TMP_DIST_DIR=libav-dist
|
||||||
DIST_DIR=$(TMP_DIST_DIR)/.libav
|
DIST_DIR=$(TMP_DIST_DIR)/.libav
|
||||||
EXTRA_DIST=Makefile.am
|
EXTRA_DIST=Makefile.am
|
||||||
MAINTAINERCLEANDIRS = $(DIST_SUBDIRS)
|
MAINTAINERCLEANDIRS = $(DIST_SUBDIRS)
|
||||||
|
LIB_LIST=libavutil libswresample libavcodec libavformat libavfilter
|
||||||
|
|
||||||
all-local:
|
if HAVE_BZ2
|
||||||
|
BZ2_LIBS = -lbz2
|
||||||
|
else
|
||||||
|
BZ2_LIBS =
|
||||||
|
endif
|
||||||
|
|
||||||
|
if HAVE_LZMA
|
||||||
|
LZMA_LIBS = -llzma
|
||||||
|
else
|
||||||
|
LZMA_LIBS =
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
define create_la
|
||||||
|
echo " GEN $1.la" && \
|
||||||
|
(echo "# $1.la - a libtool library file" && \
|
||||||
|
echo "# Generated by libtool (GNU libtool) 2.4.6" && \
|
||||||
|
echo "dlname=''" && \
|
||||||
|
echo "library_names=''" && \
|
||||||
|
echo "old_library='$1.a'" && \
|
||||||
|
echo "inherited_linker_flags=''" && \
|
||||||
|
echo "dependency_libs=' -L$(libdir) $(if $2,$(foreach dep,$2,$(abs_builddir)/$(dep).la)) $3 $(LIBM) '" && \
|
||||||
|
echo "weak_library_names=''" && \
|
||||||
|
echo "current=" && \
|
||||||
|
echo "age=" && \
|
||||||
|
echo "revision=" && \
|
||||||
|
echo "installed=no" && \
|
||||||
|
echo "shouldnotlink=no" && \
|
||||||
|
echo "dlopen=''" && \
|
||||||
|
echo "dlpreopen=''" && \
|
||||||
|
echo "libdir='$(libdir)'") > $1.la
|
||||||
|
endef
|
||||||
|
|
||||||
|
libavutil.la:
|
||||||
|
$(AM_V_at)$(call create_la,libavutil)
|
||||||
|
|
||||||
|
libswresample.la:
|
||||||
|
$(AM_V_at)$(call create_la,libswresample,libavutil)
|
||||||
|
|
||||||
|
libavcodec.la:
|
||||||
|
$(AM_V_at)$(call create_la,libavcodec,libswresample libavutil,-lz $(LZMA_LIBS))
|
||||||
|
|
||||||
|
libavformat.la:
|
||||||
|
$(AM_V_at)$(call create_la,libavformat,libavcodec libavutil,$(LIBM) -lz $(BZ2_LIBS))
|
||||||
|
|
||||||
|
libavfilter.la:
|
||||||
|
$(AM_V_at)$(call create_la,libavfilter,libavformat libavcodec libswresample libavutil)
|
||||||
|
|
||||||
|
all-local: $(foreach lib,$(LIB_LIST),$(lib).la)
|
||||||
cd libav && $(MAKE)
|
cd libav && $(MAKE)
|
||||||
|
$(AM_V_at)$(MKDIR_P) .libs
|
||||||
|
$(AM_V_at)for lib in $(LIB_LIST); do \
|
||||||
|
if ! test -f .libs/$${lib}.a; then \
|
||||||
|
echo " CP $${lib}"; \
|
||||||
|
cp libav/$${lib}/$${lib}.a .libs/$${lib}.a; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
|
||||||
|
if GST_PLUGIN_BUILD_STATIC
|
||||||
|
|
||||||
|
define install_la
|
||||||
|
echo " INSTALL $1.la" && \
|
||||||
|
sed -e "s|$(abs_builddir)|$(libdir)|g" \
|
||||||
|
-e "s|installed=no|installed=no|" \
|
||||||
|
$1.la > $(DESTDIR)$(libdir)/$1.la
|
||||||
|
endef
|
||||||
|
|
||||||
|
# Normally DATA is built before am-local, fix it
|
||||||
|
.libs/libavutil.a: all-local
|
||||||
|
|
||||||
|
.libs/libswresample.a: all-local
|
||||||
|
|
||||||
|
.libs/libavcodec.a: all-local
|
||||||
|
|
||||||
|
.libs/libavformat.a: all-local
|
||||||
|
|
||||||
|
.libs/libavfilter.a: all-local
|
||||||
|
|
||||||
|
depsdir = $(libdir)
|
||||||
|
nodist_deps_DATA = \
|
||||||
|
.libs/libavutil.a \
|
||||||
|
.libs/libswresample.a \
|
||||||
|
.libs/libavcodec.a \
|
||||||
|
.libs/libavformat.a \
|
||||||
|
.libs/libavfilter.a
|
||||||
|
|
||||||
|
install-data-hook:
|
||||||
|
$(AM_V_at)$(call install_la,libavutil)
|
||||||
|
$(AM_V_at)$(call install_la,libswresample)
|
||||||
|
$(AM_V_at)$(call install_la,libavcodec)
|
||||||
|
$(AM_V_at)$(call install_la,libavformat)
|
||||||
|
$(AM_V_at)$(call install_la,libavfilter)
|
||||||
|
endif
|
||||||
|
|
||||||
clean-local:
|
clean-local:
|
||||||
cd libav && $(MAKE) clean
|
cd libav && $(MAKE) clean
|
||||||
|
rm -rf .libs
|
||||||
|
rm -r *.la
|
||||||
|
|
||||||
dist-clean:
|
dist-clean:
|
||||||
cd libav && $(MAKE) distclean
|
cd libav && $(MAKE) distclean
|
||||||
|
|
Loading…
Reference in a new issue