aboutsummaryrefslogtreecommitdiff
path: root/gprofng
diff options
context:
space:
mode:
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>2022-10-10 15:34:42 -0700
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>2022-10-11 00:14:06 -0700
commit7b68800441a1572640b34f988c8f71f50b2a70cf (patch)
tree0b5bc7b1ee3bcb2733045411bcd220f91a9ea643 /gprofng
parenta665c4d5c6e1d23d31ac434949b9243025496aef (diff)
downloadgdb-7b68800441a1572640b34f988c8f71f50b2a70cf.zip
gdb-7b68800441a1572640b34f988c8f71f50b2a70cf.tar.gz
gdb-7b68800441a1572640b34f988c8f71f50b2a70cf.tar.bz2
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.
Diffstat (limited to 'gprofng')
-rw-r--r--gprofng/src/Makefile.am2
-rw-r--r--gprofng/src/Makefile.in2
-rw-r--r--gprofng/src/envsets.cc8
3 files changed, 9 insertions, 3 deletions
diff --git a/gprofng/src/Makefile.am b/gprofng/src/Makefile.am
index 6e09315..27ef797 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 ba7fdd6..7efdb98 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 484cbf8..c983841 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);