diff --git a/configure.ac b/configure.ac index f01cb5379f8..ff96b307d69 100644 --- a/configure.ac +++ b/configure.ac @@ -237,7 +237,7 @@ esac dnl Detect musl libc AC_MSG_CHECKING([whether we are using musl libc]) -if command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl +if command -v ldd >/dev/null && ldd --version 2>&1 | grep ^musl >/dev/null 2>&1 then AC_MSG_RESULT([yes]) AC_DEFINE([__MUSL__], [1], [Define to 1 when using musl libc.]) diff --git a/ext/posix/config.m4 b/ext/posix/config.m4 index ac70068bac8..b7a6e427725 100644 --- a/ext/posix/config.m4 +++ b/ext/posix/config.m4 @@ -43,7 +43,8 @@ if test "$PHP_POSIX" = "yes"; then dnl Skip pathconf and fpathconf check on musl libc due to limited implementation dnl (first argument is not validated and has different error). - AS_IF([command -v ldd >/dev/null && ldd --version 2>&1 | grep -q "^musl"],[], + AS_IF([command -v ldd >/dev/null && ldd --version 2>&1 | grep ^musl >/dev/null 2>&1], + [], [AC_CHECK_FUNCS([pathconf fpathconf])]) AC_CACHE_CHECK([for working ttyname_r() implementation],