public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Vladimir Mezentsev <vmezents@sourceware.org>
To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org
Subject: [binutils-gdb] gprofng: use the --libdir path to find libraries
Date: Tue, 11 Oct 2022 07:18:13 +0000 (GMT)	[thread overview]
Message-ID: <20221011071813.7CCBC3858C2D@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7b68800441a1572640b34f988c8f71f50b2a70cf

commit 7b68800441a1572640b34f988c8f71f50b2a70cf
Author: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
Date:   Mon Oct 10 15:34:42 2022 -0700

    gprofng: use the --libdir path to find libraries
    
    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.

Diff:
---
 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);

                 reply	other threads:[~2022-10-11  7:18 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=20221011071813.7CCBC3858C2D@sourceware.org \
    --to=vmezents@sourceware.org \
    --cc=bfd-cvs@sourceware.org \
    --cc=gdb-cvs@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).