]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
configure.ac: Avoid the use of "which"
authorAndreas Arnez <arnez@linux.ibm.com>
Thu, 30 Sep 2021 12:10:29 +0000 (14:10 +0200)
committerAndreas Arnez <arnez@linux.ibm.com>
Thu, 30 Sep 2021 14:28:49 +0000 (16:28 +0200)
The "which" command is not always installed, but configure.ac uses it in
the function AC_HWCAP_CONTAINS_FLAG to force invocation of the executable
"true" rather than the shell builtin with the same name.  (The point here
is to get LD_SHOW_AUXV=1 evaluated by the dynamic loader.)

Another option might be to hard-wire the location /bin/true, because the
filesystem hierarchy standard requires it to be there.  However, the FHS
doesn't apply to BSDs and at least some FreeBSD versions do not stick to
that specific rule.

On the other hand, the "env" command seems to be available on all relevant
platforms, so use that instead.

configure.ac

index beb5bba792bb4395ebdb933190bba8305487d0cf..462068a5ac22134e2e222fc53e9a00573cfeabf0 100755 (executable)
@@ -1464,7 +1464,7 @@ AC_CHECK_MEMBER([pthread_mutex_t.__data.__kind],
 AC_DEFUN([AC_HWCAP_CONTAINS_FLAG],[
   AUXV_CHECK_FOR=$1
   AC_MSG_CHECKING([if AT_HWCAP contains the $AUXV_CHECK_FOR indicator])
-  if LD_SHOW_AUXV=1 `which true` | grep ^AT_HWCAP | grep -q -w ${AUXV_CHECK_FOR}
+  if env LD_SHOW_AUXV=1 true | grep ^AT_HWCAP | grep -q -w ${AUXV_CHECK_FOR}
   then
     AC_MSG_RESULT([yes])
     AC_SUBST([$2],[yes])