aboutsummaryrefslogtreecommitdiffstats
path: root/libswresample/Makefile
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-02-09 12:40:04 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-01-04 05:01:04 +0100
commit20b0d24c2f7ae86cebeb17399a2fea3a7e3d0f69 (patch)
tree130e16187bcb46c8ad8d3eab6195861fcb1e2d61 /libswresample/Makefile
parent3485e79f07d74e47ff00b60a68d609d37d0129ba (diff)
downloadffmpeg-20b0d24c2f7ae86cebeb17399a2fea3a7e3d0f69.tar.gz
Makefile: Redo duplicating object files in shared builds
In case of shared builds, some object files containing tables are currently duplicated into other libraries: log2_tab.c, golomb.c, reverse.c. The check for whether this is duplicated is simply whether CONFIG_SHARED is true. Yet this is crude: E.g. libavdevice includes reverse.c for shared builds, but only needs it for the decklink input device, which given that decklink is not enabled by default will be unused in most libavdevice.so. This commit changes this by making it more explicit about what to duplicate from other libraries. To do this, two new Makefile variables were added: SHLIBOBJS and STLIBOBJS. SHLIBOBJS contains the objects that are duplicated from other libraries in case of shared builds; STLIBOBJS contains stuff that a library has to provide for other libraries in case of static builds. These new variables provide a way to enable/disable with a finer granularity than just whether shared builds are enabled or not. E.g. lavd's Makefile now contains: SHLIBOBJS-$(CONFIG_DECKLINK_INDEV) += reverse.o Another example is provided by the golomb tables. These are provided by lavc for static builds, even if one uses a build configuration that makes only lavf use them. Therefore lavc's Makefile contains STLIBOBJS-$(CONFIG_MXF_MUXER) += golomb.o, whereas lavf's Makefile has a corresponding SHLIBOBJS-$(CONFIG_MXF_MUXER) += golomb_tab.o. E.g. in case the MXF muxer is the only component needing these tables only libavformat.so will contain them for shared builds; currently libavcodec.so does so, too. (There is currently a CONFIG_EXTRA group for golomb. But actually one would need two groups (golomb_avcodec and golomb_avformat) in order to know when and where to include these tables. Therefore this commit uses a Makefile-based approach for this and stops using these groups for the users in libavformat.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libswresample/Makefile')
-rw-r--r--libswresample/Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/libswresample/Makefile b/libswresample/Makefile
index 42666e4dd2..f528427f55 100644
--- a/libswresample/Makefile
+++ b/libswresample/Makefile
@@ -15,7 +15,9 @@ OBJS = audioconvert.o \
swresample_frame.o \
OBJS-$(CONFIG_LIBSOXR) += soxr_resample.o
-OBJS-$(CONFIG_SHARED) += log2_tab.o
+
+# Objects duplicated from other libraries for shared builds
+SHLIBOBJS += log2_tab.o
# Windows resource file
SLIBOBJS-$(HAVE_GNU_WINDRES) += swresampleres.o