From: Andreas Arnez Date: Thu, 30 Sep 2021 12:10:29 +0000 (+0200) Subject: configure.ac: Avoid the use of "which" X-Git-Tag: VALGRIND_3_18_0~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=724460764d3613cb9092ede2a238d7dcb88f8055;p=thirdparty%2Fvalgrind.git configure.ac: Avoid the use of "which" 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. --- diff --git a/configure.ac b/configure.ac index beb5bba792..462068a5ac 100755 --- a/configure.ac +++ b/configure.ac @@ -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])