]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
debuginfod: export DEBUGINFOD_SONAME macro in debuginfod.h
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 9 Dec 2020 00:12:53 +0000 (03:12 +0300)
committerMark Wielaard <mark@klomp.org>
Wed, 9 Dec 2020 19:38:07 +0000 (20:38 +0100)
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
configure.ac
debuginfod/ChangeLog
debuginfod/Makefile.am
debuginfod/debuginfod.h.in [moved from debuginfod/debuginfod.h with 97% similarity]
doc/ChangeLog
doc/debuginfod_find_debuginfo.3

index 565d021c46940283e322d301d23156dabbd86f34..71e80a25129c27cb90d42463e6a0a89ac7f18d1b 100644 (file)
--- 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.
index c1a6954da24572680f8b73edeb9a890674f422e2..2f7316e8f6dfa66f217ea5077148f8fcfe1981d6 100644 (file)
@@ -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
 
index 3039371f0c0803fafcd7c049ff866793614980de..ad5b4d38485ba776d4ba7dbf9a8261cc59d56307 100644 (file)
@@ -1,3 +1,14 @@
+2020-11-30  Dmitry V. Levin  <ldv@altlinux.org>
+
+       * Makefile.am (libdebuginfod.so): Replace $@.$(VERSION) with
+       $(LIBDEBUGINFOD_SONAME).
+       (install, uninstall, MOSTLYCLEANFILES): Replace
+       libdebuginfod.so.$(VERSION) with $(LIBDEBUGINFOD_SONAME).
+       (VERSION): Remove.
+       * debuginfod.h: Rename to ...
+       * debuginfod.h.in ... this.
+       (DEBUGINFOD_SONAME): New macro.
+
 2020-11-30  Dmitry V. Levin  <ldv@altlinux.org>
 
        * Makefile.am (libdebuginfod.so$(EXEEXT)): Drop $(EXEEXT) suffix.
index 352b49156fde468afed90571ffe1fa40f551bb15..93423c85781c90f7420a9871a5313bd433d706d9 100644 (file)
@@ -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
similarity index 97%
rename from debuginfod/debuginfod.h
rename to debuginfod/debuginfod.h.in
index 4ee86ce9086ef4de5dfed67f14e38cc64f40d261..559ea9479349e3e923262ef4427734d9f3bec49e 100644 (file)
@@ -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;
 
index fdf352e7ebcc34a9928e598f975a1256905cd2d7..d8f21dd647fd92a348df1ed3f68dd30ada7dde07 100644 (file)
@@ -1,3 +1,7 @@
+2020-12-06  Dmitry V. Levin  <ldv@altlinux.org>
+
+       * debuginfod_find_debuginfo.3: Document DEBUGINFOD_SONAME macro.
+
 2020-11-11  Mark Wielaard  <mark@klomp.org>
 
        * debuginfod_find_debuginfo.3: Document debuginfod_set_verbose_fd
index 3c6d52f56d38a0ca01404b35bc35fcddc1b6fda1..36c084902c442b1df838deb9c8f6b65f0e94ae60 100644 (file)
@@ -209,6 +209,21 @@ removed from the cache during cleaning. These files should contain only an
 ASCII decimal integer representing the interval or max unused age in seconds.
 The default is one day and one week, respectively.  Values of zero mean "immediately".
 
+.SH "MACROS"
+
+.SS "DEBUGINFOD_SONAME"
+
+Defined to the string that could be passed to
+.BR dlopen (3)
+if the library is loaded at runtime, for example
+
+.PP
+.in +4n
+.EX
+void *debuginfod_so = dlopen(DEBUGINFOD_SONAME, RTLD_LAZY);
+.EE
+.in
+
 .SH "SECURITY"
 .BR debuginfod_find_debuginfo (),
 .BR debuginfod_find_executable (),