You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libass/libass-0.17.2-Fix_checkasm_...

105 lines
3.6 KiB

From 306bf76ca5ac05d936614e5c2ffc23aeac6dfb63 Mon Sep 17 00:00:00 2001
From: Oneric <oneric@oneric.stub>
Date: Sat, 8 Jun 2024 01:44:45 +0200
Subject: [PATCH] Fix checkasm with --disable-static
checkasm tests internal libass functions, but linked to the public
libass library directly. Ths worked fine if a static lib is available,
but if only a shared lib was built, symbol export control hides required
functions leading to link-time failures.
To workaround this create an internal static-only convenience library
encompassing all libass sources. The real library is now just a thin
linking wrapper around this.
---
Makefile.am | 1 +
Makefile_util.am | 2 +-
libass/Makefile_library.am | 17 ++++++++++-------
3 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 89e618f62..e224e5332 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,6 +20,7 @@ nasm_verbose_ = $(nasm_verbose_$(AM_DEFAULT_VERBOSITY))
nasm_verbose_0 = @echo " NASM " $@;
lib_LTLIBRARIES =
+noinst_LTLIBRARIES =
noinst_PROGRAMS =
check_PROGRAMS =
TESTS =
diff --git a/Makefile_util.am b/Makefile_util.am
index 52a4c6011..5880d3cba 100644
--- a/Makefile_util.am
+++ b/Makefile_util.am
@@ -58,7 +58,7 @@ checkasm_checkasm_SOURCES = \
libass/ass_rasterizer.h libass/ass_utils.h
checkasm_checkasm_CPPFLAGS = -I$(top_srcdir)/libass
-checkasm_checkasm_LDADD = libass/libass.la
+checkasm_checkasm_LDADD = libass/libass_internal.la
checkasm_checkasm_LDFLAGS = $(AM_LDFLAGS) -static
if X86
diff --git a/libass/Makefile_library.am b/libass/Makefile_library.am
index e8431b7ea..05efae752 100644
--- a/libass/Makefile_library.am
+++ b/libass/Makefile_library.am
@@ -5,8 +5,8 @@ LIBASS_LT_AGE = 2
.asm.lo:
$(nasm_verbose)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(top_srcdir)/ltnasm.sh $(AS) $(ASFLAGS) -I$(top_srcdir)/libass/ -Dprivate_prefix=ass -o $@ $<
-lib_LTLIBRARIES += libass/libass.la
-libass_libass_la_SOURCES = \
+noinst_LTLIBRARIES += libass/libass_internal.la
+libass_libass_internal_la_SOURCES = \
libass/ass_utils.h libass/ass_utils.c \
libass/ass_string.h libass/ass_string.c \
libass/ass_compat.h libass/ass_strtod.c \
@@ -32,7 +32,7 @@ libass_libass_la_SOURCES = \
if ASM
if X86
-libass_libass_la_SOURCES += \
+libass_libass_internal_la_SOURCES += \
libass/x86/rasterizer.asm \
libass/x86/blend_bitmaps.asm \
libass/x86/be_blur.asm \
@@ -40,7 +40,7 @@ libass_libass_la_SOURCES += \
libass/x86/cpuid.h libass/x86/cpuid.asm
endif
if AARCH64
-libass_libass_la_SOURCES += \
+libass_libass_internal_la_SOURCES += \
libass/aarch64/rasterizer.S \
libass/aarch64/blend_bitmaps.S \
libass/aarch64/be_blur.S \
@@ -50,20 +50,23 @@ endif
endif
if FONTCONFIG
-libass_libass_la_SOURCES += libass/ass_fontconfig.h libass/ass_fontconfig.c
+libass_libass_internal_la_SOURCES += libass/ass_fontconfig.h libass/ass_fontconfig.c
endif
if DIRECTWRITE
-libass_libass_la_SOURCES += \
+libass_libass_internal_la_SOURCES += \
libass/dwrite_c.h \
libass/ass_directwrite_info_template.h \
libass/ass_directwrite.h libass/ass_directwrite.c
endif
if CORETEXT
-libass_libass_la_SOURCES += libass/ass_coretext.h libass/ass_coretext.c
+libass_libass_internal_la_SOURCES += libass/ass_coretext.h libass/ass_coretext.c
endif
+lib_LTLIBRARIES += libass/libass.la
+libass_libass_la_LIBADD = libass/libass_internal.la
+libass_libass_la_SOURCES =
libass_libass_la_LDFLAGS = -no-undefined -version-info $(LIBASS_LT_CURRENT):$(LIBASS_LT_REVISION):$(LIBASS_LT_AGE)
libass_libass_la_LDFLAGS += -export-symbols $(top_srcdir)/libass/libass.sym