Skip to content

Commit

Permalink
Allow for vendor prefix on clang version numbers.
Browse files Browse the repository at this point in the history
Correctly detects the version of OpenBSD's native clang, as well as
Apple's.  Spotted tb@, ok djm@.
  • Loading branch information
daztucker committed Nov 21, 2023
1 parent c52db01 commit 2a19e02
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,11 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
AC_MSG_CHECKING([clang version])
ver="`$CC -v 2>&1`"
if echo "$ver" | grep "Apple" >/dev/null; then
CLANG_VER="apple-`echo "$ver" | \
awk '/Apple LLVM/ {print $4"-"$5}'`"
CLANG_VER=apple-`echo "$ver" | grep 'clang version' | \
$SED 's/.*clang version //g' | $AWK '{print $1}'`
else
CLANG_VER=`echo "$ver" | $AWK '/clang version /{print $3}'`
CLANG_VER=`echo "$ver" | grep 'clang version' | \
$SED 's/.*clang version //g' | $AWK '{print $1}'`
fi
AC_MSG_RESULT([$CLANG_VER])

Expand Down

0 comments on commit 2a19e02

Please sign in to comment.