public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] debuginfod: export DEBUGINFOD_SONAME macro in debuginfod.h
@ 2020-11-30  9:00 Dmitry V. Levin
  2020-12-06 12:06 ` Mark Wielaard
  0 siblings, 1 reply; 21+ messages in thread
From: Dmitry V. Levin @ 2020-11-30  9:00 UTC (permalink / raw)
  To: elfutils-devel

Add DEBUGINFOD_SONAME macro to API for use by those of libdebuginfod
clients that would like to dlopen the library in the same way as
__libdwfl_debuginfod_init does.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 ChangeLog                                    |  5 +++++
 configure.ac                                 |  5 ++++-
 debuginfod/ChangeLog                         |  8 ++++++++
 debuginfod/Makefile.am                       | 13 ++++++-------
 debuginfod/{debuginfod.h => debuginfod.h.in} |  3 +++
 5 files changed, 26 insertions(+), 8 deletions(-)
 rename debuginfod/{debuginfod.h => debuginfod.h.in} (97%)

diff --git a/ChangeLog b/ChangeLog
index 565d021c..71e80a25 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-11-30  Dmitry V. Levin  <ldv@altlinux.org>
+
+	* configure.ac (LIBDEBUGINFOD_SONAME): New AC_SUBST variable.
+	(AC_CONFIG_FILES): Add debuginfod/debuginfod.h.
+
 2020-11-01  Érico N. Rolim  <erico.erc@gmail.com>
 
 	* configure.ac: Check for fts and obstack from outside libc.
diff --git a/configure.ac b/configure.ac
index c1a6954d..2f7316e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,6 +25,9 @@ m4_ifndef([AC_PACKAGE_URL],
                     [Define to home page for this package])
           AC_SUBST([PACKAGE_URL], ["http://elfutils.org/"])])
 
+LIBDEBUGINFOD_SONAME=libdebuginfod.so.1
+AC_SUBST([LIBDEBUGINFOD_SONAME])
+
 # We want eu- as default program prefix if none was given by the user.
 # But if the user explicitly provided --program-prefix="" then pretend
 # it wasn't set at all (NONE). We want to test this really early before
@@ -61,7 +64,7 @@ dnl The RPM spec file.  We substitute a few values in the file.
 AC_CONFIG_FILES([elfutils.spec:config/elfutils.spec.in])
 
 dnl debuginfo-server client & server parts.
-AC_CONFIG_FILES([debuginfod/Makefile])
+AC_CONFIG_FILES([debuginfod/Makefile debuginfod/debuginfod.h])
 
 AC_CANONICAL_HOST
 
diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog
index 3039371f..77fc49e1 100644
--- a/debuginfod/ChangeLog
+++ b/debuginfod/ChangeLog
@@ -1,5 +1,13 @@
 2020-11-30  Dmitry V. Levin  <ldv@altlinux.org>
 
+	* Makefile.am (VERSION): Remove.
+	(libdebuginfod.so): Replace $@.$(VERSION) with $(LIBDEBUGINFOD_SONAME)
+	(install, uninstall, MOSTLYCLEANFILES): Replace
+	libdebuginfod.so.$(VERSION) with $(LIBDEBUGINFOD_SONAME).
+	* debuginfod.h: Rename to ...
+	* debuginfod.h.in ... this.
+	(DEBUGINFOD_SONAME): New macro.
+
 	* Makefile.am (libdebuginfod.so$(EXEEXT)): Drop $(EXEEXT) suffix.
 
 2020-11-25  Frank Ch. Eigler  <fche@redhat.com>
diff --git a/debuginfod/Makefile.am b/debuginfod/Makefile.am
index 352b4915..93423c85 100644
--- a/debuginfod/Makefile.am
+++ b/debuginfod/Makefile.am
@@ -34,7 +34,6 @@ AM_CPPFLAGS += -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
 	   -I$(srcdir)/../libdw -I$(srcdir)/../libdwelf \
 	   $(libmicrohttpd_CFLAGS) $(libcurl_CFLAGS) $(sqlite3_CFLAGS) \
 	   $(libarchive_CFLAGS)
-VERSION = 1
 
 # Disable eu- prefixing for artifacts (binaries & man pages) in this
 # directory, since they do not conflict with binutils tools.
@@ -102,30 +101,30 @@ libdebuginfod_so_LDLIBS = $(libcurl_LIBS) $(fts_LIBS)
 endif
 libdebuginfod.so: $(srcdir)/libdebuginfod.map $(libdebuginfod_so_LIBS)
 	$(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
-		-Wl,--soname,$@.$(VERSION) \
+		-Wl,--soname,$(LIBDEBUGINFOD_SONAME) \
 		-Wl,--version-script,$<,--no-undefined \
 		-Wl,--whole-archive $(libdebuginfod_so_LIBS) -Wl,--no-whole-archive \
 		$(libdebuginfod_so_LDLIBS)
 	@$(textrel_check)
-	$(AM_V_at)ln -fs $@ $@.$(VERSION)
+	$(AM_V_at)ln -fs $@ $(LIBDEBUGINFOD_SONAME)
 endif
 
 if LIBDEBUGINFOD
 install: install-am libdebuginfod.so
 	$(mkinstalldirs) $(DESTDIR)$(libdir)
 	$(INSTALL_PROGRAM) libdebuginfod.so $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so
-	ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdebuginfod.so.$(VERSION)
-	ln -fs libdebuginfod.so.$(VERSION) $(DESTDIR)$(libdir)/libdebuginfod.so
+	ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/$(LIBDEBUGINFOD_SONAME)
+	ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdebuginfod.so
 
 uninstall: uninstall-am
 	rm -f $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so
-	rm -f $(DESTDIR)$(libdir)/libdebuginfod.so.$(VERSION)
+	rm -f $(DESTDIR)$(libdir)/$(LIBDEBUGINFOD_SONAME)
 	rm -f $(DESTDIR)$(libdir)/libdebuginfod.so
 	rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils
 endif
 
 EXTRA_DIST = libdebuginfod.map
-MOSTLYCLEANFILES = $(am_libdebuginfod_pic_a_OBJECTS) libdebuginfod.so.$(VERSION)
+MOSTLYCLEANFILES = $(am_libdebuginfod_pic_a_OBJECTS) $(LIBDEBUGINFOD_SONAME)
 CLEANFILES += $(am_libdebuginfod_pic_a_OBJECTS) libdebuginfod.so
 
 # automake std-options override: arrange to pass LD_LIBRARY_PATH
diff --git a/debuginfod/debuginfod.h b/debuginfod/debuginfod.h.in
similarity index 97%
rename from debuginfod/debuginfod.h
rename to debuginfod/debuginfod.h.in
index 4ee86ce9..559ea947 100644
--- a/debuginfod/debuginfod.h
+++ b/debuginfod/debuginfod.h.in
@@ -36,6 +36,9 @@
 #define DEBUGINFOD_PROGRESS_ENV_VAR "DEBUGINFOD_PROGRESS"
 #define DEBUGINFOD_VERBOSE_ENV_VAR "DEBUGINFOD_VERBOSE"
 
+/* The libdebuginfod soname.  */
+#define DEBUGINFOD_SONAME "@LIBDEBUGINFOD_SONAME@"
+
 /* Handle for debuginfod-client connection.  */
 typedef struct debuginfod_client debuginfod_client;
 
-- 
ldv

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2020-12-09 22:43 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-30  9:00 [PATCH] debuginfod: export DEBUGINFOD_SONAME macro in debuginfod.h Dmitry V. Levin
2020-12-06 12:06 ` Mark Wielaard
2020-12-06 12:28   ` Dmitry V. Levin
2020-12-06 13:32     ` Frank Ch. Eigler
2020-12-06 13:34       ` Dmitry V. Levin
2020-12-06 13:54         ` [PATCH v2 1/3] " Dmitry V. Levin
2020-12-06 13:54         ` [PATCH v2 2/3] debuginfod: create the fully versioned libdebuginfod file name during build Dmitry V. Levin
2020-12-06 14:44           ` [PATCH v2 4/3] debuginfod: create libdebuginfod files using a race-free method Dmitry V. Levin
2020-12-06 13:54         ` [PATCH v2 3/3] libdwfl: do not fall back to dlopen of libdebuginfod.so Dmitry V. Levin
2020-12-08 12:02     ` [PATCH] debuginfod: export DEBUGINFOD_SONAME macro in debuginfod.h Mark Wielaard
2020-12-08 13:30       ` Dmitry V. Levin
2020-12-08 15:15       ` Dmitry V. Levin
2020-12-08 23:07         ` Mark Wielaard
2020-12-08 23:20           ` Dmitry V. Levin
2020-12-09  0:12             ` [PATCH v3 1/3] " Dmitry V. Levin
2020-12-09 22:06               ` Mark Wielaard
2020-12-09  0:13             ` [PATCH v3 2/3] debuginfod: create libdebuginfod.so.1 before libdebuginfod.so Dmitry V. Levin
2020-12-09  0:30               ` Dmitry V. Levin
2020-12-09 22:12                 ` Mark Wielaard
2020-12-09  0:13             ` [PATCH v3 3/3] libdwfl: switch to DEBUGINFOD_SONAME, remove libdebuginfod.so fallback Dmitry V. Levin
2020-12-09 22:43               ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).