2 # SPDX-License-Identifier: GPL-2.0
4 # clang-version clang-command
6 # Print the compiler version of `clang-command' in a 5 or 6-digit form
7 # such as `50001' for clang-5.0.1 etc.
11 if ! ( $compiler --version | grep -q clang) ; then
16 MAJOR=$(echo __clang_major__ | $compiler -E -x c - | tail -n 1)
17 MINOR=$(echo __clang_minor__ | $compiler -E -x c - | tail -n 1)
18 PATCHLEVEL=$(echo __clang_patchlevel__ | $compiler -E -x c - | tail -n 1)
19 printf "%d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL