]> git.kaiwu.me - nginx.git/commitdiff
Configure: fixed clang version detection (closes #1539).
authorRuslan Ermilov <ru@nginx.com>
Tue, 24 Apr 2018 11:04:59 +0000 (14:04 +0300)
committerRuslan Ermilov <ru@nginx.com>
Tue, 24 Apr 2018 11:04:59 +0000 (14:04 +0300)
While 325b3042edd6 fixed it on MINIX, it broke it on systems
that output the word "version" on several lines with "cc -v".
The fix is to only consider "clang version" or "LLVM version"
as clang version, but this time only using sed(1).

auto/cc/clang

index 9d900c258178f1ee3986f3b173afe19393822bca..a962ee234f5aa6cf9b3bb49a4ae654cdbb680644 100644 (file)
@@ -6,7 +6,8 @@
 
 
 NGX_CLANG_VER=`$CC -v 2>&1 | grep 'version' 2>&1 \
-                           | sed -e 's/^.* version \(.*\)/\1/'`
+                           | sed -n -e 's/^.*clang version \(.*\)/\1/p' \
+                                    -e 's/^.*LLVM version \(.*\)/\1/p'`
 
 echo " + clang version: $NGX_CLANG_VER"