From: vladimir.mezentsev@oracle.com
To: binutils@sourceware.org
Cc: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
Subject: [PATCH 2/2] gprofng: use the --libdir path to find libraries
Date: Mon, 10 Oct 2022 16:04:26 -0700 [thread overview]
Message-ID: <20221010230426.719238-1-vladimir.mezentsev@oracle.com> (raw)
From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
gprofng/ChangeLog
2022-10-10 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
PR gprofng/29663
* src/Makefile.am: Add -DLIBDIR to CPPFLAGS.
* src/Makefile.in: Rebuild.
* src/envsets.cc (putenv_libcollector_ld_misc): Use LIBDIR to find
the gprofng libraries.
---
gprofng/src/Makefile.am | 2 +-
gprofng/src/Makefile.in | 2 +-
gprofng/src/envsets.cc | 8 +++++++-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/gprofng/src/Makefile.am b/gprofng/src/Makefile.am
index 6e0931524e4..27ef7974afe 100644
--- a/gprofng/src/Makefile.am
+++ b/gprofng/src/Makefile.am
@@ -108,7 +108,7 @@ LOCALEDIR = @localedir@
SYSCONFDIR = @sysconfdir@
AM_CPPFLAGS = $(GPROFNG_CPPFLAGS) -DLOCALEDIR=\"$(LOCALEDIR)\" \
- -DSYSCONFDIR=\"$(SYSCONFDIR)\" \
+ -DSYSCONFDIR=\"$(SYSCONFDIR)\" -DLIBDIR=\"$(libdir)\" \
-I.. -I$(srcdir) \
-I$(srcdir)/../common \
-I$(srcdir)/../../include -I$(srcdir)/../../opcodes \
diff --git a/gprofng/src/Makefile.in b/gprofng/src/Makefile.in
index ba7fdd6e8ad..7efdb9885f6 100644
--- a/gprofng/src/Makefile.in
+++ b/gprofng/src/Makefile.in
@@ -536,7 +536,7 @@ ZLIBINC = @zlibinc@
LOCALEDIR = @localedir@
SYSCONFDIR = @sysconfdir@
AM_CPPFLAGS = $(GPROFNG_CPPFLAGS) -DLOCALEDIR=\"$(LOCALEDIR)\" \
- -DSYSCONFDIR=\"$(SYSCONFDIR)\" \
+ -DSYSCONFDIR=\"$(SYSCONFDIR)\" -DLIBDIR=\"$(libdir)\" \
-I.. -I$(srcdir) \
-I$(srcdir)/../common \
-I$(srcdir)/../../include -I$(srcdir)/../../opcodes \
diff --git a/gprofng/src/envsets.cc b/gprofng/src/envsets.cc
index 484cbf83995..c9838416638 100644
--- a/gprofng/src/envsets.cc
+++ b/gprofng/src/envsets.cc
@@ -159,12 +159,18 @@ collect::putenv_libcollector_ld_misc ()
sb.appendf ("%s=", "SP_COLLECTOR_LIBRARY_PATH");
int len = sb.length ();
int cnt = 0;
+ char *fname = dbe_sprintf ("%s/%s/%s", LIBDIR, PACKAGE, LIBGP_COLLECTOR);
+ if (access (fname, R_OK | F_OK) == 0)
+ {
+ ++cnt;
+ sb.appendf ("%s/%s", LIBDIR, PACKAGE);
+ }
+ free (fname);
for (char *s = ev; s;)
{
char *s1 = strchr (s, ':');
if (s1)
*(s1++) = 0;
- char *fname;
if (*s == '/')
{
fname = dbe_sprintf ("%s/%s/%s", s, PACKAGE, LIBGP_COLLECTOR);
--
2.31.1
reply other threads:[~2022-10-10 23:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221010230426.719238-1-vladimir.mezentsev@oracle.com \
--to=vladimir.mezentsev@oracle.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).