On Sat, Mar 17, 2018 at 12:08:32PM -0400, Jeff King wrote:
> +case "$($CC --version 2>&1)" in
> +gcc*)
> + print_flags gcc
> + ;;
> +clang*)
> + print_flags clang
> + ;;
> +*)
> + : unknown compiler family
> + ;;
> +esac
By the way, one annoying thing is that running "cc --version" when "cc"
is actually "gcc" will print something like:
cc (Debian 7.3.0-11) 7.3.0
even though it supports all of the gcc knobs. This means that:
make DEVELOPER=1
without further config won't get these knobs, because we (rightly)
default CC=cc.
Probably this detection could be a bit more clever, like:
cc*Free Software Foundation")
print_flags gcc
or something. I don't have any non-gcc/clang compilers to test with, so
I'm not sure what they even print for "--version" (if anything).
-Peff