2004-03-11 18:21:34 +00:00
|
|
|
# we have to put in a little hack here for integration to work well
|
2011-04-19 17:25:54 +00:00
|
|
|
# libav can't be in SUBDIRS, because then automake will try to descend in it
|
2004-03-11 18:21:34 +00:00
|
|
|
# and find conditionals it doesn't know.
|
|
|
|
|
|
|
|
# so,
|
|
|
|
# - don't put it in SUBDIRS so automake doesn't descend
|
|
|
|
# - put it in DIST_SUBDIRS so make dist picks up the subtree
|
|
|
|
# - add an all-local hook so it does get built
|
|
|
|
# this also satisfies make distcheck
|
|
|
|
|
2007-12-17 12:43:06 +00:00
|
|
|
SUBDIRS =
|
2011-04-19 17:25:54 +00:00
|
|
|
DIST_SUBDIRS = libav
|
|
|
|
TMP_DIST_DIR=libav-dist
|
|
|
|
DIST_DIR=$(TMP_DIST_DIR)/.libav
|
2008-05-12 13:02:41 +00:00
|
|
|
EXTRA_DIST=Makefile.am
|
2009-08-19 13:28:35 +00:00
|
|
|
MAINTAINERCLEANDIRS = $(DIST_SUBDIRS)
|
2017-05-12 01:17:21 +00:00
|
|
|
LIB_LIST=libavutil libswresample libavcodec libavformat libavfilter
|
2004-03-11 18:18:36 +00:00
|
|
|
|
2018-03-06 03:40:20 +00:00
|
|
|
# attempt to generate .la references from -l and a list of -L
|
|
|
|
# $1 is the argument to filter, -l, -L, -I, etc
|
|
|
|
# $2 is the list to filter
|
|
|
|
define filter_arg
|
|
|
|
$(foreach item,$(filter $(1)%,$(2)),$(patsubst $(1)%,%,$(item)))
|
|
|
|
endef
|
|
|
|
|
|
|
|
# $1 library to find
|
|
|
|
# $2 directories to search
|
|
|
|
define find_la
|
|
|
|
$(firstword $(wildcard $(foreach path,$(call filter_arg,-L,$(2)), $(path)/lib$(strip $(call filter_arg,-l,$(1))).la)))
|
|
|
|
endef
|
|
|
|
|
|
|
|
# $(call find_la,...) and if a library is found use that, otherwise, return the
|
|
|
|
# original lib unchanged
|
|
|
|
define find_la_or_original
|
|
|
|
$(if $(strip $(call find_la,$1,$2)),$(call find_la,$1,$2),$(1))
|
|
|
|
endef
|
|
|
|
|
|
|
|
# $1 the libraries to look for (including -l) e.g. -lbz2 -lz
|
|
|
|
# $2 LDFLAGS containing -L arguments
|
|
|
|
define find_library_la
|
|
|
|
$(foreach lib,$(1),$(call find_la_or_original,$(lib),$(2)))
|
|
|
|
endef
|
|
|
|
|
2017-05-12 01:17:21 +00:00
|
|
|
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=''" && \
|
2018-03-06 03:40:20 +00:00
|
|
|
echo "dependency_libs=' -L$(libdir) $(if $2,$(foreach dep,$2,$(abs_builddir)/$(dep).la)) $(call find_library_la,$3 $(LIBM),$(LDFLAGS)) '" && \
|
2017-05-12 01:17:21 +00:00
|
|
|
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)
|
2011-04-19 17:25:54 +00:00
|
|
|
cd libav && $(MAKE)
|
2017-05-12 01:17:21 +00:00
|
|
|
$(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
|
2007-12-17 12:43:06 +00:00
|
|
|
|
|
|
|
clean-local:
|
2011-04-19 17:25:54 +00:00
|
|
|
cd libav && $(MAKE) clean
|
2017-05-12 01:17:21 +00:00
|
|
|
rm -rf .libs
|
2017-05-20 11:05:23 +00:00
|
|
|
rm -f *.la
|
2007-12-17 12:43:06 +00:00
|
|
|
|
|
|
|
dist-clean:
|
2011-04-19 17:25:54 +00:00
|
|
|
cd libav && $(MAKE) distclean
|
2013-02-15 13:00:02 +00:00
|
|
|
rm -rf libav/$(TMP_DIST_DIR)
|
2008-05-12 13:02:41 +00:00
|
|
|
rm -f Makefile
|
2011-04-19 17:25:54 +00:00
|
|
|
rm -f libav/.version
|
|
|
|
rm -f libav/.config
|
2007-12-17 12:43:06 +00:00
|
|
|
|
2008-05-08 16:04:32 +00:00
|
|
|
distclean: dist-clean
|
|
|
|
|
2009-08-19 13:28:35 +00:00
|
|
|
maintainer-clean: distclean
|
|
|
|
rm -rf $(MAINTAINERCLEANDIRS)
|
|
|
|
|
|
|
|
maintainerclean: maintainer-clean
|
|
|
|
|
2008-05-12 13:02:41 +00:00
|
|
|
dist-local:
|
2014-02-16 14:58:15 +00:00
|
|
|
GIT_DIR=$(srcdir)/libav/.git git checkout-index --prefix=$(abs_builddir)/libav/$(TMP_DIST_DIR)/libav/ -a
|
2013-02-15 13:00:02 +00:00
|
|
|
touch libav/$(TMP_DIST_DIR)/libav/config.mak
|
2011-04-19 17:25:54 +00:00
|
|
|
echo "Patching libav ./configure"
|
2013-02-15 13:00:02 +00:00
|
|
|
sed -e '/Unknown option/ {N;N;s/exit 1//; }' libav/$(TMP_DIST_DIR)/libav/configure > libav/$(TMP_DIST_DIR)/libav/configure.tmp
|
|
|
|
mv libav/$(TMP_DIST_DIR)/libav/configure.tmp libav/$(TMP_DIST_DIR)/libav/configure
|
|
|
|
chmod +x libav/$(TMP_DIST_DIR)/libav/configure
|
2007-12-17 12:43:06 +00:00
|
|
|
|
|
|
|
distdir: dist-local
|
2013-02-15 13:00:02 +00:00
|
|
|
cp -r libav/$(TMP_DIST_DIR)/libav ${distdir}
|
2009-02-10 11:34:36 +00:00
|
|
|
cp -f $(top_srcdir)/gst-libs/ext/Makefile.am $(top_srcdir)/gst-libs/ext/Makefile.in ${distdir}
|
2013-02-15 13:00:02 +00:00
|
|
|
rm -rf libav/$(TMP_DIST_DIR)
|
2008-05-08 09:18:45 +00:00
|
|
|
|
2007-12-17 12:43:06 +00:00
|
|
|
dist: dist-local
|
2013-02-15 13:00:02 +00:00
|
|
|
cd libav/$(TMP_DIST_DIR) && tar -czf libav.tar.gz libav
|
|
|
|
mv libav/$(TMP_DIST_DIR)/libav.tar.gz ./
|
|
|
|
rm -rf libav/$(TMP_DIST_DIR)
|