From fcf7b622135a845e66bfa164447adb5fecacb1f6 Mon Sep 17 00:00:00 2001
From: Nicolas George <george@nsup.org>
Date: Mon, 31 Jul 2017 16:41:08 +0200
Subject: [PATCH] all: merge all libraries.
Signed-off-by: Nicolas George <george@nsup.org>
---
Makefile | 6 +++-
configure | 2 +-
ffbuild/common.mak | 13 ++++---
ffbuild/library.mak | 63 +---------------------------------
libavcodec/Makefile | 1 -
libavcodec/log2_tab.c | 1 -
libavcodec/reverse.c | 1 -
libavdevice/Makefile | 1 -
libavdevice/reverse.c | 1 -
libavfilter/Makefile | 2 --
libavfilter/log2_tab.c | 1 -
libavformat/Makefile | 1 -
libavformat/golomb_tab.c | 1 -
libavformat/log2_tab.c | 1 -
libffmpeg/Makefile | 88 ++++++++++++++++++++++++++++++++++++++++++++++++
libffmpeg/libffmpeg.v | 23 +++++++++++++
libswresample/Makefile | 1 -
libswresample/log2_tab.c | 1 -
libswscale/Makefile | 2 --
libswscale/log2_tab.c | 1 -
20 files changed, 126 insertions(+), 85 deletions(-)
delete mode 100644 libavcodec/log2_tab.c
delete mode 100644 libavcodec/reverse.c
delete mode 100644 libavdevice/reverse.c
delete mode 100644 libavfilter/log2_tab.c
delete mode 100644 libavformat/golomb_tab.c
delete mode 100644 libavformat/log2_tab.c
create mode 100644 libffmpeg/Makefile
create mode 100644 libffmpeg/libffmpeg.v
delete mode 100644 libswresample/log2_tab.c
delete mode 100644 libswscale/log2_tab.c
@@ -118,6 +118,10 @@ endef
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
+SUBDIR := libffmpeg/
+include $(SRC_PATH)/$(SUBDIR)Makefile
+SUBDIR := diediedie
+
include $(SRC_PATH)/doc/Makefile
define DOPROG
@@ -208,7 +212,7 @@ check: all alltools examples testprogs fate
include $(SRC_PATH)/tests/Makefile
-$(sort $(OBJDIRS)):
+$(sort $(OBJDIRS)) libffmpeg/:
$(Q)mkdir -p $@
# Dummy rule to stop make trying to rebuild removed or renamed headers
@@ -6226,7 +6226,7 @@ EOF
# add some linker flags
check_ldflags -Wl,--warn-common
-check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
+check_ldflags -Wl,-rpath-link=libffmpeg
enabled rpath && add_ldexeflags -Wl,-rpath,$libdir
enabled rpath && add_ldlibflags -Wl,-rpath,$libdir
test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
@@ -41,7 +41,7 @@ X86ASMFLAGS += $(IFLAGS:%=%/) -I$(<D)/ -Pconfig.asm
NVCCFLAGS += -ptx
HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
-LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
+LDFLAGS := $(LD_PATH)libffmpeg $(LDFLAGS)
define COMPILE
$(call $(1)DEP,$(1))
@@ -118,8 +118,8 @@ SLIBOBJS += $(SLIBOBJS-yes)
FFLIBS := $($(NAME)_FFLIBS) $(FFLIBS-yes) $(FFLIBS)
TESTPROGS += $(TESTPROGS-yes)
-LDLIBS = $(FFLIBS:%=%$(BUILDSUF))
-FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(EXTRALIBS)
+LDLIBS = libffmpeg$(BUILDSUF)
+FFEXTRALIBS := $(EXTRALIBS)
OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
SLIBOBJS := $(sort $(SLIBOBJS:%=$(SUBDIR)%))
@@ -132,9 +132,12 @@ TOOLOBJS := $(TOOLS:%=tools/%.o)
TOOLS := $(TOOLS:%=tools/%$(EXESUF))
HEADERS += $(HEADERS-yes)
+OBJS-$(NAME) := $(OBJS)
+
PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(2)LIBNAME))
-DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib),$(CONFIG_SHARED:yes=S)))
-STATIC_DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
+# XXX CIG libffmpeg
+#DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib),$(CONFIG_SHARED:yes=S)))
+#STATIC_DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
SRC_DIR := $(SRC_PATH)/lib$(NAME)
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
@@ -1,31 +1,17 @@
include $(SRC_PATH)/ffbuild/common.mak
--include $(SUBDIR)lib$(NAME).version
+# -include $(SUBDIR)lib$(NAME).version
-LIBVERSION := $(lib$(NAME)_VERSION)
-LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR)
-LIBMINOR := $(lib$(NAME)_VERSION_MINOR)
INCINSTDIR := $(INCDIR)/lib$(NAME)
INSTHEADERS := $(INSTHEADERS) $(HEADERS:%=$(SUBDIR)%)
-all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME) $(SUBDIR)lib$(FULLNAME).pc
-all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME) $(SUBDIR)lib$(FULLNAME).pc
-
LIBOBJS := $(OBJS) $(SUBDIR)%.h.o $(TESTOBJS)
$(LIBOBJS) $(LIBOBJS:.o=.s) $(LIBOBJS:.o=.i): CPPFLAGS += -DHAVE_AV_CONFIG_H
$(TESTOBJS) $(TESTOBJS:.o=.i): CFLAGS += -Umain
-$(SUBDIR)$(LIBNAME): $(OBJS)
- $(RM) $@
- $(AR) $(ARFLAGS) $(AR_O) $^
- $(RANLIB) $@
-
install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
-install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
-install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
-
define RULES
$(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB))
$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
@@ -33,27 +19,6 @@ $(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
$(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
$$(LD) $(LDFLAGS) $(LDEXEFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS)
-$(SUBDIR)lib$(NAME).version: $(SUBDIR)version.h | $(SUBDIR)
- $$(M) $$(SRC_PATH)/ffbuild/libversion.sh $(NAME) $$< > $$@
-
-$(SUBDIR)lib$(FULLNAME).pc: $(SUBDIR)version.h | $(SUBDIR)
- $$(M) $$(SRC_PATH)/ffbuild/pkgconfig_generate.sh $(NAME) "$(DESC)"
-
-$(SUBDIR)lib$(NAME).ver: $(SUBDIR)lib$(NAME).v $(OBJS)
- $$(M)sed 's/MAJOR/$(lib$(NAME)_VERSION_MAJOR)/' $$< | $(VERSION_SCRIPT_POSTPROCESS_CMD) > $$@
-
-$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
- $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
-
-$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver
- $(SLIB_CREATE_DEF_CMD)
- $$(LD) $(SHFLAGS) $(LDFLAGS) $(LDLIBFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
- $(SLIB_EXTRA_CMD)
-
-ifdef SUBDIR
-$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)
-endif
-
clean::
$(RM) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
$(CLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%) $(CLEANSUFFIXES:%=$(SUBDIR)tests/%)
@@ -62,36 +27,10 @@ distclean:: clean
$(RM) $(DISTCLEANSUFFIXES:%=$(SUBDIR)%) $(DISTCLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%) \
$(DISTCLEANSUFFIXES:%=$(SUBDIR)tests/%)
-install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
- $(Q)mkdir -p "$(SHLIBDIR)"
- $$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
- $$(STRIP) "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
- $(Q)$(foreach F,$(SLIB_INSTALL_LINKS),(cd "$(SHLIBDIR)" && $(LN_S) $(SLIB_INSTALL_NAME) $(F));)
- $(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(SHLIBDIR)")
- $(if $(SLIB_INSTALL_EXTRA_LIB),$(Q)mkdir -p "$(LIBDIR)")
- $(if $(SLIB_INSTALL_EXTRA_LIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_LIB:%=$(SUBDIR)%) "$(LIBDIR)")
-
-install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
- $(Q)mkdir -p "$(LIBDIR)"
- $$(INSTALL) -m 644 $$< "$(LIBDIR)"
- $(LIB_INSTALL_EXTRA_CMD)
-
install-lib$(NAME)-headers: $(addprefix $(SUBDIR),$(HEADERS) $(BUILT_HEADERS))
$(Q)mkdir -p "$(INCINSTDIR)"
$$(INSTALL) -m 644 $$^ "$(INCINSTDIR)"
-install-lib$(NAME)-pkgconfig: $(SUBDIR)lib$(FULLNAME).pc
- $(Q)mkdir -p "$(PKGCONFIGDIR)"
- $$(INSTALL) -m 644 $$^ "$(PKGCONFIGDIR)"
-
-uninstall-libs::
- -$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
- "$(SHLIBDIR)/$(SLIBNAME)" \
- "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
- -$(RM) $(SLIB_INSTALL_EXTRA_SHLIB:%="$(SHLIBDIR)/%")
- -$(RM) $(SLIB_INSTALL_EXTRA_LIB:%="$(LIBDIR)/%")
- -$(RM) "$(LIBDIR)/$(LIBNAME)"
-
uninstall-headers::
$(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS) $(BUILT_HEADERS))
$(RM) "$(PKGCONFIGDIR)/lib$(FULLNAME).pc"
@@ -124,7 +124,6 @@ OBJS-$(CONFIG_QSVENC) += qsvenc.o
OBJS-$(CONFIG_RANGECODER) += rangecoder.o
OBJS-$(CONFIG_RDFT) += rdft.o
OBJS-$(CONFIG_RV34DSP) += rv34dsp.o
-OBJS-$(CONFIG_SHARED) += log2_tab.o reverse.o
OBJS-$(CONFIG_SINEWIN) += sinewin.o sinewin_fixed.o
OBJS-$(CONFIG_SNAPPY) += snappy.o
OBJS-$(CONFIG_STARTCODE) += startcode.o
deleted file mode 100644
@@ -1 +0,0 @@
-#include "libavutil/log2_tab.c"
deleted file mode 100644
@@ -1 +0,0 @@
-#include "libavutil/reverse.c"
@@ -9,7 +9,6 @@ OBJS = alldevices.o \
utils.o \
OBJS-$(HAVE_LIBC_MSVCRT) += file_open.o
-OBJS-$(CONFIG_SHARED) += reverse.o
# input/output devices
OBJS-$(CONFIG_ALSA_INDEV) += alsa_dec.o alsa.o timefilter.o
deleted file mode 100644
@@ -1 +0,0 @@
-#include "libavutil/reverse.c"
@@ -378,8 +378,6 @@ SLIBOBJS-$(HAVE_GNU_WINDRES) += avfilterres.o
SKIPHEADERS-$(CONFIG_LIBVIDSTAB) += vidstabutils.h
SKIPHEADERS-$(CONFIG_OPENCL) += opencl_internal.h deshake_opencl_kernel.h unsharp_opencl_kernel.h
-OBJS-$(CONFIG_SHARED) += log2_tab.o
-
TOOLS = graph2dot
TESTPROGS = drawutils filtfmts formats integral
deleted file mode 100644
@@ -1 +0,0 @@
-#include "libavutil/log2_tab.c"
@@ -61,7 +61,6 @@ OBJS-$(CONFIG_RTPDEC) += rdt.o \
rtpdec_vp9.o \
rtpdec_xiph.o
OBJS-$(CONFIG_RTPENC_CHAIN) += rtpenc_chain.o rtp.o
-OBJS-$(CONFIG_SHARED) += log2_tab.o golomb_tab.o
OBJS-$(CONFIG_SRTP) += srtp.o
# muxers/demuxers
deleted file mode 100644
@@ -1 +0,0 @@
-#include "libavcodec/golomb.c"
deleted file mode 100644
@@ -1 +0,0 @@
-#include "libavutil/log2_tab.c"
new file mode 100644
@@ -0,0 +1,88 @@
+NAME = ffmpeg
+DESC = FFmpeg multimedia library
+
+LIBVERSION := $(libavutil_VERSION)
+LIBMAJOR := $(libavutil_VERSION_MAJOR)
+LIBMINOR := $(libavutil_VERSION_MINOR)
+
+OBJS := $(OBJS-avutil)
+OBJS-yes :=
+OBJS-$(CONFIG_AVCODEC) += $(OBJS-avcodec)
+OBJS-$(CONFIG_AVDEVICE) += $(OBJS-avdevice)
+OBJS-$(CONFIG_AVFILTER) += $(OBJS-avfilter)
+OBJS-$(CONFIG_AVFORMAT) += $(OBJS-avformat)
+OBJS-$(CONFIG_AVRESAMPLE) += $(OBJS-avresample)
+OBJS-$(CONFIG_POSTPROC) += $(OBJS-postproc)
+OBJS-$(CONFIG_SWRESAMPLE) += $(OBJS-swresample)
+OBJS-$(CONFIG_SWSCALE) += $(OBJS-swscale)
+OBJS += $(OBJS-yes)
+
+FFLIBS := avutil
+
+# XXX CIG libffmpeg
+#$(SUBDIR)$(LIBNAME): $(OBJS)
+# $(RM) $@
+# $(AR) $(ARFLAGS) $(AR_O) $^
+# $(RANLIB) $@
+
+# XXX CIG libffmpeg
+#install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
+#install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
+
+define RULES
+
+# XXX CIG libffmpeg TODO
+$(SUBDIR)lib$(FULLNAME).pc: libavutil/version.h | $(SUBDIR)
+ $$(M) $$(SRC_PATH)/ffbuild/pkgconfig_generate.sh $(NAME) "$(DESC)"
+
+$(SUBDIR)lib$(NAME).ver: $(SUBDIR)lib$(NAME).v $(OBJS) | $(SUBDIR)
+ $$(M)sed 's/MAJOR/$(lib$(NAME)_VERSION_MAJOR)/' $$< | $(VERSION_SCRIPT_POSTPROCESS_CMD) > $$@
+
+$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
+ $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
+
+$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver
+ $(SLIB_CREATE_DEF_CMD)
+ $$(LD) $(SHFLAGS) $(LDFLAGS) $(LDLIBFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
+ $(SLIB_EXTRA_CMD)
+
+clean::
+ $(RM) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
+ $(CLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%) $(CLEANSUFFIXES:%=$(SUBDIR)tests/%)
+
+distclean:: clean
+ $(RM) $(DISTCLEANSUFFIXES:%=$(SUBDIR)%) $(DISTCLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%) \
+ $(DISTCLEANSUFFIXES:%=$(SUBDIR)tests/%)
+
+# XXX CIG libffmpeg TODO
+install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
+ $(Q)mkdir -p "$(SHLIBDIR)"
+ $$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
+ $$(STRIP) "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
+ $(Q)$(foreach F,$(SLIB_INSTALL_LINKS),(cd "$(SHLIBDIR)" && $(LN_S) $(SLIB_INSTALL_NAME) $(F));)
+ $(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(SHLIBDIR)")
+ $(if $(SLIB_INSTALL_EXTRA_LIB),$(Q)mkdir -p "$(LIBDIR)")
+ $(if $(SLIB_INSTALL_EXTRA_LIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_LIB:%=$(SUBDIR)%) "$(LIBDIR)")
+
+install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
+ $(Q)mkdir -p "$(LIBDIR)"
+ $$(INSTALL) -m 644 $$< "$(LIBDIR)"
+ $(LIB_INSTALL_EXTRA_CMD)
+
+install-lib$(NAME)-pkgconfig: $(SUBDIR)lib$(FULLNAME).pc
+ $(Q)mkdir -p "$(PKGCONFIGDIR)"
+ $$(INSTALL) -m 644 $$^ "$(PKGCONFIGDIR)"
+
+uninstall-libs::
+ -$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
+ "$(SHLIBDIR)/$(SLIBNAME)" \
+ "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
+ -$(RM) $(SLIB_INSTALL_EXTRA_SHLIB:%="$(SHLIBDIR)/%")
+ -$(RM) $(SLIB_INSTALL_EXTRA_LIB:%="$(LIBDIR)/%")
+ -$(RM) "$(LIBDIR)/$(LIBNAME)"
+
+endef
+
+$(eval $(RULES))
+
+FFLIBS := ffmpeg
new file mode 100644
@@ -0,0 +1,23 @@
+LIBAVUTIL_MAJOR {
+ global:
+ av*;
+ postproc_*;
+ pp_*;
+ swr_*;
+ swresample_*;
+ swscale_*;
+ sws_*;
+ #FIXME those are for ffserver
+ ff_inet_aton;
+ ff_socket_nonblock;
+ ff_rtsp_parse_line;
+ ff_rtp_get_local_rtp_port;
+ ff_rtp_get_local_rtcp_port;
+ ffio_open_dyn_packet_buf;
+ ffio_set_buf_size;
+ ffurl_close;
+ ffurl_open;
+ ffurl_write;
+ local:
+ *;
+};
@@ -15,7 +15,6 @@ OBJS = audioconvert.o \
swresample_frame.o \
OBJS-$(CONFIG_LIBSOXR) += soxr_resample.o
-OBJS-$(CONFIG_SHARED) += log2_tab.o
# Windows resource file
SLIBOBJS-$(HAVE_GNU_WINDRES) += swresampleres.o
deleted file mode 100644
@@ -1 +0,0 @@
-#include "libavutil/log2_tab.c"
@@ -19,8 +19,6 @@ OBJS = alphablend.o \
yuv2rgb.o \
vscale.o \
-OBJS-$(CONFIG_SHARED) += log2_tab.o
-
# Windows resource file
SLIBOBJS-$(HAVE_GNU_WINDRES) += swscaleres.o
deleted file mode 100644
@@ -1 +0,0 @@
-#include "libavutil/log2_tab.c"
--
2.13.2