From a4a420eedcc5426f67b8ed64bbf88f70fce53963 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Wed, 21 Feb 2024 12:53:03 +0100 Subject: [PATCH] Autotools: Turn libexpatinternal.la into standalone library .. so that we can now have code in say xmlparse.c that does not end up in libexpat.so but still runs when executing the test suite. --- expat/lib/Makefile.am | 15 +++++++-------- expat/tests/Makefile.am | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/expat/lib/Makefile.am b/expat/lib/Makefile.am index 0e0185b5..1ecb8fa2 100644 --- a/expat/lib/Makefile.am +++ b/expat/lib/Makefile.am @@ -36,7 +36,9 @@ include_HEADERS = \ expat_external.h lib_LTLIBRARIES = libexpat.la -noinst_LTLIBRARIES = libexpatinternal.la +if WITH_TESTS +noinst_LTLIBRARIES = libtestpat.la +endif libexpat_la_LDFLAGS = \ @AM_LDFLAGS@ \ @@ -44,17 +46,14 @@ libexpat_la_LDFLAGS = \ -no-undefined \ -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@ -libexpat_la_SOURCES = - -# This layer of indirection allows -# the test suite to access internal symbols -# despite compiling with -fvisibility=hidden -libexpatinternal_la_SOURCES = \ +libexpat_la_SOURCES = \ xmlparse.c \ xmltok.c \ xmlrole.c -libexpat_la_LIBADD = libexpatinternal.la +if WITH_TESTS +libtestpat_la_SOURCES = $(libexpat_la_SOURCES) +endif doc_DATA = \ ../AUTHORS \ diff --git a/expat/tests/Makefile.am b/expat/tests/Makefile.am index f949fe7f..97da3bf6 100644 --- a/expat/tests/Makefile.am +++ b/expat/tests/Makefile.am @@ -72,8 +72,8 @@ runtests_cxx_SOURCES = \ runtests_cxx.cpp \ structdata_cxx.cpp -runtests_LDADD = ../lib/libexpatinternal.la -runtests_cxx_LDADD = ../lib/libexpatinternal.la +runtests_LDADD = ../lib/libtestpat.la +runtests_cxx_LDADD = ../lib/libtestpat.la runtests_LDFLAGS = @AM_LDFLAGS@ @LIBM@ runtests_cxx_LDFLAGS = @AM_LDFLAGS@ @LIBM@