This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=805d2bbc2b02b857448e55ce9c00279da184ec4c commit 805d2bbc2b02b857448e55ce9c00279da184ec4c Author: Guillem Jover <[email protected]> AuthorDate: Fri Apr 28 23:16:29 2023 +0200 build: Use an export symbols file if there is no version script support We generate the symbol list from the version script to avoid repeating ourselves and potentially getting the lists out-of-sync. --- lib/dpkg/.gitignore | 1 + lib/dpkg/Makefile.am | 28 +++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/lib/dpkg/.gitignore b/lib/dpkg/.gitignore index 996ec5132..453d8bdf9 100644 --- a/lib/dpkg/.gitignore +++ b/lib/dpkg/.gitignore @@ -1,2 +1,3 @@ libdpkg.pc +libdpkg.sym t.tmp diff --git a/lib/dpkg/Makefile.am b/lib/dpkg/Makefile.am index c21106502..8d818adac 100644 --- a/lib/dpkg/Makefile.am +++ b/lib/dpkg/Makefile.am @@ -17,6 +17,7 @@ LDADD = \ ../compat/libcompat.la \ # EOL +DISTCLEANFILES = EXTRA_DIST = \ $(test_scripts) \ @@ -30,11 +31,22 @@ pkgconfig_DATA = libdpkg.pc devlib_LTLIBRARIES = libdpkg.la +EXTRA_libdpkg_la_DEPENDENCIES = \ + libdpkg.map \ + # EOL + libdpkg_la_LDFLAGS = if HAVE_LINKER_VERSION_SCRIPT libdpkg_la_LDFLAGS += \ -Wl,--version-script=$(srcdir)/libdpkg.map \ # EOL +else +libdpkg_la_LDFLAGS += \ + -export-symbols libdpkg.sym \ + # EOL +EXTRA_libdpkg_la_DEPENDENCIES += \ + libdpkg.sym \ + # EOL endif libdpkg_la_LDFLAGS += $(MD_LIBS) libdpkg_la_LIBADD = \ @@ -49,9 +61,6 @@ libdpkg_la_LIBADD += \ $(BZ2_LIBS) \ # EOL endif -EXTRA_libdpkg_la_DEPENDENCIES = \ - libdpkg.map \ - # EOL libdpkg_la_SOURCES = \ dlist.h \ ar.c \ @@ -182,6 +191,19 @@ pkginclude_HEADERS = \ version.h \ # EOL +DISTCLEANFILES += \ + libdpkg.sym \ + # EOL + +# Generate a simple libtool symbol export list to be used as a fallback if +# there is no version script support. +libdpkg.sym: libdpkg.map + $(AM_V_GEN) $(SED) -n \ + -e 's/#.*$$//g' \ + -e 's/^[[:space:]]\{1,\}\([A-Za-z0-9_]\{1,\}\);/\1/p' \ + $(srcdir)/libdpkg.map \ + >$@ + t_t_headers_cpp_SOURCES = \ t/t-headers-cpp.cc \ # EOL -- Dpkg.Org's dpkg

