[binutils-gdb] gprofng: avoid use of non-portable which [PR32166]

Sam James sjames@sourceware.org
Thu Sep 12 21:54:00 GMT 2024


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

commit 669aeefedb052360e16d7572b72f22cf2f81df01
Author: Sam James <sam@gentoo.org>
Date:   Wed Sep 11 22:01:49 2024 +0100

    gprofng: avoid use of non-portable which [PR32166]
    
    Distributions like Debian [0] and Gentoo are phasing out the use of
    the non-portable `which` utility. Use POSIX's `command -v` instead.
    
    [0] https://lwn.net/Articles/874049/
    
    gprofng/ChangeLog
            PR gprofng/32166
            * testsuite/lib/Makefile.skel (JAVABIN): Replace use of which.

Diff:
---
 gprofng/testsuite/lib/Makefile.skel | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gprofng/testsuite/lib/Makefile.skel b/gprofng/testsuite/lib/Makefile.skel
index 8ea994d2e59..2c98720c4c4 100644
--- a/gprofng/testsuite/lib/Makefile.skel
+++ b/gprofng/testsuite/lib/Makefile.skel
@@ -23,7 +23,7 @@ CFLAGS      = -g -Wall
 SHAREDOPT	= -fpic	-shared
 
 #JAVABIN = /usr/java/latest/bin
-JAVABIN = $(shell dirname `which java`)
+JAVABIN = $(shell dirname `command -v java`)
 JAVA    = $(JAVABIN)/java
 JAVAC   = $(JAVABIN)/javac


More information about the Binutils-cvs mailing list