summaryrefslogtreecommitdiff
path: root/detect-compiler
AgeCommit message (Collapse)AuthorFilesLines
2021-08-06build: catch clang that identifies itself as "$VENDOR clang"Libravatar Junio C Hamano1-5/+2
The case statement in detect-compiler notices 'clang', 'FreeBSD clang' and 'Apple clang', but there are other platforms that follow the '$VENDOR clang' pattern (e.g. Debian). Generalize the pattern to catch them. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-08-06build: clang version may not be followed by extra wordsLibravatar Jeff King1-2/+2
The get_family and get_version helpers of detect-compiler assume that the line to identify the version from the compilers have a token "version", followed by the version number, followed by some other string, e.g. $ CC=gcc get_version_line gcc version 10.2.1 20210110 (Debian 10.2.1-6) But that is not necessarily true, e.g. $ CC=clang get_version_line Debian clang version 11.0.1-2 Tweak the script not to require extra string after the version. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-08-06build: update detect-compiler for newer Xcode versionLibravatar Carlo Marcelo Arenas Belón1-1/+1
1da1580e4c (Makefile: detect compiler and enable more warnings in DEVELOPER=1, 2018-04-14) uses the output of the compiler banner to detect the compiler family. Apple had since changed the wording used to refer to its compiler as clang instead of LLVM as shown by: $ cc --version Apple clang version 12.0.5 (clang-1205.0.22.9) Target: x86_64-apple-darwin20.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin so update the script to match, and allow DEVELOPER=1 to work as expected again in macOS. Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-04-16Makefile: detect compiler and enable more warnings in DEVELOPER=1Libravatar Nguyễn Thái Ngọc Duy1-0/+53
The set of extra warnings we enable when DEVELOPER has to be conservative because we can't assume any compiler version the developer may use. Detect the compiler version so we know when it's safe to enable -Wextra and maybe more. These warning settings are mostly from my custom config.mak a long time ago when I tried to enable as many warnings as possible that can still build without showing warnings. Some of those warnings are probably worth fixing instead of just suppressing in future. Helped-by: Jeff King <peff@peff.net> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>