Fix compiler check when CC has arguments appended

This commit is contained in:
hmelder 2024-09-08 17:41:39 +02:00
parent 7e949ba826
commit 847a42dcba
2 changed files with 6 additions and 2 deletions

4
configure vendored
View file

@ -5696,7 +5696,9 @@ fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5
printf %s "checking whether the compiler is clang... " >&6; }
if "${CC}" -v 2>&1 | grep -q 'clang version'; then
# CC may have flags appended to it, so we need to extract the actual
# compiler name.
if "$(echo "${CC}" | awk '{print $1}')" -v 2>&1 | grep -q 'clang version'; then
CLANG_CC=yes
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }

View file

@ -1120,7 +1120,9 @@ AC_PROG_CPP
AC_USE_SYSTEM_EXTENSIONS
AC_MSG_CHECKING(whether the compiler is clang)
if "${CC}" -v 2>&1 | grep -q 'clang version'; then
# CC may have flags appended to it, so we need to extract the actual
# compiler name.
if "$(echo "${CC}" | awk '{print $1}')" -v 2>&1 | grep -q 'clang version'; then
CLANG_CC=yes
AC_MSG_RESULT(yes)
else