From patchwork Wed Dec 15 12:35:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 32523 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp8175651iog; Wed, 15 Dec 2021 04:36:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNQWNtCauU8AZh83s3ZRIv9JDUcKuOzo17JPJtJFwuN2kFK5H7XIxfMFk1Dd+tKcvz5kJ2 X-Received: by 2002:a50:e003:: with SMTP id e3mr14350258edl.374.1639571772835; Wed, 15 Dec 2021 04:36:12 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id e16si1057983ejs.1009.2021.12.15.04.36.12; Wed, 15 Dec 2021 04:36:12 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=TevacaRj; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DFD6668B0D3; Wed, 15 Dec 2021 14:36:02 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067045.outbound.protection.outlook.com [40.92.67.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5072A68AF33 for ; Wed, 15 Dec 2021 14:35:56 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X86U/Lhwbada2aX4EKVRQWKDmneS0ITtwDahiW+sGYaVBaXdFzlyxLMkIZKiJHA9GcL5l2CZ9SjTp/ZDG4Sv3tAjQGipEMYl1vfR8+70uAen4K6yAF1Vcm3nGiRALmoGXbiRjI+zS0vYXrU0Sqq1O5BDbM5kFVlCd63Y6td6Oy2TmApGtrxY5M2PEPsQhAXE3pofa/O257b4AAY7vo2IOJxBz2CLoGxxc97gk8icqvtmOVb8xzKh2mjYRKpQsvDdFR3Cy5ktw02D/YCW/BrwK0w5cR8PoX5dYBrLAy+Lft0VUd+eiSD4LHcXN1DkTNygV8wcT5aYH/YjA+a1l59IBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uTb5it9C/FliU2qTkLTKIqe11yZScZqEZIxlte5p2Bg=; b=jX9Y++/M4f0WJ8Jk9V5BLrPw0ZwQcetPbB94wjco4h5/HAgP6AgwET3riBaYr4G9t0tmx8IqjNEtrR25SeB5EzGqPDooOz0PNCwLujVeUoRLF26XiAjeF8SI7weohltxGUJ3wn9m4EgWx7Nw5aLcXO5xE2ayAeVYPzTrD8fsQ0RINxg0OPEtnR3uyhuwFJZ2BzIyK28DEZIO/rbDCZ7biz/fMbYry+YRVOxiA8yDb4e6m0ff3yylm8+EgVJBdre93hC7R1AzW0KK176/EKsGdSdrCTK9W4rDkeuXwwaaB6qh8voUalCdpMUvxNZ0Wff7c3EsQxZyET/pwMA6MvakCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uTb5it9C/FliU2qTkLTKIqe11yZScZqEZIxlte5p2Bg=; b=TevacaRjhcbLT/953waqENdK6td+he3p7ed46YWjefKYmCg48OchdvSTeOVmpNmY6/PYLq/9Cad5GpAusohjahoACJxbDErf86CkL8TZBYB6C/HoCPdZFzT1UtSHVaTqDZxqreXwwijnll72GOAQF4SfQWQyIec3iRJhVjPIeoxsJv7UzK1mrD9NEz1PIdHSH64ud7uuEllVV7CtxDHnQRmWx3jtWKD3oEUqiMU7APdLSwuWQ2t3b/SY4A+el4IKST32irvDriV2b65x0qqWBbnP9Io4lIvlF2XVg/MAlw7OFEtI7ezfOtlBeQYPjHOMuxq+8Jd+Djr4iuaG/Sxwbg== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB4952.eurprd03.prod.outlook.com (2603:10a6:20b:8a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.17; Wed, 15 Dec 2021 12:35:51 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f0dc:92f5:6bc2:45ca]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f0dc:92f5:6bc2:45ca%6]) with mapi id 15.20.4778.018; Wed, 15 Dec 2021 12:35:51 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Dec 2021 13:35:33 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [fuN+z35AIG8exL9Tq47QGYmvU2sJBAvu] X-ClientProxiedBy: AM0PR08CA0014.eurprd08.prod.outlook.com (2603:10a6:208:d2::27) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211215123541.5406-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: df204b10-de17-4def-0041-08d9bfc76dbe X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiR3EehW4kxQzdNcP2D/mG1JD2vMspIFObwLczIsl/dKTPcnrMVifcHqEuDKiC6kK6lWI8kcvzSq1wOzKXgDCu1h3LdC22RqAPph95D5WS/MWSNxARLiqlN5jlMF/i/L/xwxgGMUS4bdcGEkUCagI7ufOn/bUB134X3MVa/mTyzWzvstGbBxGJGm7VUXaOq9o2ADbnht49dbH0IXpKkeQWDshQ3VvaqVN+OvKEXaywLpH6W+YUD+NIcdzDruyNdDNT4oP4onWYgC+56LX/RVbJK90Vyw7TSvB+zrXQ7gfSn68XVAYLngtAoskUkTN2J9ceu7YaKo7B0S6ht0IGlJwMvdO2EwL5WeUhZbgbOos2nPFg9knRwkWwZiq91a/mx4gY/eZkWTupagmmd61wqXL0aci11DzwdXtlczEvw9zf8sjfeP0Rci0Uo4aklULuhhgUzmD2kqwBeG6TsBztixxa7niKHMqZOQ1Uy70GdbDIx0BFHVYl/upM+rg9U/yndnpPAZQem/jwLIqR5sBDIuus3sojT0a0Voqd7ZyF2B4+txPbIYnPtZ9hgUIfpVSxT9jWpAKYNeJd1HJQIqTLhuVTqGMIuE9GoHs1quv0/lK0ymxp5j3m4VGkCQ+tgEMYSmEy2yp+XeALhNLLv0G3vIk6E+z40mBqWW2PZlx6y6Scbx1qWgFdzp1V65uL58ns5THJg/L7lX34qLFPBOrgiADprRyjRr949cmHGD7nTJGssokaKMcomSEqTDpO0myfC5FLQ= X-MS-TrafficTypeDiagnostic: AM6PR03MB4952:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rKBfhvsqhXby2QiL4zj9EFy1QchEd40IIpxxX0E1MJ66LKQ3StkoAdp4WchnwsYmriKeO1Ck4ciSE+NKtg546FG8W218M3DdIT01dz/YN1FQaFaSadNBI1dWNt/PezONWgERWKT4GfQ+JlLsNYPjQ/a/DFgRSGl2CaRPUr505vxVZD9zudupZsPvBJegDsZrYyGfXQ5j0rAvK4wYXQWAOlxXa6mE6NDsPeS4724xhuvkiM6qV5zKvnwP7IU9S723w1xDgqRPAHlHkrWXEw6YN82aOn6SDLWWhYBy8OkgBVsR8xwIvQixQQ4VmseSdhPZlYb89Q9kRgnpe8gPID7n7T27LgdC8pdy+JwzRxTvunIba3EEulYG0Uw6p92r50waAPjm3Twm6uEOUyEodowbklJURQZg0f23opfTTybIWVdthnixL7C/7ajaQEJBjO2XsFc4woULzerd0GgKuLWJPKDmgKRXhp7V7rC2YWXAEbqn7fWl+ctno/FJzAqKoW6FEMx2PNljKVt0B+sjyBivFENqgX3HAX0ROaVZZGBChzu0IEjX653K/qtecWzQito5YhK8DBHpI8cM1hFfC3GW+A== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zAcki8wy0+V+q8+GpTszOWhHFLJuM7OUf95X9uWO0Ek9WjE1pUSfR8+JCiPeBe/+4FI8d3LLm6DX936Ajq/5NjaOJJT4Q8Z8BibcH607yhK9so84v7u5mYmV6M0kU02c0GL22PtX6Y3GPJnRZpte2D/gH4Jv8yziXXda2ZScsVzqsBsAtwh3cp6M7ziBk/Kt4loO5xtnMpU0XQMYrx6Nh2/Zza68tGfk8sWuJKaLDoNCAy08m6GIsZKOSUI0p/pXrANA77umorK2fasSLLpscMrfLClNONZZNuNGenAdj6VmV4b+1SDjAfDW5pfRAuub4KrIIXEEBsmrVMNw598dd+taL+QMhBwb9vXOkmiW5YT0T6iHSOkFJdJYAeTKRpeu4aV0hEJW0ZZnfTqajuXyK53xHdglldEKR1XujFLrpQxv6qTs+Zy0Z+s+bT1jRD/183Ca9RWEaSIMkf/g/fQUsH73Hnrw3g0xnnV2LNtWaIOBLUDg46px0h93Kus8+gLK2zaHeSBVZHWQ6MjVonCgGeb8FFdwn3RjJQhN41U4p4ywMyu97effDEAQM/c4+2ZrvxScWig1NeDl9QfZsxg9XEu8SfxMjDnaMdTiSj7+15x0ctaM53F5s5FypeWJkhs4G/f/FPb/VbbrgybtZGsk5ajA5dx/kJAqQMAtMdvDhGDMTk0vBF3tjPEen2vWxr05JeBdmoH1sykVWSnouM2AnR+T1BtckBghMKdiGtfzeYWCThPQ8I+Xv08wMH8+T8vGk0Rmr+UXA/n9jOnlOgYL2bKp4kMkejiX2GgdrMl1yDCC2nUt8rMlD4a+euyIyoRVjZ4UDTIZPvWHrEmeQ4f63KeLZ4QvnBKkynmbo6j/qyPHGWYjjJBNraUWc62ckdzZTbFYRvJpX2x1RKTxiZWj9ry5O2sFLEWMw9/L9e9fYyHeXpLuF7aggxwa4x1jsSBq34eZel+5yOhe0kvRbkIN/w== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: df204b10-de17-4def-0041-08d9bfc76dbe X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2021 12:35:51.2857 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB4952 Subject: [FFmpeg-devel] [PATCH 03/11] Makefile: Redo duplicating object files in shared builds X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: juH8XBb4WHiU 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 --- Makefile | 2 +- configure | 4 ++-- ffbuild/common.mak | 10 ++++++++-- ffbuild/library.mak | 22 +++++++++++++++++++--- libavcodec/Makefile | 10 ++++++++-- libavdevice/Makefile | 4 +++- libavfilter/Makefile | 5 +++-- libavformat/Makefile | 6 +++++- libswresample/Makefile | 4 +++- libswscale/Makefile | 3 ++- 10 files changed, 54 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 26c9107237..fd6a7f0230 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,7 @@ SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS \ ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \ ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS \ MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \ - MMI-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS + MMI-OBJS OBJS SLIBOBJS SHLIBOBJS STLIBOBJS HOSTOBJS TESTOBJS define RESET $(1) := diff --git a/configure b/configure index a7593ec2db..ab1b9f6b66 100755 --- a/configure +++ b/configure @@ -3419,7 +3419,7 @@ mp4_muxer_select="mov_muxer" mpegts_demuxer_select="iso_media" mpegts_muxer_select="ac3_parser adts_muxer latm_muxer h264_mp4toannexb_bsf hevc_mp4toannexb_bsf" mpegtsraw_demuxer_select="mpegts_demuxer" -mxf_muxer_select="golomb pcm_rechunk_bsf" +mxf_muxer_select="pcm_rechunk_bsf" mxf_d10_muxer_select="mxf_muxer" mxf_opatom_muxer_select="mxf_muxer" nut_muxer_select="riffenc" @@ -3432,7 +3432,7 @@ ogv_muxer_select="ogg_muxer" opus_muxer_select="ogg_muxer" psp_muxer_select="mov_muxer" rtp_demuxer_select="sdp_demuxer" -rtp_muxer_select="golomb jpegtables" +rtp_muxer_select="jpegtables" rtp_mpegts_muxer_select="mpegts_muxer rtp_muxer" rtpdec_select="asf_demuxer jpegtables mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp" rtsp_demuxer_select="http_protocol rtpdec" diff --git a/ffbuild/common.mak b/ffbuild/common.mak index 268ae61154..616d39ddba 100644 --- a/ffbuild/common.mak +++ b/ffbuild/common.mak @@ -140,6 +140,8 @@ include $(SRC_PATH)/ffbuild/arch.mak OBJS += $(OBJS-yes) SLIBOBJS += $(SLIBOBJS-yes) +SHLIBOBJS += $(SHLIBOBJS-yes) +STLIBOBJS += $(STLIBOBJS-yes) FFLIBS := $($(NAME)_FFLIBS) $(FFLIBS-yes) $(FFLIBS) TESTPROGS += $(TESTPROGS-yes) @@ -148,6 +150,8 @@ FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(foreach lib,EXTRALIBS-$(NAME) $(FFLIBS:%= OBJS := $(sort $(OBJS:%=$(SUBDIR)%)) SLIBOBJS := $(sort $(SLIBOBJS:%=$(SUBDIR)%)) +SHLIBOBJS := $(sort $(SHLIBOBJS:%=$(SUBDIR)%)) +STLIBOBJS := $(sort $(STLIBOBJS:%=$(SUBDIR)%)) TESTOBJS := $(TESTOBJS:%=$(SUBDIR)tests/%) $(TESTPROGS:%=$(SUBDIR)tests/%.o) TESTPROGS := $(TESTPROGS:%=$(SUBDIR)tests/%$(EXESUF)) HOSTOBJS := $(HOSTPROGS:%=$(SUBDIR)%.o) @@ -183,10 +187,12 @@ $(OBJS): | $(sort $(dir $(OBJS))) $(HOBJS): | $(sort $(dir $(HOBJS))) $(HOSTOBJS): | $(sort $(dir $(HOSTOBJS))) $(SLIBOBJS): | $(sort $(dir $(SLIBOBJS))) +$(SHLIBOBJS): | $(sort $(dir $(SHLIBOBJS))) +$(STLIBOBJS): | $(sort $(dir $(STLIBOBJS))) $(TESTOBJS): | $(sort $(dir $(TESTOBJS))) $(TOOLOBJS): | tools -OUTDIRS := $(OUTDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(TESTOBJS)) +OUTDIRS := $(OUTDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(SHLIBOBJS) $(STLIBOBJS) $(TESTOBJS)) CLEANSUFFIXES = *.d *.gcda *.gcno *.h.c *.ho *.map *.o *.pc *.ptx *.ptx.gz *.ptx.c *.ver *.version *$(DEFAULT_X86ASMD).asm *~ *.ilk *.pdb LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a @@ -198,4 +204,4 @@ endef $(eval $(RULES)) --include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d) $(SLIBOBJS:.o=.d)) $(OBJS:.o=$(DEFAULT_X86ASMD).d) +-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d) $(SHLIBOBJS:.o=.d) $(STLIBOBJS:.o=.d) $(SLIBOBJS:.o=.d)) $(OBJS:.o=$(DEFAULT_X86ASMD).d) diff --git a/ffbuild/library.mak b/ffbuild/library.mak index 612bacb980..ad09f20da9 100644 --- a/ffbuild/library.mak +++ b/ffbuild/library.mak @@ -14,10 +14,26 @@ 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 := $(OBJS) $(SHLIBOBJS) $(STLIBOBJS) $(SUBDIR)%.h.o $(TESTOBJS) $(LIBOBJS) $(LIBOBJS:.o=.s) $(LIBOBJS:.o=.i): CPPFLAGS += -DHAVE_AV_CONFIG_H -$(SUBDIR)$(LIBNAME): $(OBJS) +ifdef CONFIG_SHARED +# In case both shared libs and static libs are enabled, it can happen +# that a user might want to link e.g. libavformat statically, but +# libavcodec and the other libs dynamically. In this case +# libavformat won't be able to access libavcodec's internal symbols, +# so that they have to be duplicated into the archive just like +# for purely shared builds. +# Test programs are always statically linked against their library +# to be able to access their library's internals, even with shared builds. +# Yet linking against dependend libraries still uses dynamic linking. +# This means that we are in the scenario described above. +# In case only static libs are used, the linker will only use +# one of these copies; this depends on the duplicated object files +# containing exactly the same symbols. +OBJS += $(SHLIBOBJS) +endif +$(SUBDIR)$(LIBNAME): $(OBJS) $(STLIBOBJS) $(RM) $@ $(AR) $(ARFLAGS) $(AR_O) $^ $(RANLIB) $@ @@ -48,7 +64,7 @@ $(SUBDIR)lib$(NAME).ver: $(SUBDIR)lib$(NAME).v $(OBJS) $(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 +$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SHLIBOBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver $(SLIB_CREATE_DEF_CMD) $$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS) $(SLIB_EXTRA_CMD) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index fb90ecea84..d855f5a229 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -139,7 +139,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 OBJS-$(CONFIG_SNAPPY) += snappy.o OBJS-$(CONFIG_STARTCODE) += startcode.o @@ -979,7 +978,10 @@ OBJS-$(CONFIG_VP9_VDPAU_HWACCEL) += vdpau_vp9.o OBJS-$(CONFIG_VP9_VIDEOTOOLBOX_HWACCEL) += videotoolbox_vp9.o OBJS-$(CONFIG_VP8_QSV_HWACCEL) += qsvdec.o -# libavformat dependencies +# Objects duplicated from other libraries for shared builds +SHLIBOBJS += log2_tab.o reverse.o + +# General libavformat dependencies OBJS-$(CONFIG_ISO_MEDIA) += mpeg4audio.o mpegaudiodata.o OBJS-$(CONFIG_ADTS_MUXER) += mpeg4audio.o @@ -995,6 +997,10 @@ OBJS-$(CONFIG_SPDIF_MUXER) += dca.o OBJS-$(CONFIG_TAK_DEMUXER) += tak.o OBJS-$(CONFIG_WEBM_MUXER) += mpeg4audio.o +# libavformat dependencies for static builds +STLIBOBJS-$(CONFIG_MXF_MUXER) += golomb.o +STLIBOBJS-$(CONFIG_RTP_MUXER) += golomb.o + # libavfilter dependencies OBJS-$(CONFIG_ELBG_FILTER) += elbg.o diff --git a/libavdevice/Makefile b/libavdevice/Makefile index 0dfe47a1f4..53efda0514 100644 --- a/libavdevice/Makefile +++ b/libavdevice/Makefile @@ -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 @@ -54,6 +53,9 @@ OBJS-$(CONFIG_XV_OUTDEV) += xv.o OBJS-$(CONFIG_LIBCDIO_INDEV) += libcdio.o OBJS-$(CONFIG_LIBDC1394_INDEV) += libdc1394.o +# Objects duplicated from other libraries for shared builds +SHLIBOBJS-$(CONFIG_DECKLINK_INDEV) += reverse.o + # Windows resource file SLIBOBJS-$(HAVE_GNU_WINDRES) += avdeviceres.o diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 2fe495df28..f4f077af46 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -572,13 +572,14 @@ OBJS-$(CONFIG_SPECTRUMSYNTH_FILTER) += vaf_spectrumsynth.o OBJS-$(CONFIG_AMOVIE_FILTER) += src_movie.o OBJS-$(CONFIG_MOVIE_FILTER) += src_movie.o +# Objects duplicated from other libraries for shared builds +SHLIBOBJS += log2_tab.o + # Windows resource file SLIBOBJS-$(HAVE_GNU_WINDRES) += avfilterres.o SKIPHEADERS-$(CONFIG_LIBVIDSTAB) += vidstabutils.h -OBJS-$(CONFIG_SHARED) += log2_tab.o - SKIPHEADERS-$(CONFIG_QSVVPP) += qsvvpp.h SKIPHEADERS-$(CONFIG_OPENCL) += opencl.h SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_vpp.h diff --git a/libavformat/Makefile b/libavformat/Makefile index 2b5caf9d33..2b5bb43745 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -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 @@ -677,6 +676,11 @@ OBJS-$(CONFIG_LIBSRT_PROTOCOL) += libsrt.o OBJS-$(CONFIG_LIBSSH_PROTOCOL) += libssh.o OBJS-$(CONFIG_LIBZMQ_PROTOCOL) += libzmq.o +# Objects duplicated from other libraries for shared builds +SHLIBOBJS += log2_tab.o +SHLIBOBJS-$(CONFIG_MXF_MUXER) += golomb_tab.o +SHLIBOBJS-$(CONFIG_RTP_MUXER) += golomb_tab.o + # libavdevice dependencies OBJS-$(CONFIG_IEC61883_INDEV) += dv.o 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 diff --git a/libswscale/Makefile b/libswscale/Makefile index 4b8f9de425..a0ec71e06f 100644 --- a/libswscale/Makefile +++ b/libswscale/Makefile @@ -19,7 +19,8 @@ OBJS = alphablend.o \ yuv2rgb.o \ vscale.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) += swscaleres.o