This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[PATCH] Check for program_invocation_short_name
- From: Ulf Hermann <ulf dot hermann at qt dot io>
- To: elfutils-devel at sourceware dot org
- Date: Wed, 22 Feb 2017 15:37:37 +0100
- Subject: [PATCH] Check for program_invocation_short_name
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=ulf dot hermann at qt dot io;
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qtcompany.onmicrosoft.com; s=selector1-qt-io; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=6HJ+JmFROqGeyHN+yPxc9WZxEWFafuqU9f/peIl1fU8=; b=cXEdC24kTehfmQDRTB9Usj1szoOlXV3ckJbPf1qEV5tiigDNk9nXz3bXb4QoRrLL/2C4BXjbynkqztam8vtrLJ1vhn6zQhl6sanr+9aDK9rgY2k39anz8xBTpDd5NEfyI8g+oIho5Oj1hYRRcAQ+7R4paRJ83Srn6nhGRiUu2zY=
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
If it doesn't exist use "<elfutil>" as generic replacement.
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
---
ChangeLog | 4 ++++
configure.ac | 5 +++++
lib/ChangeLog | 5 +++++
lib/system.h | 4 ++++
src/ChangeLog | 4 ++++
src/elfcmp.c | 1 +
6 files changed, 23 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 1acc8ba..31285e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2017-02-22 Ulf Hermann <ulf.hermann@qt.io>
+ * configure.ac: Add check for program_invocation_short_name.
+
+2017-02-22 Ulf Hermann <ulf.hermann@qt.io>
+
* configure.ac: Check for strerror_r and its variants.
2017-02-22 Ulf Hermann <ulf.hermann@qt.io>
diff --git a/configure.ac b/configure.ac
index ce40539..9a9404b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -309,6 +309,10 @@ AC_CHECK_DECLS([fputs_unlocked],[],[],
[#define _GNU_SOURCE
#include <stdio.h>])
+AC_CHECK_DECLS([program_invocation_short_name],[],[],
+ [#define _GNU_SOURCE
+ #include <errno.h>])
+
AC_FUNC_STRERROR_R
AC_CHECK_LIB([stdc++], [__cxa_demangle], [dnl
@@ -407,6 +411,7 @@ else
with_argp="yes"
argp_LDADD=""
fi
+
AC_SUBST([argp_LDADD])
AM_CONDITIONAL(ARGP, [test "x$with_argp" = "xyes"])
diff --git a/lib/ChangeLog b/lib/ChangeLog
index d9aabfa..847ca87 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,5 +1,10 @@
2017-02-22 Ulf Hermann <ulf.hermann@qt.io>
+ * system.h: Define program_invocation_short_name to "<elfutil>" if
+ !HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME.
+
+2017-02-22 Ulf Hermann <ulf.hermann@qt.io>
+
* system.h: Define fputs_unlocked to fputs if
!HAVE_DECL_FPUTS_UNLOCKED.
diff --git a/lib/system.h b/lib/system.h
index dc78997..f71e85c 100644
--- a/lib/system.h
+++ b/lib/system.h
@@ -88,6 +88,10 @@ char *basename (const char *path);
#define fputs_unlocked(str, stream) fputs (str, stream)
#endif
+#if !HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+#define program_invocation_short_name "<elfutil>"
+#endif
+
/* A special gettext function we use if the strings are too short. */
#define sgettext(Str) \
({ const char *__res = strrchr (gettext (Str), '|'); \
diff --git a/src/ChangeLog b/src/ChangeLog
index bdf04cc..29aa8eb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
2017-02-22 Ulf Hermann <ulf.hermann@qt.io>
+ * elfcmp.c: Include system.h.
+
+2017-02-22 Ulf Hermann <ulf.hermann@qt.io>
+
* arlib-argp.c: Include system.h.
* unstrip.c: Likewise.
diff --git a/src/elfcmp.c b/src/elfcmp.c
index 7673cf2..ea34527 100644
--- a/src/elfcmp.c
+++ b/src/elfcmp.c
@@ -34,6 +34,7 @@
#include <unistd.h>
#include <printversion.h>
+#include <system.h>
#include "../libelf/elf-knowledge.h"
#include "../libebl/libeblP.h"
--
2.1.4