build: improve compiler version detection portability

POSIX sed doesn't support extended regular expressions, so convert a
call to the basic format. This caused a problem on AIX. Also, use the
detected sed binary name instead of hard-coding one.
This commit is contained in:
Dan Fandrich 2024-08-20 10:56:59 -07:00
parent ae2c753a88
commit e83c83807d

View File

@ -185,7 +185,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_GNU_C], [
compiler_id="GNU_C"
AC_MSG_CHECKING([compiler version])
# strip '-suffix' parts, e.g. Ubuntu Windows cross-gcc returns '10-win32'
gccver=`$CC -dumpversion | sed -E 's/-.+$//'`
gccver=`$CC -dumpversion | "$SED" 's/-.\{1,\}$//'`
gccvhi=`echo $gccver | cut -d . -f1`
if echo $gccver | grep -F '.' >/dev/null; then
gccvlo=`echo $gccver | cut -d . -f2`